Qlty provides detailed code quality metrics and ratings to help you understand and improve the maintainability of your codebase. Here’s a rundown of all of them.
Out of the total lines in a file, Qlty differentiates between blank lines, comment lines and lines of code. Our lines of code metric represents executable lines in a file, without counting comments and blank lines.
Issues are findings from analysis that Qlty runs on your codebase. They can range from complexity and duplication issues, to lint results from supported plugins like ESLint, Semgrep, and Clippy.
Code smells are indicators of maintainability problems in the code that may not be bugs but could lead to issues in the future. Qlty’s analysis finds code smells as issues in the Duplication and Structure categories.When using the CLI, you can run the qlty smells command to analyze your codebase for smells. The output will be a list of duplication and/or structure issues.
Qlty issues come with a Level which represents severity. We use a simple level system of high, medium, and low. You can use the level attribute to assess priorities when fixing issues in your codebase.
This metric is an estimate of the time in minutes that a developer may invest to remediate a code smell. Qlty calculates this number for duplication and structure issues. This number is used to help compute your codebase’s technical debt.
Code complexity is a measure of the difficulty to understand, test and maintain code. The higher the complexity, the more difficult it will be to achieve clean, readable and maintainable code.
In Qlty, we use the term Complexity to refer to cognitive complexity. Cognitive complexity measures how difficult it is for a human to understand a piece of code. It takes into account the structural elements that affect readability and understandability, unlike cyclomatic complexity, which only counts the number of branches.For example, deeply nested code, complex conditionals, and the use of recursion can increase cognitive complexity.
Cyclomatic complexity, sometimes referred to as McCabe’s complexity, is a count of the linearly independent paths through source code. You can also think of this more simply as “the number of decisions a given block of code needs to make”. As the code branches out into different paths using constructs like if-else statements and loops, the cyclomatic complexity increases.For example, a simple function with no branching (if-else statements, loops) has a cyclomatic complexity of 1. Each additional branch increases the complexity by 1.
Code duplication measures the amount of code that is repeated in a similar or identical form within the project. Reducing duplication helps in maintaining DRY (Don’t Repeat Yourself) principles, making the code easier to maintain and less error-prone.Duplication is calculated as the percentage of lines that are duplicated in your code. For example, if a file has 100 lines and 10 of those lines are duplicated, the duplication percentage is 10%.
Technical Debt sums the total effort (or remediation time) of the maintainability issues (structure and duplication) within a unit of code. This estimates how long it would take to improve the code to a high level of maintainability.
The Technical Debt Ratio is obtained by dividing the Technical Debt to fix all the code smells by the estimated effort to rewrite the code from scratch. The higher the ratio, the more challenging a project will be to maintain and iterate over time.Qlty uses the Basic Constructive Cost Model (COCOMO) to estimate the time in person-months required to develop a software project.For example, if resolving all code smells in a project is estimated to take 3 weeks, and we estimate the project required 30 weeks to develop, the technical debt ratio would be 10%.
There are a number of ratings that are computed using your project’s metrics. Ratings helpe make code quality information easy to understand at a glance. They can be observed at a project level, as well as directory and file level.
This is the percentage of the lines that are duplicated in your code. You can see this metric at project, directory, and file level as the division between the count of duplicated lines over the total lines of code.
Code coverage refers to the percentage of lines of code which are executed by automated unit tests. You can see this as a letter grade in your project, directory, and file views.At all levels, the coverage rating is calculated as the division between the count of covered lines over the relevant lines of code. Lines that are considered irrelevant to the supported coverage tools are not counted in the total.The grade is then defined as follows:
Coverage %
Grade
90% or more
A
80% to 90%
B
70% to 80%
C
60% to 70%
D
less than 60%
F
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Qlty Docs","colors":{"primary":"#08B2B7","light":"#66FAEC","dark":"#08B2B7"},"logo":{"light":"https://mintcdn.com/qltysoftware/WE5EjhygR2JGFw2L/assets/qlty_logo_black.svg?fit=max\u0026auto=format\u0026n=WE5EjhygR2JGFw2L\u0026q=85\u0026s=953dc5550d8d7b301bab57c551c2e095","dark":"https://mintcdn.com/qltysoftware/WE5EjhygR2JGFw2L/assets/qlty_logo_light.svg?fit=max\u0026auto=format\u0026n=WE5EjhygR2JGFw2L\u0026q=85\u0026s=314c810c7988344145e96a72d93a64e1"},"favicon":"https://mintcdn.com/qltysoftware/WE5EjhygR2JGFw2L/assets/favicon.png?fit=max\u0026auto=format\u0026n=WE5EjhygR2JGFw2L\u0026q=85\u0026s=c6b170f43aafed94940cea1b71d16fcf","background":{"color":{"light":"#f6f6f6","dark":"#000000"}},"navbar":{"links":[{"href":"/cloud/support","label":"Get Support"}],"primary":{"type":"button","label":"Back to App","href":"https://qlty.sh/dashboard"}},"search":{"prompt":"Search documentation..."},"fonts":{"heading":{"family":"Aeonik","weight":600,"source":"assets/Aeonik-Bold.woff2","format":"woff2"},"body":{"family":"Inter"}},"styling":{"codeblocks":"system","latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"qltysoftware","hasAudioNarration":false,"actualSubdomain":"qltysoftware","customDomains":["docs.qlty.sh"],"gitSource":{"type":"github","owner":"qltysh","repo":"cloud","deployBranch":"main","contentDirectory":"mintlify-docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae38ea18825b2cb9ed2ea12","collectionId":"5f391cb2-e257-4414-bdcc-f8a834f5daad","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae38ea18825b2cb9ed2ea12"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae38ea18825b2cb9ed2ea12","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"Qlty CLI","count":56},{"language":"default","tag":"Qlty Cloud","count":38},{"language":"default","tag":"All Commands","count":31},{"language":"default","tag":"Home","count":29},{"language":"default","tag":"Code Coverage","count":29},{"language":"default","tag":"API Reference","count":27},{"language":"default","tag":"Endpoints","count":26},{"language":"default","tag":"Additional Information","count":20},{"language":"default","tag":"Getting Started","count":16},{"language":"default","tag":"Programming Languages","count":16}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".pretty-table{width:100%;table-layout:fixed;border:1px solid #ddd}.pretty-table thead{background-color:#f2f2f2}.pretty-table tbody{background-color:#fff}.pretty-table td,.pretty-table th{padding:8px;text-align:center;border:1px solid #ddd}.pretty-table td:first-child,.pretty-table th:first-child{padding:8px 12px;text-align:left}.pretty-table .divider-row{background-color:#f2f2f2;font-weight:700}.dark .pretty-table,.dark .pretty-table td,.dark .pretty-table th{border:1px solid #dddddd36}.dark .pretty-table .divider-row,.dark .pretty-table thead{background-color:rgb(102 250 236/10%)}.dark .pretty-table tbody{background-color:transparent}#mermaid-carry-forward{display:flex;justify-content:center;align-items:center;width:100%}#content-area h1{font-size:36px!important;font-weight:800!important;line-height:45px!important}#content-area h2,#content-area table th{font-weight:700!important}#content-area h3{font-size:20px!important;line-height:32px!important}.eyebrow{color:#007277}.code-group [role=tab],.code-group [role=tab]>div{color:#707575;font-size:14px!important}.code-group [role=tab][data-state=active],.code-group [role=tab][data-state=active]>div{color:#2a2a2a;font-weight:600}#content-area table th{background-color:rgb(0 0 0/2.4%)}#content-area table td,#content-area table th{padding:8px!important;border-bottom:1px solid rgb(0 0 0/12%)!important}.dark #content-area table th{background-color:rgb(255 255 255/4%)}.dark #content-area table td,.dark #content-area table th{border-bottom-color:rgb(255 255 255/12%)!important}[data-component-part=step-number]>div{background-color:rgb(255 255 255/80%)!important;border:1px solid rgb(0 0 0/12%)}.dark [data-component-part=step-number]>div{background-color:rgb(255 255 255/10%)!important;border:1px solid rgb(255 255 255/15%)}#sidebar-content a[class*=bg-primary]{color:#007277!important;background-color:rgb(4 189 196/15.7%)!important}.dark #sidebar-content a[class*=bg-primary]{color:#66faec!important;background-color:rgb(102 250 236/15.7%)!important}#content-area :not(pre)>code,#content-area :not(pre)>span>code{background-color:rgb(255 255 255/80%)!important;box-shadow:rgb(0 0 0/12%) 0 0 0 1px inset!important;border-radius:4px!important;padding:2px 4px!important;color:#007277!important}#content-area h1 :not(pre,a)>code,#content-area h1 :not(pre,a)>span>code,#content-area h2 :not(pre,a)>code,#content-area h2 :not(pre,a)>span>code,#content-area h3 :not(pre,a)>code,#content-area h3 :not(pre,a)>span>code,#content-area h4 :not(pre,a)>code,#content-area h4 :not(pre,a)>span>code,h1 #content-area :not(pre)>code,h1 #content-area :not(pre)>span>code,h2 #content-area :not(pre)>code,h2 #content-area :not(pre)>span>code{color:inherit!important;font-weight:inherit!important;font-size:inherit!important}.code-block code,.code-block pre{font-family:Menlo,Consolas,\"DejaVu Sans Mono\",monospace!important}#content-area table{table-layout:auto!important;width:100%!important}#content-area table code{white-space:nowrap!important}#content-area .text-primary,#content-area .text-primary-light,.toc .text-primary{color:#007277!important}.dark #content-area .text-primary,.dark #content-area .text-primary-light,.dark .toc .text-primary{color:#66faec!important}"}],"page":{"pagePath":"cloud/maintainability/metrics","slug":"/cloud/maintainability/metrics","pageMetadata":{"title":"Maintainability Metrics and Ratings","sidebarTitle":"Quality Metrics and Ratings","description":null,"href":"/cloud/maintainability/metrics"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Table}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Qlty provides detailed code quality metrics and ratings to help you understand and improve the maintainability of your codebase. Here’s a rundown of all of them.`}),`\n`,_jsx(Heading,{level:`2`,id:`metrics`,children:`Metrics`}),`\n`,_jsx(Heading,{level:`3`,id:`lines-of-code`,children:`Lines of Code`}),`\n`,_jsxs(_components.p,{children:[`Out of the total lines in a file, Qlty differentiates between blank lines, comment lines and `,_jsx(_components.strong,{children:`lines of code`}),`. Our lines of code metric represents executable lines in a file, without counting comments and blank lines.`]}),`\n`,_jsx(Heading,{level:`3`,id:`issues`,children:`Issues`}),`\n`,_jsx(_components.p,{children:`Issues are findings from analysis that Qlty runs on your codebase. They can range from complexity and duplication issues, to lint results from supported plugins like ESLint, Semgrep, and Clippy.`}),`\n`,_jsx(Heading,{level:`4`,id:`code-smells`,children:`Code Smells`}),`\n`,_jsxs(_components.p,{children:[`Code smells are indicators of maintainability problems in the code that may not be bugs but could lead to issues in the future. Qlty’s analysis finds code smells as issues in the `,_jsx(_components.code,{children:`Duplication`}),` and `,_jsx(_components.code,{children:`Structure`}),` categories.`]}),`\n`,_jsxs(_components.p,{children:[`When using the CLI, you can run the `,_jsx(_components.code,{children:`qlty smells`}),` command to analyze your codebase for smells. The output will be a list of duplication and/or structure issues.`]}),`\n`,_jsx(Heading,{level:`4`,id:`vulnerabilities`,children:`Vulnerabilities`}),`\n`,_jsx(_components.p,{children:`Vulnerabilities are security-related issues.`}),`\n`,_jsx(Heading,{level:`4`,id:`issue-levels`,children:`Issue Levels`}),`\n`,_jsxs(_components.p,{children:[`Qlty issues come with a Level which represents severity. We use a simple level system of high, medium, and low. You can use the `,_jsx(_components.code,{children:`level`}),` attribute to assess priorities when fixing issues in your codebase.`]}),`\n`,_jsx(Heading,{level:`4`,id:`effort`,children:`Effort`}),`\n`,_jsxs(_components.p,{children:[`This metric is an estimate of the time in minutes that a developer may invest to remediate a code smell. Qlty calculates this number for `,_jsx(_components.code,{children:`duplication`}),` and `,_jsx(_components.code,{children:`structure`}),` issues. This number is used to help compute your codebase’s `,_jsx(_components.a,{href:`#technical-debt`,children:`technical debt`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`complexity`,children:`Complexity`}),`\n`,_jsx(_components.p,{children:`Code complexity is a measure of the difficulty to understand, test and maintain code. The higher the complexity, the more difficult it will be to achieve clean, readable and maintainable code.`}),`\n`,_jsx(Heading,{level:`4`,id:`complexity-2`,children:`Complexity`}),`\n`,_jsxs(_components.p,{children:[`In Qlty, we use the term Complexity to refer to `,_jsx(_components.em,{children:`cognitive`}),` complexity. Cognitive complexity measures how difficult it is for a human to understand a piece of code. It takes into account the structural elements that affect readability and understandability, unlike cyclomatic complexity, which only counts the number of branches.`]}),`\n`,_jsx(_components.p,{children:`For example, deeply nested code, complex conditionals, and the use of recursion can increase cognitive complexity.`}),`\n`,_jsx(Heading,{level:`4`,id:`cyclomatic-complexity`,children:`Cyclomatic Complexity`}),`\n`,_jsx(_components.p,{children:`Cyclomatic complexity, sometimes referred to as McCabe’s complexity, is a count of the linearly independent paths through source code. You can also think of this more simply as “the number of decisions a given block of code needs to make”. As the code branches out into different paths using constructs like if-else statements and loops, the cyclomatic complexity increases.`}),`\n`,_jsx(_components.p,{children:`For example, a simple function with no branching (if-else statements, loops) has a cyclomatic complexity of 1. Each additional branch increases the complexity by 1.`}),`\n`,_jsx(Heading,{level:`3`,id:`duplication`,children:`Duplication`}),`\n`,_jsx(_components.p,{children:`Code duplication measures the amount of code that is repeated in a similar or identical form within the project. Reducing duplication helps in maintaining DRY (Don’t Repeat Yourself) principles, making the code easier to maintain and less error-prone.`}),`\n`,_jsx(_components.p,{children:`Duplication is calculated as the percentage of lines that are duplicated in your code. For example, if a file has 100 lines and 10 of those lines are duplicated, the duplication percentage is 10%.`}),`\n`,_jsx(Heading,{level:`3`,id:`technical-debt`,children:`Technical Debt`}),`\n`,_jsx(_components.p,{children:`Technical Debt sums the total effort (or remediation time) of the maintainability issues (structure and duplication) within a unit of code. This estimates how long it would take to improve the code to a high level of maintainability.`}),`\n`,_jsx(Heading,{level:`3`,id:`technical-debt-ratio`,children:`Technical Debt Ratio`}),`\n`,_jsx(_components.p,{children:`The Technical Debt Ratio is obtained by dividing the Technical Debt to fix all the code smells by the estimated effort to rewrite the code from scratch. The higher the ratio, the more challenging a project will be to maintain and iterate over time.`}),`\n`,_jsx(_components.p,{children:`Qlty uses the Basic Constructive Cost Model (COCOMO) to estimate the time in person-months required to develop a software project.`}),`\n`,_jsx(_components.p,{children:`For example, if resolving all code smells in a project is estimated to take 3 weeks, and we estimate the project required 30 weeks to develop, the technical debt ratio would be 10%.`}),`\n`,_jsx(Heading,{level:`2`,id:`ratings`,children:`Ratings`}),`\n`,_jsx(_components.p,{children:`There are a number of ratings that are computed using your project’s metrics. Ratings helpe make code quality information easy to understand at a glance. They can be observed at a project level, as well as directory and file level.`}),`\n`,_jsx(Heading,{level:`3`,id:`size`,children:`Size`}),`\n`,_jsx(_components.p,{children:`This rating represents the total lines of code, counting comments and blank lines.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`At a project level, you can see a T-shirt size rating that estimates the size of your project with the following definition:`}),`\n`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Lines of code`}),_jsx(_components.th,{children:`Size`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`less than 1k`}),_jsx(_components.td,{children:`XS`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`less than 10k`}),_jsx(_components.td,{children:`S`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`less than 100k`}),_jsx(_components.td,{children:`M`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`500k or less`}),_jsx(_components.td,{children:`L`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`more than 500k`}),_jsx(_components.td,{children:`XL`})]})]})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`At a directory level, you can see the sum of the lines in each file under that folder.`}),`\n`,_jsx(_components.li,{children:`At a file level, you can see the line count in the file.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`maintainability`,children:`Maintainability`}),`\n`,_jsx(_components.p,{children:`The maintainability rating is a letter grade that is given depending on your technical debt or effort metrics.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`At a project level, the letter grades are defined based on your technical debt ratio, like this:`}),`\n`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Technical Debt Ratio`}),_jsx(_components.th,{children:`Rating`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`less than 5%`}),_jsx(_components.td,{children:`A`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`5% to 10%`}),_jsx(_components.td,{children:`B`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`10% to 20%`}),_jsx(_components.td,{children:`C`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`20% to 50%`}),_jsx(_components.td,{children:`D`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`50% or more`}),_jsx(_components.td,{children:`F`})]})]})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`At a file and directory level, the grades are calculated using a logorithmic function based on the total Technical Debt.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`duplication-2`,children:`Duplication`}),`\n`,_jsx(_components.p,{children:`This is the percentage of the lines that are duplicated in your code. You can see this metric at project, directory, and file level as the division between the count of duplicated lines over the total lines of code.`}),`\n`,_jsx(Heading,{level:`3`,id:`coverage`,children:`Coverage`}),`\n`,_jsx(_components.p,{children:`Code coverage refers to the percentage of lines of code which are executed by automated unit tests. You can see this as a letter grade in your project, directory, and file views.`}),`\n`,_jsx(_components.p,{children:`At all levels, the coverage rating is calculated as the division between the count of covered lines over the relevant lines of code. Lines that are considered irrelevant to the supported coverage tools are not counted in the total.`}),`\n`,_jsx(_components.p,{children:`The grade is then defined as follows:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Coverage %`}),_jsx(_components.th,{children:`Grade`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`90% or more`}),_jsx(_components.td,{children:`A`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`80% to 90%`}),_jsx(_components.td,{children:`B`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`70% to 80%`}),_jsx(_components.td,{children:`C`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`60% to 70%`}),_jsx(_components.td,{children:`D`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`less than 60%`}),_jsx(_components.td,{children:`F`})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Maintainability Metrics and Ratings","sidebarTitle":"Quality Metrics and Ratings","description":null,"href":"/cloud/maintainability/metrics"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Metrics","slug":"metrics","depth":2,"children":[{"title":"Lines of Code","slug":"lines-of-code","depth":3,"children":[]},{"title":"Issues","slug":"issues","depth":3,"children":[]},{"title":"Code Smells","slug":"code-smells","depth":4,"children":[]},{"title":"Vulnerabilities","slug":"vulnerabilities","depth":4,"children":[]},{"title":"Issue Levels","slug":"issue-levels","depth":4,"children":[]},{"title":"Effort","slug":"effort","depth":4,"children":[]},{"title":"Complexity","slug":"complexity","depth":3,"children":[]},{"title":"Complexity","slug":"complexity-2","depth":4,"children":[]},{"title":"Cyclomatic Complexity","slug":"cyclomatic-complexity","depth":4,"children":[]},{"title":"Duplication","slug":"duplication","depth":3,"children":[]},{"title":"Technical Debt","slug":"technical-debt","depth":3,"children":[]},{"title":"Technical Debt Ratio","slug":"technical-debt-ratio","depth":3,"children":[]}]},{"title":"Ratings","slug":"ratings","depth":2,"children":[{"title":"Size","slug":"size","depth":3,"children":[]},{"title":"Maintainability","slug":"maintainability","depth":3,"children":[]},{"title":"Duplication","slug":"duplication-2","depth":3,"children":[]},{"title":"Coverage","slug":"coverage","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"qltysoftware","siteName":"Qlty Docs","title":"Maintainability Metrics and Ratings - Qlty Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-28T20:34:29.676Z","originalFileLocation":"cloud/maintainability/metrics.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Qlty Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Maintainability Metrics and Ratings - Qlty Docs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Qlty Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.qlty.sh/cloud/maintainability/metrics\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://qltysoftware.mintlify.app/_mintlify/api/og/v2?division=Improving+Code+Maintainability\u0026amp;title=Maintainability+Metrics+and+Ratings\u0026amp;theme=f77b4adcd6006d656f331cf4\u0026amp;signature=c1329dfecf5a121e1c77b1381e8f6ff9ef95a55426588ef93c395f069965d644\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Maintainability Metrics and Ratings - Qlty Docs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://qltysoftware.mintlify.app/_mintlify/api/og/v2?division=Improving+Code+Maintainability\u0026amp;title=Maintainability+Metrics+and+Ratings\u0026amp;theme=f77b4adcd6006d656f331cf4\u0026amp;signature=c1329dfecf5a121e1c77b1381e8f6ff9ef95a55426588ef93c395f069965d644\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/qltysoftware/7vmNS6Tx05_OCSe5/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Qlty Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#08B2B7\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.qlty.sh/cloud/maintainability/metrics\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cloud/maintainability/metrics.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.qlty.sh/#organization\",\"name\":\"Qlty Docs\",\"url\":\"https://docs.qlty.sh\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/qltysoftware/WE5EjhygR2JGFw2L/assets/qlty_logo_black.svg?fit=max\u0026auto=format\u0026n=WE5EjhygR2JGFw2L\u0026q=85\u0026s=953dc5550d8d7b301bab57c551c2e095\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.qlty.sh#website\",\"name\":\"Qlty Docs\",\"url\":\"https://docs.qlty.sh\",\"publisher\":{\"@id\":\"https://docs.qlty.sh/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.qlty.sh/cloud/maintainability/metrics#webpage\",\"url\":\"https://docs.qlty.sh/cloud/maintainability/metrics\",\"name\":\"Maintainability Metrics and Ratings\",\"dateModified\":\"2026-10-28T20:34:29.676Z\",\"isPartOf\":{\"@id\":\"https://docs.qlty.sh#website\"},\"breadcrumb\":{\"@id\":\"https://docs.qlty.sh/cloud/maintainability/metrics#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.qlty.sh/cloud/maintainability/metrics#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Qlty Docs\",\"item\":\"https://docs.qlty.sh\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Maintainability Metrics and Ratings\",\"item\":\"https://docs.qlty.sh/cloud/maintainability/metrics\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.qlty.sh/cloud/maintainability/metrics#article\",\"headline\":\"Maintainability Metrics and Ratings\",\"name\":\"Maintainability Metrics and Ratings\",\"url\":\"https://docs.qlty.sh/cloud/maintainability/metrics\",\"mainEntityOfPage\":{\"@id\":\"https://docs.qlty.sh/cloud/maintainability/metrics#webpage\"},\"dateModified\":\"2026-10-28T20:34:29.676Z\",\"publisher\":{\"@id\":\"https://docs.qlty.sh/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.qlty.sh#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Qlty Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Qlty Docs","nav":{"global":null,"tabs":[{"tab":"Home","icon":"house","pages":[{"title":"Home","href":"/what-is-qlty"}]},{"tab":"Qlty CLI","icon":"square-terminal","pages":[{"title":"Qlty CLI","href":"/cli/quickstart"}]},{"tab":"Qlty Cloud","icon":"cloud","groups":[{"group":"Getting Started","pages":[{"title":"Setting up Qlty","sidebarTitle":"Quick Start","href":"/cloud/quickstart"},{"title":"Continuous Quality","href":"/cloud/continuous-quality"},{"title":"Automated Code Review","href":"/cloud/automated-code-review"},{"title":"Quality Gates","href":"/cloud/gates"},{"title":"Analysis Frequency","description":null,"href":"/cloud/analysis-frequency"}]},{"group":"Improving Code Maintainability","pages":[{"title":"Maintainability Metrics and Ratings","sidebarTitle":"Quality Metrics and Ratings","href":"/cloud/maintainability/metrics"},{"title":"Triaging Issues with Qlty Cloud","sidebarTitle":"Triaging Issues","description":null,"href":"/cloud/triaging-issues"}]},{"group":"Security Scanning","pages":[{"title":"Security Framework","sidebarTitle":"Security Framework","href":"/cloud/security/framework"},{"title":"Implementing Security Scanning","sidebarTitle":"Implementing Security Scanning","href":"/cloud/security/implementing"}]},{"group":"Artificial Intelligence","pages":[{"title":"AI Explanations","href":"/cloud/ai-explanations"},{"title":"AI Autofixes","href":"/cloud/ai-autofixes"}]},{"group":"Browsing Projects","pages":[{"title":"Overview","href":"/cloud/projects/overview"},{"title":"Code","href":"/cloud/projects/code"},{"title":"Issues","href":"/cloud/projects/issues"},{"title":"Pull Requests","href":"/cloud/projects/pull-requests"},{"title":"Applications","href":"/cloud/applications"}]},{"group":"Billing, Payments, and Plans","pages":[{"title":"Plans and Features","href":"/cloud/billing/plans"},{"title":"Limits on the Free Version","href":"/cloud/billing/free"},{"title":"Seats","href":"/cloud/billing/seats"},{"title":"Analysis Minutes Usage","href":"/cloud/billing/analysis-minutes"},{"title":"Managing Your Plan and Billing","href":"/cloud/billing/managing"},{"title":"Payment Methods","href":"/cloud/billing/payments"},{"title":"Open Source Projects","href":"/cloud/billing/open-source"},{"title":"Education and Non-Profits","href":"/cloud/billing/edu-non-profit"}]},{"group":"Troubleshooting","pages":[{"title":"Troubleshooting","href":"/cloud/troubleshooting"},{"title":"Analysis is paused","href":"/cloud/troubleshooting-analysis-paused"},{"title":"Coverage not received for default branch","href":"/cloud/troubleshooting-default-branch-coverage"},{"title":"Troubleshooting Build Timeouts","href":"/cloud/troubleshooting-build-timeouts"}]},{"group":"Additional Information","pages":[{"title":"Frequently Asked Questions (FAQ)","href":"/cloud/faq"},{"title":"Support","href":"/cloud/support"},{"title":"Qlty for Infrastructure","sidebarTitle":"Qlty for Infrastructure Projects","href":"/cloud/qlty-for-infrastructure"},{"title":"System Limits","href":"/cloud/limits"},{"title":"GitHub App","href":"/cloud/github-app"},{"title":"Build Secrets","href":"/cloud/build-secrets"},{"title":"Build Repository Access","href":"/cloud/build-repository-access"},{"title":"User Permissions","href":"/cloud/permissions"},{"title":"AI Data Usage","href":"/cloud/data-usage"},{"title":"Security","href":"/cloud/security"}]}]},{"tab":"Code Coverage","icon":"shield","pages":[{"title":"Code Coverage","href":"/coverage"}]},{"tab":"API Reference","icon":"code","pages":[{"title":"API Reference","href":"/api/introduction"}]},{"tab":"Changelog","icon":"clock","pages":[{"title":"Changelog","href":"/changelog"}]}]},"title":"Maintainability Metrics and Ratings - Qlty Docs","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":[],"chunks":[]}