Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
iconfalse
titleTable of Contents

Table of Contents
maxLevel1

Complexity

NameKeyDescription
Anchor
metricComplexity
metricComplexity
Complexity
complexity

It is the cyclomatic complexity, also known as McCabe metric. Whenever the control flow of a method function splits, the complexity counter gets incremented by one.
Each method function has a minimum value complexity of 1 per default.

More details

Complexity /classclass_complexityAverage complexity by class.
Complexity /filefile_complexityAverage complexity by file.
Complexity /methodfunction_complexityAverage complexity by method function.

Design

Density of files having a LCOM4 density greater than 1
NameKeyDescription

Afferent couplings

ca

A class afferent couplings is a measure of how many other classes use the specific class.

Depth in Tree

dit

The depth of inheritance tree (DIT) metric provides for each class a measure of the inheritance levels from the object hierarchy top.

More details

Efferent couplings

ce

A class efferent couplings is a measure of how many different classes are used by the specific class.

File cycles

file_cycles

Minimal number of file cycles detected inside a package directory to be able to identify all undesired dependencies. This metric is available at directory level.

Anchor
metricFileEdgesWeight
metricFileEdgesWeight
File edges weight

file_edges_weight

Number of file dependencies inside a package.directory. This metric is available at directory level.

File dependencies to cut

package_tangles

Number of file dependencies to cut in order to remove all cycles between packages.directories. This metric is available at directory, module and project level.

 

Anchor
metricFileTangle
metricFileTangle
File tangle

file_tangles

File tangle = Suspect file dependencies

This metric is available at directory level.

Anchor
metricFileTangleIndex
metricFileTangleIndex
File tangle index

file_tangle_index

Number of children

noc

File tangle index = 2 * (File tangle / File edges weight) * 100.

 

LCOM4

lcom4

Lack of cohesion of methods. See LCOM4 documentation page.

The number of children of a class is the number of direct and indirect descendants of this classThis metric is available at directory level.

Package cycles

package_cycles

Minimal number of package directory cycles detected to be able to identify all undesired dependencies. This metric is available at directory, module and project level.

Package dependencies to cut

package_feedback_edges

Number of package directory dependencies to cut in order to remove all cycles between packages.directories. This metric is available at the package, module and program levels.

Package tangle index

package_tangle_index

Level of tangle of the packagesdirectory interdependency. Best value (0%) means that there is no cycle and worst value (100%) means that packages directories are really tangled. This metric is computed with the following formula: 2 * (File dependencies to cut / Number of file dependencies between packagesdirectories) * 100.

Response for class

rfc

See RFC documentation pageThis metric is available at directory, module and project level.

Package edges weight

package_edges_weight

Number of file dependencies between packages.directories. This metric is available at directory, module and project level.

Anchor
metricFileFeedbackEdges
metricFileFeedbackEdges
Suspect file dependencies

file_feedback_edges

File dependencies to cut in order to remove cycles between files inside a packagedirectory. Note that cycles between files inside a package directory does not always mean a bad quality architecture.

Suspect LCOM4 densitysuspect_lcom4_density

This metric is available at directory level.

Documentation

Comment lines
NameKeyDescription
Blank comments
Anchor
metricCommentLines
metricCommentLines
Comment lines
comment_blank_lines

Number of

non-

lines containing either comment or commented-out code.

Non-significant comment lines (empty comment

line

lines, comment

line

lines containing only special characters, etc.)

.
Anchor
metricCommentLinesmetricCommentLinescomment_lines

Number of lines containing a comment.do not increase the number of comment lines.

The following piece of code contains 9 comment lines:

Code Block
languagetext
/**                                    +0 => empty comment line
 *                                     +0 => empty comment line
 * This is my documentation            +1 => significant comment
 * although I don't                    +1 => significant comment
 * have much                           +1 => significant comment
 * to say                              +1 => significant comment
 *                                     +0 => empty comment line
 ***************************           +0 => non-significant comment
 *                                     +0 => empty comment line
 * blabla...                           +1 => significant comment
 */                                    +0 => empty comment line
 
