|
3 | 3 | #' \url{https://chaoss.community/kb/metrics-model-development-responsiveness/}
|
4 | 4 | #' \url{https://github.com/ropensci-review-tools/repometrics/issues/4}.
|
5 | 5 | #'
|
6 |
| -#' Values are in days, with lower better than higher. |
| 6 | +#' Higher values are better than lower values. |
7 | 7 | #'
|
8 | 8 | #' This takes the four metrics of:
|
9 | 9 | #' 1. Review cycle duration within a change request (in days)
|
|
13 | 13 | #' measured in both mean and median forms, and converts all measured values to
|
14 | 14 | #' aggregate mean and median values.
|
15 | 15 | #'
|
16 |
| -#' @return A single numeric value of the mean of all of the four values. As |
17 |
| -#' this is in days, it is converted to log 10, with both NA values and values < |
18 |
| -#' 1 converted to values of 1 prior to log. |
| 16 | +#' @return A single numeric value formed from the mean of all of the four |
| 17 | +#' values. As this is in days, it is converted to log 10, with both NA values |
| 18 | +#' and values < 1 converted to values of 1 prior to log. The final value is |
| 19 | +#' then two minus this value, so higher values are better, and all are assessed |
| 20 | +#' against a standard scale of 100 days (log10(100) = 2). |
19 | 21 | #'
|
20 | 22 | #' @noRd
|
21 | 23 | cm_model_dev_responsiveness <- function (path,
|
@@ -55,9 +57,10 @@ cm_model_dev_responsiveness <- function (path,
|
55 | 57 | vals [which (is.na (vals))] <- NA_real_
|
56 | 58 |
|
57 | 59 | # But only return mean value, to align with all others
|
58 |
| - val <- vals [["mean"]] |
59 |
| - val <- ifelse (is.na (val) | val < 1, 1, val) |
60 |
| - return (log10 (val)) |
| 60 | + # And convert final value to scale so that higher is better by |
| 61 | + val <- 2 - log10 (vals [["mean"]]) |
| 62 | + val <- ifelse (is.na (val), 0, val) |
| 63 | + return (val) |
61 | 64 | }
|
62 | 65 |
|
63 | 66 | #' CHAOSS model "project engagement"
|
@@ -232,7 +235,7 @@ cm_model_community_activity <- function (path,
|
232 | 235 | #' \url{https://chaoss.community/kb/metrics-model-oss-project-viability-compliance-security/}
|
233 | 236 | #' \url{https://github.com/ropensci-review-tools/repometrics/issues/8}
|
234 | 237 | #'
|
235 |
| -#' Higher values are better than higher values. |
| 238 | +#' Higher values are better than lower values. |
236 | 239 | #'
|
237 | 240 | #' @noRd
|
238 | 241 | cm_model_oss_compliance <- function (path,
|
|
0 commit comments