Module CodeDuplication

Provides classes for detecting duplicate or similar code.

Import path

external.CodeDuplication

Imports

Files

Provides classes for working with files and folders.

Predicates

duplicateContainers

Holds if sc and other are functions or toplevels where percent is the percentage of lines they have in common, which is greater than 90%.

duplicateFiles
duplicateLines
duplicateStatement

Holds if stmt1 and stmt2 are duplicate statements in function or toplevel sc1 and sc2, respectively, where sc1 and sc2 are not the same.

duplicate_extension

Holds if there is a sequence of DuplicateBlocks start1, ..., end1 and another sequence start2, ..., end2 such that each block extends the previous one and corresponding blocks have the same equivalence class, with start being the equivalence class of start1 and start2, and end the equivalence class of end1 and end2.

similarContainers

Holds if sc and other are functions or toplevels where percent is the percentage of similar lines between the two, which is greater than 90%.

similarFiles
similarLines
similar_extension

Holds if there is a sequence of SimilarBlocks start1, ..., end1 and another sequence start2, ..., end2 such that each block extends the previous one and corresponding blocks have the same equivalence class, with start being the equivalence class of start1 and start2, and end the equivalence class of end1 and end2.

Classes

Copy

A token block used for detection of duplicate and similar code.

DuplicateBlock

A block of duplicated code.

SimilarBlock

A block of similar code.