CQM-ForbiddenLoveRoutine¶
ForbiddenLoveRoutine
Required inputs: IR
This metric counts the number of cycles at routine level.
Motivation
A clever »divide et impera« strategy creates modular units, each of which can be understood, tested and maintained separately. This applies at the file, class and also routine level. Dependencies between parts should be reflected in the structure of layers, i.e., there are pure service providers (e.g. I/O functionality), which are used by the next-higher layer, which offers even more high-level functionality again for their part. At the routine level, this layered architecture is expressed, among other things, by the visibilities used (private routines are basic service providers that serve the higher-level services for their realization).
If there are direct use dependencies between two routines, it is required to always consider them both at the same time, i.e., the contents of one routine depend on the contents of the other routine and vice versa. This has the consequence that both routines can be processed in each case only monolithic together.
Note: The original definition of this rule focuses on direct cyclic dependencies between routines pairs, our implementation however also considers indirect dependencies and cycles consisting of more than 2 routines.
This rule is based on the CQM Quality Indicator: verbotene Methodenliebe (p. 318-320).
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¶
This rule shares the following common options: severity
This rule shares the following common metric options: report_all_values
The following places define options that affect this rule: Analysis-GlobalOptions
display_name¶
display_name : str | None = 'The number of cycles at routine level'
max_value¶
max_value : int | None = 8
min_value¶
min_value : int | None = 0
rfg_metric_name¶
rfg_metric_name : str = 'Metric.ForbiddenLove.Routine'