CQM-DuplicateCode¶
Number of cloned lines of code
Counts the number of cloned lines found by the rule: C++CloneDetection.
Motivation
Identical or similar functionality often has to be used in multiple locations. However, instead of extracting the functionality and making it usable, it is duplicated using copy and paste. This way clones can be created that include function parts, whole and multiple functions, complete classes or even complete files. The multiple occurrence of identical code fragments means repeated efforts in understanding, maintaining and testing. In particular, changes have to be made consistently several times, which in turn is very error-prone.
This rule is based on the CQM Quality Indicator: duplizierter Code (p. 183-185).
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: exclude_messages_in_system_headers, excludes, includes, justification_checker, post_processing, provider, severity
This rule shares the following common metric options: report_all_values
The following places define options that affect this rule: Analysis-GlobalOptions
clone_detection_rulename¶
clone_detection_rulename : str = 'C++CloneDetection'
display_name¶
display_name : str = 'Number of cloned lines of code'
max_value¶
max_value : float | None = 15969.0
min_value¶
min_value : float | None = 0.0
rfg_metric_name¶
rfg_metric_name : str = 'Metric.Clone.LOC'