/**                                    +0 => empty comment line
 * public String foo() {               +1 => commented-out code
 *   System.out.println(message);      +1 => commented-out code
 *   return message;                   +1 => commented-out code
 * }                                   +1 => commented-out code
 */                                    +0 => empty comment line

More details

Comments (%)comment_lines_density

Density of comment lines = Comment lines / (Lines of code + Comment lines) * 100

With such a formula:

  • 50% means that the number of lines of code equals the number of comment lines
  • 100% means that the file only contains comment lines
Comments in Procedure Divisions Comments in Procedure divisions (Cobol only)
Anchor
metricPublicDocumentedApiDensity
metricPublicDocumentedApiDensity
Public documented API (%)
public_documented_api_densityDensity of public documented API = (Public API - Public undocumented API) / Public API * 100
Anchor
publicUndocumentedApi
publicUndocumentedApi
Public undocumented API
public_undocumented_apiPublic API without comments header.

Duplications

NameKeyDescription

Duplicated blocks

duplicated_blocks

Number of duplicated blocks of lines.

For a block of code to be considered as duplicated:

  • Non-Java projects:
    • There should be at least 100 successive and duplicated tokens.
    • Those tokens should be spread at least on:
      • 30 lines of code for COBOL
      • 20 lines of code for ABAP
      • 10 lines of code for other languages

  • Java projects:
    • There should be at least 10 successive and duplicated statements whatever the number of tokens and lines.

Differences in indentation as well as in string literals are ignored while detecting duplications.


Duplicated filesduplicated_filesNumber of files involved in a duplication.
Anchor
metricDuplicatedLines
metricDuplicatedLines
Duplicated lines
duplicated_linesNumber of lines involved in a duplication.
Duplicated lines (%)duplicated_lines_density

Density of duplication = Duplicated lines / Lines * 100

...

Issues

New unreviewed violationsunreviewed_ unreviewed violations.
NameKeyDescription

Active reviews

active_reviews

Number of active reviews (status not closed).

False-positive reviewsfalse_positive_reviewsNumber fo false-positive reviews.

New issues

new_

violations

Number of new

Unassigned reviewsunassigned_reviewsNumber of unassigned reviews.
Unplanned reviewsunplanned_reviewsNumber of unplanned reviews (not associated with an action plan).
Unreviewed violationsunreviewed_violationsNumber of unreviewed violations.

Rules

NameKeyDescription

New violations

new_violations

Number of new violations.

New xxxxx violationsissues.

New xxxxx issues

new_xxxxx_violations

Number of new violations issues with severity xxxxx, xxxxx being Blockerblocker, Criticalcritical, Majormajor, Minor minor or Infoinfo.

ViolationsIssues

violations

Number of violationsissues.

xxxxx violationsissues

xxxxx_violations

Number of violations issues with severity xxxxx, xxxxx being Blockerblocker, Criticalcritical, Majormajor, Minor minor or Info.info.

False positive issuesfalse_positive_issuesNumber of false positive issues
Open issuesopen_issuesNumber of issues whose status is Open
Confirmed issuesconfirmed_issuesNumber of issues whose status is Confirmed
Reopened issuesreopened_issuesNumber of issues whose status is Reopened

Anchor
metricWeightedViolations
metricWeightedViolations
Weighted violationsissues

weighted_violations

Sum of the violations issues weighted by the coefficient associated to each severity (Sum(xxxxx_violations * xxxxx_weight)).
To set the weight of each severity, log in as an administrator, go to Settings > Configuration > General Settings > General > General and set the Rules weight property. The default value is:
( (Blocker_violatons * 10) + (Critical_violations * 5) + (Major_violations * 3) + Minor_violations )

Rules compliance

violations_density

Rules compliance index (RCI) = 100 - (Weighted violationsissues / Lines of code * 100)

SCM

NameKeyQualitativeDescription
Authors by lineauthors_by_linenoThe last committer on each line of code.

Note that this metric is made available by the SCM Activity plugin.

