Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Infoiframe
iconframeborderfalse0
titleheightTable of Contents10

Table of Contents

Complexity

...

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

More details

...

Design

...

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 to be able to identify all undesired dependencies.

...

file_edges_weight

...

Number of file dependencies inside a package.

...

File dependencies to cut

...

package_tangles

...

Number of file dependencies to cut in order to remove all cycles between packages.

...

file_tangles

...

File tangle = Suspect file dependencies

...

file_tangle_index

...

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

 

...

LCOM4

...

lcom4

...

Lack of cohesion of methods. See LCOM4 documentation page.

...

Number of children

...

noc

...

The number of children of a class is the number of direct and indirect descendants of this class.

...

Package cycles

...

package_cycles

...

Minimal number of package cycles detected to be able to identify all undesired dependencies.

...

Package dependencies to cut

...

package_feedback_edges

...

Number of package dependencies to cut in order to remove all cycles between packages.

...

Package tangle index

...

package_tangle_index

...

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

...

Response for class

...

rfc

...

See RFC documentation page.

...

Package edges weight

...

package_edges_weight

...

Number of file dependencies between packages.

...

file_feedback_edges

...

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

...

Documentation

...

Number of lines containing a comment.

More details

...

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

...

Duplications

...

Duplicated blocks

...

duplicated_blocks

...

Number of duplicated blocks of lines.

...

Density of duplication = Duplicated lines / Lines * 100

Reviews

NameKeyDescription

Active reviews

active_reviews

Number of active reviews (status not closed).

False-positive reviewsfalse_positive_reviewsNumber fo false-positive reviews.
New unreviewed violationsnew_unreviewed_violationsNumber of new unreviewed violations.
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

...

New violations

...

new_violations

...

Number of new violations.

...

New xxxxx violations

...

new_xxxxx_violations

...

Number of new violations with severity xxxxx, xxxxx being Blocker, Critical, Major, Minor or Info.

...

Violations

...

violations

...

Number of violations.

...

xxxxx violations

...

xxxxx_violations

...

Number of violations with severity xxxxx, xxxxx being Blocker, Critical, Major, Minor or Info.

...

weighted_violations

...

Sum of the violations 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 and set the Rules weight property.

...

Rules compliance

...

violations_density

...

Rules compliance index (RCI) = 100 - (Weighted violations / 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.

Size

...

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

More details

...

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

...

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

...

Number of methods/functions.

More details

...

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

 More details

...

Number of statements.

More details

Tests

...

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

...

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)

...

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)

...

The same kinds of metrics exist for Integration tests coverage and Overall tests coverage (Units tests + Integration tests).

...

srchttp://redirect.sonarsource.com/doc/metric-definitions.html

Documentation has been moved to http://redirect.sonarsource.com/doc/metric-definitions.html.

Documentation has been moved to http://redirect.sonarsource.com/doc/metric-definitions.html.