CQM-SloppyCommenting

Ratio between all lines of code and lines containing comments

Required inputs: RFG

Determines the ratio between the total lines of code (BLOC) and comment lines (CLOC) according to the formula (abs(BLOC - 2 * CLOC) / BLOC) * 1000.
This is a violation, if the ratio is less than 1.45 or greater than 370.26.

Motivation

This problem pattern addresses the system-wide level of commenting as a necessary criteria of the documentation supporting the maintenance process. If this value is significantly higher than what is stored in the QBL repository, then there are considerably fewer comments than is usual system-wide. Regardless of the content of the few comments, it can therefore be assumed that the documentation is insufficient and that any work on the code means significant additional work and may be prone to errors.

This rule is based on the CQM Quality Indicator: nachlässige Kommentierung (p. 246-248).

Reference

Simon, Frank/ Seng, Olaf/ Mohaupt, Thomas (2006): Code-Quality-Management: Technische Qualität industrieller Softwaresysteme transparent und vergleichbar gemacht, 1st ed., Heidelberg, Germany: dpunkt.verlag GmbH.

Possible Messages

This rule has no predefined messages.

Options

display_name

display_name : str | None = 'Ratio between all lines of code and lines containing comments'

Description of the metric shown in the dashboard. If None, rfg_metric_name is used.
 

max_value

max_value : float | None = 370.26

Maximum allowed value. None if unlimited.
 

min_value

min_value : float | None = 1.45

Minimum allowed value. None if unlimited.
 

rfg_metric_name

rfg_metric_name : str = 'Metric.SloppyCommenting'

Name of the node attribute storing the metric value in the RFG.