Class 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 <plugin>/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 preceded by a + or -. For core bug detectors, the bug ranker search order is:
    • global adjustment 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
    See Also:
    BugRankCategory, Priorities, Confidence
    • Field Detail

      • VISIBLE_RANK_MAX

        public static final int VISIBLE_RANK_MAX
        Maximum value for user visible ranks (least relevant)
        See Also:
        Constant Field Values
      • VISIBLE_RANK_MIN

        public static final int VISIBLE_RANK_MIN
        Minimum value for user visible ranks (most relevant)
        See Also:
        Constant Field Values
    • Method Detail

      • findRank

        public static int findRank​(BugInstance bug)
      • findRank

        public static int findRank​(BugPattern bugPattern,
                                   int priority)
      • trimToMaxRank

        public static void trimToMaxRank​(BugCollection origCollection,
                                         int maxRank)