_clone Clone Report

Top  Previous  Next

Targets: All

 

The Clone Report tries to identify similar sections of code (code clones).

 

Please note that this report takes relatively long time to generate. But you should not need to run it very often.

 

 

 

Similar subprograms internally in module (CLON1)

This section lists subprograms within the same module, with similar code. Only subprograms with at least five lines of code are considered.

The setting for minimum decision points is applied. Also subprograms that are overloaded, or contain any assembler code will not be examined.

 

There is also a setting, "Min DP" or minimum decision points. A subprogram must have at least this minimum value to be examined. The default value is 1, meaning that all subprograms will be considered, unless they are empty.

 

A percentage is calculated to indicate the similarity between the two compared subprograms. A value of 0% meaning a perfect match.

 

When the report format is text or HTML, the display shows for each compared pair of functions, a top line with the percent value and the names of the two subprograms and their line numbers.

 

Example:

 

clip0216

 

Code snippets are displayed for the two similar sections. Double-click on the first line (first or second subprogram name) to jump to the relevant code section in the source (or in the Delphi IDE depending to your settings).

 

 

 

Similar subprograms over all modules (CLON2)

This section lists subprograms over all modules, with similar code. Only subprograms with at least five lines of code are considered.

The setting for minimum decision points is applied. Also subprograms that are overloaded will not be examined.

 

A percentage is calculated to indicate the similarity between the two compared subprograms. A value of 0% meaning a perfect match.

 

When the report format is text or HTML, the display shows for each compared pair of functions, a top line with the percent value and the names of the two subprograms and their line numbers.

 

Example:

 

clip0217

 

Code snippets are displayed for the two similar sections. Double-click on the first line (first or second subprogram name) to jump to the relevant code section in the source (or in the Delphi IDE depending to your settings).

 

Here is an example of a not perfect match, but where the code snippets are similar:

 

clip0219

 

 

See also:

 

R_REF Reference Reports