Enum DebtRemediationFunction.Type

    • Enum Constant Detail

      • LINEAR

        public static final DebtRemediationFunction.Type LINEAR
        The cost to fix an issue of this type depends on the magnitude of the issue. For instance, an issue related to file size might be linear, with the total cost-to-fix incrementing (by the gap multiplier amount) for each line of code above the allowed threshold. The rule must provide the "gap" value when raising an issue.
      • LINEAR_OFFSET

        public static final DebtRemediationFunction.Type LINEAR_OFFSET
        It takes a certain amount of time to deal with an issue of this type (this is the gap multiplier). Then, the magnitude of the issue comes in to play. For instance, an issue related to complexity might be linear with offset. So the total cost to fix is the time to make the basic analysis (the base effort) plus the time required to deal with each complexity point above the allowed value.

        Total remediation cost = base effort + (number of noncompliance x gap multiplier)

        The rule must provide the "gap" value when raising an issue. Let's take as a example the "Paragraphs should not be too complex" rule. If you set the rule threshold to 20, and you have a paragraph with a complexity of 27, you have 7 points of complexity to remove. Internally, this is called the Gap. In that case, if you use the LINEAR_OFFSET configuration with an base effort of 4h and a remediation cost of 1mn, the effort for this issue related to a too-complex block of code will be: (7 complexity points x 1min) + 4h = 4h and 7mn

      • CONSTANT_ISSUE

        public static final DebtRemediationFunction.Type CONSTANT_ISSUE
        The cost to fix all the issues of the rule is the same whatever the number of issues of this rule in the file. Total remediation cost by file = constant
    • Method Detail

      • values

        public static DebtRemediationFunction.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DebtRemediationFunction.Type c : DebtRemediationFunction.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DebtRemediationFunction.Type valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • usesCoefficient

        @Deprecated
        public boolean usesCoefficient()
        Deprecated.
        since 5.5, replaced by usesGapMultiplier()
      • usesGapMultiplier

        public boolean usesGapMultiplier()
        Since:
        5.5
      • usesOffset

        @Deprecated
        public boolean usesOffset()
        Deprecated.
        since 5.5, replaced by usesBaseEffort()
      • usesBaseEffort

        public boolean usesBaseEffort()
        Since:
        5.5