SQALE

MetricKeyDescription
Blocker Remediation Costblocker_remediation_costRemediation cost (in days) to fix all blocker violations.
Critical and over Remediation Costcritical_remediation_costRemediation cost (in days) to fix all critical and blocker violations.
Effort to grade X

sqale_effort_to_grade_X

(X = a or b or c or d)

Effort (in days) to reach grade X.
Major and over Remediation Costmajor_remediation_costRemediation cost (in days) to fix all major and critical and blocker violations.
Minor and over Remediation Costminor_remediation_costRemediation cost (in days) to fix all minor and major and critical and blocker violations.
SQALE Ratingsqale_ratingSQALE rating from A to E.
SQALE Remediation Costsqale_indexRemediation cost (in days) to fix all violations.

Note that these metrics are made available by the SQALE plugin.

If the value is negative, it is rounded to 0%. 

Technical debtsqale_indexEffort in days to fix all issues.

Severity

SeverityDescription
BlockerOperational/security risk: This issue might make the whole application unstable in production. Ex: calling garbage collector, not closing a socket, etc.
CriticalOperational/security risk: This issue might lead to an unexpected behavior in production without impacting the integrity of the whole application. Ex: NullPointerException, badly caught exceptions, lack of unit tests, etc.
MajorThis issue might have a substantial impact on productivity. Ex: too complex methods, package cycles, etc.
MinorThis issue might have a potential and minor impact on productivity. Ex: naming conventions, Finalizer does nothing but call superclass finalizer, etc.
InfoNot known or yet well defined security risk or impact on productivity.

Size

MetricKeyDescription
Anchor
metricAccessors
metricAccessors
Accessors
accessors

Number of getter and setter methods functions used to get (reading) or set (writing) a class property.

More details

Anchor
metricClasses
metricClasses
Classes
classesNumber of classes (including nested classes, interfaces, enums and annotations).
Anchor
metricDirectories
metricDirectories
Directories
directoriesNumber of directories.
Anchor
metricFiles
metricFiles
Files
filesNumber of files.
Generated Linesgenerated_lines

Number of lines generated by Cobol code generators like CA-Telon.

Generated lines of codegenerated_nclocNumber of lines of code generated by Cobol code generators like CA-Telon.
Inside Control Flow Statementscobol_inside_ctrlflow_statementsNumber of inside (intra program) control flow statements (GOBACK, STOP RUN, DISPLAY, CONTINUE, EXIT, RETURN, PERFORM paragraph1 THRU paragraph2).
Cobol only.
Anchor
metricLines
metricLines
Lines
linesNumber of physical lines (number of carriage returns).
Anchor
metricNcloc
metricNcloc
Lines of code
ncloc

Number of physical lines that contain at least one character which is neither a whitespace or a tabulation or part of a comment.

More details

LOCs in Data Divisionscobol_data_division_nclocNumber of lines of code in Data divisions. Generated lines of code are excluded.
Cobol only. 
LOCs in Procedure Divisionscobol_procedure_division_nclocNumber of lines of code in Procedure divisions. Generated lines of code are excluded.
Cobol only.
Anchor
metricFunctions
metricFunctions
Methods
functions

Number of methods/ functions. Depending on the language, a function is either a function or a method or a paragraph.

More details

Outside Control Flow Statementscobol_outside_ctrlflow_statementsNumber of outside (inter programs) control flow statements (CALL, EXEC CICS LINK, EXEC CICS XCTL, EXEC SQL, EXEC CICS RETURN).
Cobol only.
Anchor
metricPackagesmetricPackages
Packages
packagesNumber of packages.
Anchor
metricProjects
metricProjects
Projects
projectsNumber of projects in a view.
Anchor
metricPublicApi
metricPublicApi
Public API
public_api

Number of public Classes + number of public Methods Functions + number of public Properties

More More details

Anchor
metricStatements
metricStatements
Statements
statements

Number of statements.

More details

Tests

branches
MetricKeyDescription
Anchor
metricBranchCoverage
metricBranchCoverage
Branch coverage
branch_coverage

