Complexity

Complexity is the number of paths through the code, typically observed at the level of individual methods or functions. The more complex the code is, it is more difficult to understand the code's control flow, to test it and it is less predictable. This characteristic is used to equalize and distribute disproportionate complexity among components or eliminate it, if possible.

Duplications

Duplications indicate the presence of copy-paste code, which enlarges code size, typically indicates flaws in software design and makes it more difficult to maintain or adapt. Duplicated blocks are repeated sequences of lines with the same of successive statements regardless of the differences in the indentation and literals. Each repetition detected increases the numbers of duplicated blocks, files, lines and percentage of lines involved in duplications.

Issues

The code may contain a number of typical issues that are recognized on the base of rules and code patterns. They are classified in type as bugs, code smells and vulnerabilities and in severity as blockers, critical, major, minor, info. After they are analyzed by developers or reviewers, they may be classified into false positives, confirmed, or open issues and potentially reopened. Resolved issues are closed on the subsequent scan.

Maintainability

Maintainability is based on the number of code smells, i.e. suspicious places in the code that indicate possible weakness in design or readability, technical debt, i.e. the effort to fix all code smells, estimated in minutes or workdays, or technical debt ratio, which is the ratio between the cost to develop the software and the cost to fix it, based on the time cost of the issues and the estimate of the time to write the given number of lines of code. It can be also measured as the number of bug issues, with reliability rating, which is determined from the presence of bugs of various severities, or estimated effort to fix all bug issues.

Reliability

The primary indication of reliability is the number of bug issues. The difficulty of individual issues, their number, statuses, types, and severities are used to determine reliability rating and reliability remediation effort.

Security

This characteristic of the code is based on the vulnerability issues, i.e. suspicious places in the code that indicate possible security weaknesses, security remediation effort, i.e. the effort to fix all vulnerabilities, estimated in minutes or workdays, and security rating, which is determined from the presence of vulnerabilities of various severities.


Size

These metrics describe the size of the code and how it is commented. They include the number of classes, number of comment lines, i.e. lines containing either comments or commented-out code, the density of comment, number of files, number of lines, number of lines with code, number of methods and functions, or number of statements.

Tests

These metrics associated with unit tests include coverage-related measures such as condition coverage, i.e. whether the expressions were evaluated both to true and false for lines of code with Boolean expressions, expressed by line, by condition, by uncovered conditions, line coverage, i.e. portion of executable lines covered during the execution of the unit tests, number of lines of code which are not covered by unit tests. Characteristics directly related to unit test include the number of unit tests, skipped unit tests, the time required to execute all the unit tests, number of unit tests that have failed, number of unit tests that have failed with an unexpected exception, and percentage of unit tests passed without errors or failures.