Computes a technical debt index inspired by the SQALE model used by SonarQube. The index is expressed in estimated remediation minutes and as a rating from A (excellent) to E (critical).
Usage
debt_index(
x,
cost_lint_error = 30,
cost_lint_warning = 10,
cost_lint_style = 2,
cost_style = 5,
cost_gp = 20,
coverage_target = 80,
cost_coverage_point = 5
)Arguments
- x
An
rsonar_resultobject returned bysonar_analyse().- cost_lint_error
Cost in minutes per lint issue of type
error. Default30.- cost_lint_warning
Cost in minutes per lint warning. Default
10.- cost_lint_style
Cost in minutes per lint style violation. Default
2.- cost_style
Cost in minutes per improperly formatted file (styler). Default
5.- cost_gp
Cost in minutes per goodpractice failure. Default
20.- coverage_target
Target coverage in %. Default
80.- cost_coverage_point
Cost in minutes per missing coverage point below the target. Default
5.
Value
An rsonar_debt object (list) containing:
minutesTotal estimated debt in minutes
hoursTotal estimated debt in hours
ratingSQALE rating: "A", "B", "C", "D" or "E"
breakdownData frame with details by category
Examples
if (FALSE) { # \dontrun{
res <- sonar_analyse(".")
d <- debt_index(res)
print(d)
# Total debt: 2.5h — Rating: B
} # }