On each line of code containing some boolean expressions, the branch coverage simply answers the following question: 'Has each boolean expression been evaluated both to true and false?'. This is the density of possible branches in flow control structures that have been followed during unit tests execution.

Code Block
Branch coverage = (CT + CF) / (2*B)

where

CT = branches that have been evaluated to 'true' at least once
CF = branches that have been evaluated to 'false' at least once

B = total number of branches
Branch coverage on new codenew_branch_coverage

Identical to Branch coverage but restricted to new / updated source code.

To be computed this metric requires the SCM Activity plugin.

Branch coverage hitsbranch_coverage_hits_dataList of covered branches.
Condition coverage see Branch coverage
Conditions by lineconditions_by_lineNumber of conditions by line.
Covered conditions by linecovered_conditions_by_lineNumber of covered conditions by line.
Anchor
metricCoverage
metricCoverage
Coverage
coverage

It is a mix of Line coverage and Branch coverage. Its goal is to provide an even more accurate answer to the following question: ' How much of the source code has been covered by the unit tests?".

Code Block
Coverage = (CT + CF + LC)/(2*B + EL)

where

CT = branches that have been evaluated to 'true' at least once
CF = branches that have been evaluated to 'false' at least once
LC = covered lines = lines_to_cover - uncovered_lines

B = total number of branches
EL = total number of executable lines (lines_to_cover)
Coverage on new codenew_coverage

Identical to Coverage but restricted to new / updated source code.

To be computed this metric requires the SCM Activity plugin .

Anchor
metricLineCoverage
metricLineCoverage
Line coverage
line_coverage

On a given line of code, Line coverage simply answers the following question: ' Has this line of code been executed during the execution of the unit tests?'. It is the density of covered lines by unit tests:

Code Block
Line coverage = LC / EL

where

LC = covered lines (lines_to_cover - uncovered_lines)
EL = total number of executable lines (lines_to_cover)
Line coverage on new codenew_line_coverageIdentical to Line coverage but restricted to new / updated source code.
Line coverage hitscoverage_line_hits_dataList of covered lines.
Anchor
metricLinesToCover
metricLinesToCover
Lines to cover
lines_to_coverNumber of lines of code which could be covered by unit tests (for example, blank lines or full comments lines are not considered as lines to cover).
New branch coveragenew_branch_coverageIdentical to Branch coverage but restricted to new / updated source code.
New coveragenew_coverageIdentical to Coverage but restricted to new / updated source code.
New line coveragenew_line_coverageIdentical to Line coverage but restricted to new / updated source code.
New lines to covernew_lines_Lines to cover on new codenew_lines_to_coverIdentical to Lines to cover but restricted to new / updated source code.
New uncovered linesnew_uncovered_linesIdentical to Uncovered lines but restricted to new / updated source code.
Skipped unit testsskipped_testsNumber of skipped unit tests.
Anchor
metricUncoveredBranches
metricUncoveredBranches
Uncovered branches
uncovered_conditionsNumber of branches which are not covered by unit tests.
Uncovered branches on new codenew_uncovered_conditionsIdentical to Uncovered branches but restricted to new / updated source code.
Anchor
metricUncoveredLines
metricUncoveredLines
Uncovered lines
uncovered_linesNumber of lines of code which are not covered by unit tests.
Uncovered lines on new codenew_uncovered_linesIdentical to Uncovered lines but restricted to new / updated source code.
Anchor
metricUnitTests
metricUnitTests
Unit tests
testsNumber of unit tests.
Unit tests durationtest_execution_timeTime required to execute all the unit tests.
Anchor
metricUnitTestErrors
metricUnitTestErrors
Unit test errors
test_errorsNumber of unit tests that have failed.
Anchor
metricUnitTestFailures
metricUnitTestFailures
Unit test failures
test_failuresNumber of unit tests that have failed with an unexpected exception.
Unit test success density (%)test_success_densityTest success density = (Unit tests - (Unit test errors + Unit test failures)) / Unit tests * 100

...