CQM-GodFile

Lines of Code in a File (Empty, Comment, Code)

Required inputs: RFG

Any file containing more than 2000 gross lines of source code is a violation of this metric.

Motivation

Candidates for god files are, on the one hand, files that contain artifacts that have already been identified by other »god indicators«, e.g. GodRoutine, GodClass. In addition, files that are very large for other reasons, for example files with multiple (non-public) classes or file with multiple routines whose length is just short of the threshold for god routines, are also captured by GodFile. Such files often have to many artefacts (which however, are not recognised by other god rules), which therefore can only be changed, viewed and modified separately with excessive effort.

This rule is based on the CQM Quality Indicator: Gottdatei (p. 192-194).

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

alias_name

alias_name : str = 'Metric.GodFile'

Name under which the metric will be reported. In the RFG, a metric with this value is created, too (copied from original metric).
 

display_name

display_name : str | None = 'Lines of Code in a File (Empty, Comment, Code)'

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

max_value

max_value : int | None = 2000

Maximum allowed value. None if unlimited.
 

min_value

min_value : int | None = 0

Minimum allowed value. None if unlimited.
 

rfg_metric_name

rfg_metric_name : str = 'Metric.Lines.File.LOC'

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