Skip to content

Commit d496282

Browse files
committed
invert return val of cm-model dev repsonsiveness for #87
1 parent 84601ba commit d496282

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: repometrics
22
Title: Metrics for Your Code Repository
3-
Version: 0.1.5.029
3+
Version: 0.1.5.030
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

R/cm-models.R

+11-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' \url{https://chaoss.community/kb/metrics-model-development-responsiveness/}
44
#' \url{https://github.com/ropensci-review-tools/repometrics/issues/4}.
55
#'
6-
#' Values are in days, with lower better than higher.
6+
#' Higher values are better than lower values.
77
#'
88
#' This takes the four metrics of:
99
#' 1. Review cycle duration within a change request (in days)
@@ -13,9 +13,11 @@
1313
#' measured in both mean and median forms, and converts all measured values to
1414
#' aggregate mean and median values.
1515
#'
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).
1921
#'
2022
#' @noRd
2123
cm_model_dev_responsiveness <- function (path,
@@ -55,9 +57,10 @@ cm_model_dev_responsiveness <- function (path,
5557
vals [which (is.na (vals))] <- NA_real_
5658

5759
# 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)
6164
}
6265

6366
#' CHAOSS model "project engagement"
@@ -232,7 +235,7 @@ cm_model_community_activity <- function (path,
232235
#' \url{https://chaoss.community/kb/metrics-model-oss-project-viability-compliance-security/}
233236
#' \url{https://github.com/ropensci-review-tools/repometrics/issues/8}
234237
#'
235-
#' Higher values are better than higher values.
238+
#' Higher values are better than lower values.
236239
#'
237240
#' @noRd
238241
cm_model_oss_compliance <- function (path,

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/repometrics",
99
"issueTracker": "https://github.com/ropensci-review-tools/repometrics/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.5.029",
11+
"version": "0.1.5.030",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

0 commit comments

Comments
 (0)