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 class
DuplicateInfo.CharOffset
Offsets calculated as absolute char offset within a file.static class
DuplicateInfo.DuplicateMetrics
Duplicates metrics which encapsulate hash, cost and densitystatic class
DuplicateInfo.Fragment
Duplicating code fragment.static class
DuplicateInfo.FragmentOffset
static class
DuplicateInfo.LineOffset
Offsets calculated as line offset within a file.static class
DuplicateInfo.MetricsWithFiles
Metrics with files storage.static class
DuplicateInfo.NormalizedLineEndOffset
Fragment 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 boolean
equals(Object o)
int
getCost()
Gets the current duplicates costint
getDensity()
Gets the current duplicates densityDuplicateInfo.Fragment[]
getFragments()
Gets the current duplicates code fragmentsint
getHash()
Gets the current duplicates hashDuplicateInfo.DuplicateMetrics
getMetrics()
Gets the current duplicates metrics which are hash, cost and densityint
hashCode()
String
toString()
-
-
-
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
-
-