Repository Metrics

Code quality isn't solely determined by the issues that are directly present in your source code. Many hidden statistics and figures can impact your code's performance and accessibility to other developers.

DeepSource analysis not only identifies code-specific issues in your codebase but also calculates essential metrics that determine various aspects of your code's quality. These key metrics are displayed in the Metrics tab, providing you with valuable insights into your code's overall health.

Available metrics

CodeNameDescription
DDPExternal DependenciesTotal number of 3rd-party dependencies used in this repository
DCVDocumentation CoverageTrack the extent to which your application code is documented
LCVLine CoverageLine coverage of the default branch of the repository
BCVBranch CoverageBranch coverage of the default branch of the repository
CCVCondition CoveragePercentage of logical conditions covered in the default branch of the repository
CPCVComposite CoverageWeighted average of the coverage of lines, conditions, and branches executed by the tests
NLCVNew Line CoveragePercentage of lines in the source code covered by tests in the changeset
NBCVNew Branch CoveragePercentage of branches in the source code covered by tests in the changeset
NCCVNew Condition CoveragePercentage of logical conditions in the source code covered by tests in the changeset
NCPCVNew Composite CoverageWeighted average of line, condition and branch coverage executed by tests in the changeset

Metric charts

Metrics are displayed on a chart as a trend line over time, indicating if they are above or below a threshold. Each metric is reported per analyzer, and some metrics are also aggregated across analyzers using logic explained in the documentation.

By selecting a metric, you can view its plot of value variations and adjust the duration of the displayed stats to 30, 60, or 90 days. You can also modify the allowed threshold value or remove it entirely by clicking on the options icon next to the current threshold value.

📘

In the "Metrics" tab, a trend is shown only for first-level metrics and not for the changeset-only metrics

Metric aggregate calculation

If a metric is measured for multiple languages, an aggregate value is calculated. The aggregate value is determined by one of three logic types for each metric:

TypeUsed byDescription
SumDDPCalculated as a summation of the metric's values captured for all languages reported in an Analysis run
AverageDCVCalculated as an arithmetic mean of the metric's values captured for all languages reported in an Analysis run
Weighted AverageLCV, BCV, CCV, CPCV, NLCV, NBCV, NCCV, NCPCVCalculated as a weighted arithmetic mean of the metric's values captured for all languages reported in an Analysis run but taking into account each language's weight fraction in the repository

Condition coverage

Condition coverage refers to the proportion of logical conditions in the source code that are covered by tests, expressed as a percentage.

Composite coverage

Composite coverage is a metric that calculates the weighted average of the coverage of executed lines, conditions, and branches by the tests in the source code.

Branch coverage

Branch coverage is a measure of code coverage in a repository that includes the branches present in the code.

Line coverage

Line coverage is a measure of code coverage in a repository that excludes the branches in the code.

Documentation coverage

Documentation coverage measures the degree to which your application code is documented, allowing you to track and improve the comprehensiveness of your code documentation.

External dependencies

The External Dependencies metric denotes the overall count of third-party dependencies employed in the repository.


What’s Next