Package jetbrains.buildServer.duplicator
Class DuplicateInfo
- java.lang.Object
-
- jetbrains.buildServer.duplicator.DuplicateInfo
-
public class DuplicateInfo extends Object
Concrete duplicate. Encapsulates duplicate metrics such as duplicate hash, duplicate cost (duplicate code complexity which is defined by the amount of statements, expressions, declarations and method calls) and duplicating code fragments- Since:
- 6.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDuplicateInfo.CharOffsetOffsets calculated as absolute char offset within a file.static classDuplicateInfo.DuplicateMetricsDuplicates metrics which encapsulate hash, cost and densitystatic classDuplicateInfo.FragmentDuplicating code fragment.static classDuplicateInfo.FragmentOffsetstatic classDuplicateInfo.LineOffsetOffsets calculated as line offset within a file.static classDuplicateInfo.MetricsWithFilesMetrics with files storage.static classDuplicateInfo.NormalizedLineEndOffsetFragment offset calculated for a file with normalized line ends (all line endings are \n).
-
Constructor Summary
Constructors Constructor Description DuplicateInfo(int hash, int cost, DuplicateInfo.Fragment[] fragments)Creates a duplicate with specified hash, cost and fragments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetCost()Gets the current duplicates costintgetDensity()Gets the current duplicates densityDuplicateInfo.Fragment[]getFragments()Gets the current duplicates code fragmentsintgetHash()Gets the current duplicates hashDuplicateInfo.DuplicateMetricsgetMetrics()Gets the current duplicates metrics which are hash, cost and densityinthashCode()StringtoString()
-
-
-
Constructor Detail
-
DuplicateInfo
public DuplicateInfo(int hash, int cost, DuplicateInfo.Fragment[] fragments)Creates a duplicate with specified hash, cost and fragments. Hash is used for quick statistics calculation. Cost defines the complexity of the source code which is actually the amount of statements, expressions, declarations and method calls. Summarized costs of all these elements of the source code fragment yield the total complexity.- Parameters:
hash- duplicate hashcost- defines the complexity of the source codefragments- specific fragment
-
-
Method Detail
-
getMetrics
public DuplicateInfo.DuplicateMetrics getMetrics()
Gets the current duplicates metrics which are hash, cost and density- Returns:
- duplicate metrics
-
getFragments
public DuplicateInfo.Fragment[] getFragments()
Gets the current duplicates code fragments- Returns:
- code fragments
-
getHash
public int getHash()
Gets the current duplicates hash- Returns:
- hash
-
getCost
public int getCost()
Gets the current duplicates cost- Returns:
- cost
-
getDensity
public int getDensity()
Gets the current duplicates density- Returns:
- density
-
-