Load risk definition config from options, JSON file, or fallback to bundled file.
Examples
risk_rule <- get_risk_definition()
#> Using package's default risk definition.
print(risk_rule)
#> [[1]]
#> [[1]]$label
#> [1] "dependency count"
#>
#> [[1]]$id
#> [1] "dependencies_count"
#>
#> [[1]]$key
#> [1] "dependencies_count"
#>
#> [[1]]$description
#> [1] "Risk is low when the package has 20 dependencies or fewer, medium when it has 40 dependencies or fewer, and high above 40 dependencies."
#>
#> [[1]]$thresholds
#> [[1]]$thresholds[[1]]
#> [[1]]$thresholds[[1]]$level
#> [1] "low"
#>
#> [[1]]$thresholds[[1]]$max
#> [1] 20
#>
#>
#> [[1]]$thresholds[[2]]
#> [[1]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[1]]$thresholds[[2]]$max
#> [1] 40
#>
#>
#> [[1]]$thresholds[[3]]
#> [[1]]$thresholds[[3]]$level
#> [1] "high"
#>
#> [[1]]$thresholds[[3]]$max
#> NULL
#>
#>
#>
#>
#> [[2]]
#> [[2]]$label
#> [1] "version deprecation"
#>
#> [[2]]$id
#> [1] "version_difference"
#>
#> [[2]]$key
#> [1] "later_version"
#>
#> [[2]]$description
#> [1] "Risk is low when there are 3 newer package versions or fewer, and high when there are more than 3 newer versions."
#>
#> [[2]]$thresholds
#> [[2]]$thresholds[[1]]
#> [[2]]$thresholds[[1]]$level
#> [1] "low"
#>
#> [[2]]$thresholds[[1]]$max
#> [1] 3
#>
#>
#> [[2]]$thresholds[[2]]
#> [[2]]$thresholds[[2]]$level
#> [1] "high"
#>
#> [[2]]$thresholds[[2]]$max
#> NULL
#>
#>
#>
#>
#> [[3]]
#> [[3]]$label
#> [1] "code coverage"
#>
#> [[3]]$id
#> [1] "code_coverage"
#>
#> [[3]]$key
#> [1] "code_coverage"
#>
#> [[3]]$description
#> [1] "Risk is high when code coverage is 0.6 or lower, medium when code coverage is 0.8 or lower, and low when code coverage is above 0.8 up to 1."
#>
#> [[3]]$thresholds
#> [[3]]$thresholds[[1]]
#> [[3]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[3]]$thresholds[[1]]$max
#> [1] 0.6
#>
#>
#> [[3]]$thresholds[[2]]
#> [[3]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[3]]$thresholds[[2]]$max
#> [1] 0.8
#>
#>
#> [[3]]$thresholds[[3]]
#> [[3]]$thresholds[[3]]$level
#> [1] "low"
#>
#> [[3]]$thresholds[[3]]$max
#> [1] 1
#>
#>
#>
#>
#> [[4]]
#> [[4]]$label
#> [1] "popularity"
#>
#> [[4]]$id
#> [1] "popularity"
#>
#> [[4]]$key
#> [1] "total_download"
#>
#> [[4]]$description
#> [1] "Risk is high when total downloads are 3,500,000 or fewer, medium when total downloads are 50,000,000 or fewer, and low above 50,000,000."
#>
#> [[4]]$thresholds
#> [[4]]$thresholds[[1]]
#> [[4]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[4]]$thresholds[[1]]$max
#> [1] 3500000
#>
#>
#> [[4]]$thresholds[[2]]
#> [[4]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[4]]$thresholds[[2]]$max
#> [1] 50000000
#>
#>
#> [[4]]$thresholds[[3]]
#> [[4]]$thresholds[[3]]$level
#> [1] "low"
#>
#> [[4]]$thresholds[[3]]$max
#> NULL
#>
#>
#>
#>
#> [[5]]
#> [[5]]$label
#> [1] "license"
#>
#> [[5]]$id
#> [1] "license"
#>
#> [[5]]$key
#> [1] "license"
#>
#> [[5]]$description
#> [1] "Risk is high for AGPL, SSPL, GNU Affero GPL, CeCILL, Open Software Licence, Server Side Public License, and unavailable licenses; medium for GPL, LGPL, and Artistic licenses; and low for MIT and Apache licenses. Unknown licenses use the default high risk."
#>
#> [[5]]$default
#> [1] "high"
#>
#> [[5]]$thresholds
#> [[5]]$thresholds[[1]]
#> [[5]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[5]]$thresholds[[1]]$values
#> [[5]]$thresholds[[1]]$values[[1]]
#> [1] "AGPL"
#>
#> [[5]]$thresholds[[1]]$values[[2]]
#> [1] "SSPL"
#>
#> [[5]]$thresholds[[1]]$values[[3]]
#> [1] "GNUAFFEROGPL"
#>
#> [[5]]$thresholds[[1]]$values[[4]]
#> [1] "CECILL"
#>
#> [[5]]$thresholds[[1]]$values[[5]]
#> [1] "OPENSOFTWARELICENCE"
#>
#> [[5]]$thresholds[[1]]$values[[6]]
#> [1] "SERVERSIDEPUBLICLICENSE"
#>
#> [[5]]$thresholds[[1]]$values[[7]]
#> [1] "NOTAVAILABLE"
#>
#>
#>
#> [[5]]$thresholds[[2]]
#> [[5]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[5]]$thresholds[[2]]$values
#> [[5]]$thresholds[[2]]$values[[1]]
#> [1] "GPL"
#>
#> [[5]]$thresholds[[2]]$values[[2]]
#> [1] "LGPL"
#>
#> [[5]]$thresholds[[2]]$values[[3]]
#> [1] "ARTISTIC"
#>
#>
#>
#> [[5]]$thresholds[[3]]
#> [[5]]$thresholds[[3]]$level
#> [1] "low"
#>
#> [[5]]$thresholds[[3]]$values
#> [[5]]$thresholds[[3]]$values[[1]]
#> [1] "MIT"
#>
#> [[5]]$thresholds[[3]]$values[[2]]
#> [1] "APACHE"
#>
#>
#>
#>
#>
#> [[6]]
#> [[6]]$label
#> [1] "reverse dependencies"
#>
#> [[6]]$id
#> [1] "reverse_dependencies"
#>
#> [[6]]$key
#> [1] "reverse_dependencies_count"
#>
#> [[6]]$description
#> [1] "Risk is high when the package has 5 reverse dependencies or fewer, medium when it has 15 reverse dependencies or fewer, and low above 15 reverse dependencies."
#>
#> [[6]]$thresholds
#> [[6]]$thresholds[[1]]
#> [[6]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[6]]$thresholds[[1]]$max
#> [1] 5
#>
#>
#> [[6]]$thresholds[[2]]
#> [[6]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[6]]$thresholds[[2]]$max
#> [1] 15
#>
#>
#> [[6]]$thresholds[[3]]
#> [[6]]$thresholds[[3]]$level
#> [1] "low"
#>
#> [[6]]$thresholds[[3]]$max
#> NULL
#>
#>
#>
#>
#> [[7]]
#> [[7]]$label
#> [1] "documentation"
#>
#> [[7]]$id
#> [1] "documentation"
#>
#> [[7]]$key
#> [1] "documentation_score"
#>
#> [[7]]$description
#> [1] "Risk is high when the documentation score is 3 or lower, medium when the documentation score is 6 or lower, and low above 6."
#>
#> [[7]]$thresholds
#> [[7]]$thresholds[[1]]
#> [[7]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[7]]$thresholds[[1]]$max
#> [1] 3
#>
#>
#> [[7]]$thresholds[[2]]
#> [[7]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[7]]$thresholds[[2]]$max
#> [1] 6
#>
#>
#> [[7]]$thresholds[[3]]
#> [[7]]$thresholds[[3]]$level
#> [1] "low"
#>
#> [[7]]$thresholds[[3]]$max
#> NULL
#>
#>
#>
#>
#> [[8]]
#> [[8]]$label
#> [1] "documentation"
#>
#> [[8]]$id
#> [1] "documentation"
#>
#> [[8]]$key
#> [1] "has_ex_docs_score"
#>
#> [[8]]$description
#> [1] "Risk is high when the examples and documentation score is 0.6 or lower, medium when it is 0.8 or lower, and low when it is above 0.8 up to 1."
#>
#> [[8]]$thresholds
#> [[8]]$thresholds[[1]]
#> [[8]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[8]]$thresholds[[1]]$max
#> [1] 0.6
#>
#>
#> [[8]]$thresholds[[2]]
#> [[8]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[8]]$thresholds[[2]]$max
#> [1] 0.8
#>
#>
#> [[8]]$thresholds[[3]]
#> [[8]]$thresholds[[3]]$level
#> [1] "low"
#>
#> [[8]]$thresholds[[3]]$max
#> [1] 1
#>
#>
#>
#>
#> [[9]]
#> [[9]]$label
#> [1] "R cmd check"
#>
#> [[9]]$id
#> [1] "cmd-check"
#>
#> [[9]]$key
#> [1] "cmd_check"
#>
#> [[9]]$description
#> [1] "Risk is high when the R CMD check score is 0, medium when it is 0.8 or lower, and low when it is above 0.8 up to 1."
#>
#> [[9]]$thresholds
#> [[9]]$thresholds[[1]]
#> [[9]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[9]]$thresholds[[1]]$max
#> [1] 0
#>
#>
#> [[9]]$thresholds[[2]]
#> [[9]]$thresholds[[2]]$level
#> [1] "medium"
#>
#> [[9]]$thresholds[[2]]$max
#> [1] 0.8
#>
#>
#> [[9]]$thresholds[[3]]
#> [[9]]$thresholds[[3]]$level
#> [1] "low"
#>
#> [[9]]$thresholds[[3]]$max
#> [1] 1
#>
#>
#>
#>
#> [[10]]
#> [[10]]$label
#> [1] "bug reports URL"
#>
#> [[10]]$id
#> [1] "has_bug_reports_url"
#>
#> [[10]]$key
#> [1] "has_bug_reports_url_risk"
#>
#> [[10]]$description
#> [1] "Risk is low when the package provides a bug reports URL and high when no bug reports URL is available (NULL or NA)."
#>
#> [[10]]$default
#> [1] "high"
#>
#> [[10]]$thresholds
#> [[10]]$thresholds[[1]]
#> [[10]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[10]]$thresholds[[1]]$max
#> [1] 0
#>
#>
#> [[10]]$thresholds[[2]]
#> [[10]]$thresholds[[2]]$level
#> [1] "low"
#>
#> [[10]]$thresholds[[2]]$max
#> [1] 1
#>
#>
#>
#>
#> [[11]]
#> [[11]]$label
#> [1] "source control"
#>
#> [[11]]$id
#> [1] "has_source_control"
#>
#> [[11]]$key
#> [1] "has_source_control_risk"
#>
#> [[11]]$description
#> [1] "Risk is low when the package provides a source control link and high when no source control is available (NULL or NA)."
#>
#> [[11]]$default
#> [1] "high"
#>
#> [[11]]$thresholds
#> [[11]]$thresholds[[1]]
#> [[11]]$thresholds[[1]]$level
#> [1] "high"
#>
#> [[11]]$thresholds[[1]]$max
#> [1] 0
#>
#>
#> [[11]]$thresholds[[2]]
#> [[11]]$thresholds[[2]]$level
#> [1] "low"
#>
#> [[11]]$thresholds[[2]]$max
#> [1] 1
#>
#>
#>
#>
