|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.phoenix.report.Severity
public final class Severity
Enumerated type of a severity.
The severity of a finding shall reflect the urgency of a fix needed. Higher severity levels require more urgent actions where lower levels might denote findings that are for information only.
This class also defines the weight of a finding
(getPenalty() and thus
how much the quality is affected by the finding of
this severity.
Instances of this class are immutable.
The following severities are defined:
| Field Summary | |
|---|---|
static Severity |
CODE_STYLE
Severity for code-style type of findings. |
static Severity |
COVERAGE
Severity for code that is not covered by test cases. |
static Severity |
CPD
Detected copied & pasted code. |
static Severity |
DESIGN
This severity level is for design related findings. |
static Severity |
ERROR
Severe findings requiring immediate action. |
static Severity |
FILTERED
Severity for filtered findings. |
static Severity |
INFO
Severity for informational finders like to-do markers or code that uses outdated API which should be updated but has no side effect. |
static Severity |
MAX_SEVERITY
The maximum possible severity. |
static int |
MAX_SEVERITY_INT
The maximum possible severity as int. |
static Severity |
OK
Severity level used to denote no finding. |
static int |
PENALTY_SCALE
Scale of the penalty points. |
static List |
VALUES
Immutable list of the severities. |
static Severity |
WARNING
Warning level severities. |
| Method Summary | |
|---|---|
int |
compareTo(Object o)
|
boolean |
equals(Object o)
|
static Severity |
fromFindBugsPriority(String priority)
Parses the findbugs severity representation. |
static Severity |
fromInt(int i)
Creates a Severity object from its int representation. |
static Severity |
fromString(String str)
Creates a Severity object from its String representation. |
int |
getPenalty()
Returns the penalty assigned to findings of this severity. |
int |
hashCode()
|
Severity |
max(Severity other)
Returns the maximum severe code of this and the given severity. |
String |
toFindBugsPriority()
Converts the jCoderZ priority in the FindBugs XML representation. |
int |
toInt()
Returns the int representation of this severity. |
String |
toString()
Returns the String representation of this severity. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PENALTY_SCALE
1 / PENALTY_SCALE lines as bad.
public static final Severity FILTERED
Findings that are not appropriate for whatever reason (ex. being a false positive) should get this level assigned by the filtering style sheet.
A finding of this severity marks no lines of code as bad.
public static final Severity OK
public static final Severity INFO
A finding of this severity marks no lines of code as bad.
public static final Severity CODE_STYLE
All finders that report indentation, position of braces or this kind of violation should use this level. There is no deeper differentiation for this type of findings.
A finding of this severity marks 0.5 lines of code as bad.
public static final Severity COVERAGE
If code coverage is enabled each line with a coverage of 0 gets marked with this violation.
A finding of this severity marks 0.8 lines of code as bad.
public static final Severity DESIGN
Inheritance problems or broken implementation of standard methods
should get this severity level, unless ERROR or
WARNING fits better.
A finding of this severity marks three lines of code as bad.
public static final Severity WARNING
A finding of this severity marks 5 lines of code as bad.
public static final Severity CPD
The copy and paste detector detected a number of similar lines at a different position. This should be refactored immediately.
A finding of this severity marks 10 lines of code as bad.
public static final Severity ERROR
Findings of this severity are serious errors. Finders that detect style or design violations or finders that produce a certain number of false positives must not use this severity.
Findings of this severity should prevent a project from being released. A severity of this level marks 10 lines as bad.
public static final Severity MAX_SEVERITY
ERROR.
public static final int MAX_SEVERITY_INT
public static final List VALUES
| Method Detail |
|---|
public static Severity fromInt(int i)
throws IllegalArgumentException
i - the int representation of the severity to be returned.
IllegalArgumentException - If the assigned int value isn't
listed in the internal severity table
public static Severity fromString(String str)
throws IllegalArgumentException
str - the string representation of the severity to be
returned.
IllegalArgumentException - If the given string value isn't
listed in the internal severity tablepublic int toInt()
public String toString()
toString in class Objectpublic int getPenalty()
public int compareTo(Object o)
compareTo in interface Comparablepublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic static Severity fromFindBugsPriority(String priority)
priority - the string read from the xml
public String toFindBugsPriority()
public Severity max(Severity other)
other - the severity to compare with.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||