edu.umd.cs.findbugs
Class BugRanker
java.lang.Object
edu.umd.cs.findbugs.BugRanker
public class BugRanker
- extends java.lang.Object
Bug rankers are used to compute a bug rank for each bug instance. Bug ranks 1-20 are for bugs that are visible to users.
Bug rank 1 is more the most relevant/scary bugs. A bug rank greater than 20 is for issues that should not be shown to users.
The following bug rankers may exist:
- core bug ranker (loaded from etc/bugrank.txt)
- a bug ranker for each plugin (loaded from /etc/bugrank.txt)
- A global adjustment ranker (loaded from plugins/adjustBugrank.txt)
A bug ranker is comprised of a list of bug patterns, bug kinds and bug categories. For each, either an absolute
or relative bug rank is provided. A relative rank is one preceeded by a + or -.
For core bug detectors, the bug ranker search order is:
- global bug ranker
- core bug ranker
For third party plugins, the bug ranker search order is:
- global adjustment bug ranker
- plugin adjustment bug ranker
- core bug ranker
The overall search order is
- Bug patterns, in search order across bug rankers
- Bug kinds, in search order across bug rankers
- Bug categories, in search order across bug rankers
Search stops at the first absolute bug rank found, and the result is the sum of all of relative bug ranks plus
the final absolute bug rank. Since all bug categories are defined by the core bug ranker, we should always find
an absolute bug rank.
- Author:
- Bill Pugh
Constructor Summary |
BugRanker(java.net.URL u)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FILENAME
public static final java.lang.String FILENAME
- See Also:
- Constant Field Values
ADJUST_FILENAME
public static final java.lang.String ADJUST_FILENAME
- See Also:
- Constant Field Values
BugRanker
public BugRanker(@CheckForNull
java.net.URL u)
throws java.io.IOException
- Parameters:
u
- may be null. In this case, a default value will be used for all bugs
- Throws:
java.io.IOException
rankBug
public static int rankBug(BugInstance bug,
BugRanker... rankers)
findRank
public static int findRank(BugInstance bug)
findRank
public static int findRank(BugPattern pattern,
Plugin plugin,
int priority)
findRank
public static int findRank(BugPattern pattern,
int priority)
trimToMaxRank
public static void trimToMaxRank(BugCollection origCollection,
int maxRank)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.