|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.analysis.util.model.AbstractAnnotation
hudson.plugins.dry.parser.DuplicateCode
public class DuplicateCode
A serializable Java Bean class representing a duplicate code warning.
Note: this class has a natural ordering that is inconsistent with equals.
| Field Summary | |
|---|---|
static String |
ORIGIN
Origin of the annotation. |
| Fields inherited from class hudson.plugins.analysis.util.model.AbstractAnnotation |
|---|
WORKSPACE_FILES |
| Constructor Summary | |
|---|---|
DuplicateCode(hudson.plugins.analysis.util.model.Priority priority,
int firstLine,
int numberOfLines,
String fileName)
Creates a new instance of DuplicateCode. |
|
DuplicateCode(hudson.plugins.analysis.util.model.Priority priority,
int firstLine,
int numberOfLines,
String fileName,
boolean isDerived)
Creates a new instance of DuplicateCode. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
String |
getFormattedSourceCode()
Returns the duplicate source code fragment as formatted HTML string. |
hudson.plugins.analysis.util.model.FileAnnotation |
getLink(long linkHashCode)
Returns the link with the specified hash code. |
Collection<DuplicateCode> |
getLinks()
Returns the links to the duplicated code in other files. |
String |
getMessage()
|
int |
getNumberOfLines()
Returns the total number of duplicate lines. |
String |
getSourceCode()
Returns the duplicate source code fragment. |
String |
getToolTip()
|
String |
getType()
|
int |
hashCode()
|
boolean |
isDerived()
Returns whether this duplication as derived. |
int |
length()
Returns the total number of duplicate lines. |
void |
linkTo(List<DuplicateCode> codeBlocks)
Creates links to the specified collection of other code blocks. |
void |
setSourceCode(String sourceCode)
Sets the duplicate source code fragment to the specified value. |
int |
size()
Returns the total number of duplicate lines. |
| Methods inherited from class hudson.plugins.analysis.util.model.AbstractAnnotation |
|---|
addLineRange, canDisplayFile, compareTo, getCategory, getContextHashCode, getFileName, getKey, getLineRanges, getLinkLineNumber, getLinkName, getModuleName, getOrigin, getPackageName, getPathName, getPrimaryLineNumber, getPriority, getShortFileName, getTempName, hasPackageName, intern, intern, setColumnPosition, setContextHashCode, setFileName, setModuleName, setOrigin, setPackageName, setPathName, setPriority, superReadResolve, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ORIGIN
| Constructor Detail |
|---|
public DuplicateCode(hudson.plugins.analysis.util.model.Priority priority,
int firstLine,
int numberOfLines,
String fileName)
DuplicateCode.
priority - the priority of the warningfirstLine - the starting line of the duplicationnumberOfLines - total number of duplicate linesfileName - name of the file that contains the duplication
public DuplicateCode(hudson.plugins.analysis.util.model.Priority priority,
int firstLine,
int numberOfLines,
String fileName,
boolean isDerived)
DuplicateCode.
priority - the priority of the warningfirstLine - the starting line of the duplicationnumberOfLines - total number of duplicate linesfileName - name of the file that contains the duplicationisDerived - determines if this duplication is derived. Derived
duplications will not be shown in the user interface| Method Detail |
|---|
public boolean isDerived()
true if this duplication as derived, false if it is
the master duplicationpublic String getType()
getType in interface hudson.plugins.analysis.util.model.FileAnnotationgetType in class hudson.plugins.analysis.util.model.AbstractAnnotationpublic String getMessage()
getMessage in interface hudson.plugins.analysis.util.model.FileAnnotationgetMessage in class hudson.plugins.analysis.util.model.AbstractAnnotationpublic int getNumberOfLines()
public int size()
public int length()
public String getToolTip()
public void linkTo(List<DuplicateCode> codeBlocks)
codeBlocks - the code blocks to links topublic Collection<DuplicateCode> getLinks()
public String getSourceCode()
public String getFormattedSourceCode()
public void setSourceCode(String sourceCode)
sourceCode - the duplicate code fragmentpublic int hashCode()
hashCode in class hudson.plugins.analysis.util.model.AbstractAnnotationpublic boolean equals(Object obj)
equals in class hudson.plugins.analysis.util.model.AbstractAnnotationpublic hudson.plugins.analysis.util.model.FileAnnotation getLink(long linkHashCode)
linkHashCode - the hash code of the linked annotation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||