{"id":14069119,"url":"https://github.com/r-lib/covr","last_synced_at":"2025-12-17T06:47:02.008Z","repository":{"id":24871374,"uuid":"28287105","full_name":"r-lib/covr","owner":"r-lib","description":"Test coverage reports for R","archived":false,"fork":false,"pushed_at":"2025-11-14T14:01:01.000Z","size":10256,"stargazers_count":344,"open_issues_count":94,"forks_count":121,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-12-08T19:29:11.494Z","etag":null,"topics":["codecov","coverage","coverage-report","r","travis-ci"],"latest_commit_sha":null,"homepage":"https://covr.r-lib.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-lib.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-12-21T03:26:04.000Z","updated_at":"2025-12-06T06:45:47.000Z","dependencies_parsed_at":"2023-09-27T21:42:42.639Z","dependency_job_id":"0f48bed3-7ab4-4029-8c18-5cf851494b32","html_url":"https://github.com/r-lib/covr","commit_stats":{"total_commits":1091,"total_committers":71,"mean_commits":"15.366197183098592","dds":"0.26764436296975247","last_synced_commit":"c0c88f14bc9d5ec738839321b741975b6092d609"},"previous_names":["jimhester/covr"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/r-lib/covr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcovr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcovr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcovr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcovr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-lib","download_url":"https://codeload.github.com/r-lib/covr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-lib%2Fcovr/sbom","scorecard":{"id":756762,"data":{"date":"2025-08-11","repo":{"name":"github.com/r-lib/covr","commit":"40122df12bc9ef1e577dd0720a895b5340b1516f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.3,"checks":[{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Maintained","score":4,"reason":"2 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":9,"reason":"Found 15/16 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/pkgdown.yaml:23","Warn: no topLevel permission defined: .github/workflows/R-CMD-check.yaml:1","Warn: no topLevel permission defined: .github/workflows/pkgdown.yaml:1","Warn: no topLevel permission defined: .github/workflows/pr-commands.yaml:1","Warn: no topLevel permission defined: .github/workflows/test-coverage.yaml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/R-CMD-check.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/R-CMD-check.yaml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/R-CMD-check.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pkgdown.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pkgdown.yaml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pkgdown.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-commands.yaml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/pr-commands.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/test-coverage.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/test-coverage.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-coverage.yaml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/r-lib/covr/test-coverage.yaml/main?enable=pin","Warn: containerImage not pinned by hash: docker_checker/Dockerfile:1","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  17 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T21:53:51.779Z","repository_id":24871374,"created_at":"2025-08-22T21:53:51.779Z","updated_at":"2025-08-22T21:53:51.779Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27778799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codecov","coverage","coverage-report","r","travis-ci"],"created_at":"2024-08-13T07:06:37.340Z","updated_at":"2025-12-17T06:47:01.986Z","avatar_url":"https://github.com/r-lib.png","language":"R","readme":"# covr \u003cimg src=\"man/figures/logo.png\" align=\"right\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/r-lib/covr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/covr/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/r-lib/covr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/r-lib/covr?branch=master)\n[![CRAN version](https://www.r-pkg.org/badges/version/covr)](https://cran.r-project.org/package=covr)\n\u003c!-- badges: end --\u003e\n\nTrack test coverage for your R package and view reports locally or (optionally)\nupload the results to [codecov](https://about.codecov.io/) or [coveralls](https://coveralls.io/).\n\n# Installation #\n\n```r\ninstall.packages(\"covr\")\n\n# For devel version\ndevtools::install_github(\"r-lib/covr\")\n```\n\nThe easiest way to setup covr on [Github Actions](https://github.com/r-lib/actions/tree/v2-branch/examples#test-coverage-workflow) \nis with [usethis](https://github.com/r-lib/usethis).\n\n```r\nusethis::use_github_action(\"test-coverage\")\n```\n\n# Usage #\n\nFor local development a coverage report can be used to inspect coverage for\neach line in your package. *Note* requires the\n[DT](https://github.com/rstudio/DT) package to be installed.\n\n```r\nlibrary(covr)\n\n# If run with no arguments implicitly calls `package_coverage()`\nreport()\n```\n\ncovr also defines an [RStudio Addin](https://rstudio.github.io/rstudioaddins/),\nwhich runs `report()` on the active project. This can be used via the Addin\nmenu or by binding the action to a\n[shortcut](https://rstudio.github.io/rstudioaddins/#keyboard-shorcuts), e.g.\n*Ctrl-Shift-C*.\n\n## Interactively ##\n```r\n# If run with the working directory within the package source.\npackage_coverage()\n\n# or a package in another directory\ncov \u003c- package_coverage(\"/dir/lintr\")\n\n# view results as a data.frame\nas.data.frame(cov)\n\n# zero_coverage() shows only uncovered lines.\n# If run within RStudio, `zero_coverage()` will open a marker pane with the\n# uncovered lines.\nzero_coverage(cov)\n```\n\n# Exclusions #\n\n`covr` supports a few of different ways of excluding some or all of a file.\n\n## .covrignore file ##\n\nA `.covrignore` file located in your package's root directory can be used to\nexclude files or directories.\n\nThe lines in the `.covrignore` file are interpreted as a list of file globs to\nignore. It uses the globbing rules in `Sys.glob()`. Any directories listed will\nignore all the files in the directory.\n\nAlternative locations for the file can be set by the environment variable\n`COVR_COVRIGNORE` or the R option `covr.covrignore`.\n\nThe `.covrignore` file should be added to your `.RBuildignore` file unless you\nwant to distribute it with your package. If so it can be added to\n`inst/.covrignore` instead.\n\n\n## Function Exclusions ##\nThe `function_exclusions` argument to `package_coverage()` can be used to\nexclude functions by name. This argument takes a vector of regular expressions\nmatching functions to exclude.\n\n```r\n# exclude print functions\npackage_coverage(function_exclusions = \"print\\\\.\")\n\n# exclude `.onLoad` function\npackage_coverage(function_exclusions = \"\\\\.onLoad\")\n```\n\n## Line Exclusions ##\nThe `line_exclusions` argument to `package_coverage()` can be used to exclude some or\nall of a file.  This argument takes a list of filenames or named ranges to\nexclude.\n\n```r\n# exclude whole file of R/test.R\npackage_coverage(line_exclusions = \"R/test.R\")\n\n# exclude lines 1 to 10 and 15 from R/test.R\npackage_coverage(line_exclusions = list(\"R/test.R\" = c(1:10, 15)))\n\n# exclude lines 1 to 10 from R/test.R, all of R/test2.R\npackage_coverage(line_exclusions = list(\"R/test.R\" = c(1, 10), \"R/test2.R\"))\n```\n\n## Exclusion Comments ##\n\nIn addition you can exclude lines from the coverage by putting special comments\nin your source code.\n\nThis can be done per line.\n```r\nf1 \u003c- function(x) {\n  x + 1 # nocov\n}\n```\n\nOr by specifying a range with a start and end.\n```r\nf2 \u003c- function(x) { # nocov start\n  x + 2\n} # nocov end\n```\n\nThe patterns used can be specified by setting the global options\n`covr.exclude_pattern`, `covr.exclude_start`, `covr.exclude_end`.\n\nNB: The same pattern applies to exclusions in the `src` folder, so skipped lines in, e.g., C code (where comments can start with `//`) should look like `// # nocov`.\n\n# FAQ #\n## Will covr work with testthat, RUnit, etc... ##\nCovr should be compatible with any testing package, it uses\n`tools::testInstalledPackage()` to run your packages tests.\n\n## Will covr work with alternative compilers such as ICC ##\nCovr now supports Intel's `icc` compiler, thanks to work contributed by Qin\nWang at Oracle.\n\nCovr is known to work with clang versions `3.5+` and gcc version `4.2+`.\n\nIf the appropriate gcov version is not on your path you can set the appropriate\nlocation with the `covr.gcov` options. If you set this path to \"\" it will turn\n_off_ coverage of compiled code.\n```r\noptions(covr.gcov = \"path/to/gcov\")\n```\n\n## How does covr work? ##\n`covr` tracks test coverage by modifying a package's code to add tracking calls\nto each call.\n\nThe vignette\n[vignettes/how_it_works.Rmd](https://github.com/r-lib/covr/blob/master/vignettes/how_it_works.Rmd)\ncontains a detailed explanation of the technique and the rationale behind it.\n\nYou can view the vignette from within `R` using\n\n```r\nvignette(\"how_it_works\", package = \"covr\")\n```\n\n## Why can't covr run during R CMD check ##\nBecause covr modifies the package code it is possible there are unknown edge\ncases where that modification affects the output. In addition when tracking\ncoverage for compiled code covr compiles the package without optimization,\nwhich _can_ modify behavior (usually due to package bugs which are masked with\nhigher optimization levels).\n\n# Alternative Coverage Tools #\n- \u003chttps://github.com/MangoTheCat/testCoverage\u003e (no longer supported)\n- [**R-coverage**](https://web.archive.org/web/20160611114452/http://r2d2.quartzbio.com/posts/r-coverage-docker.html) (no longer supported)\n\n## Code of Conduct\n\nPlease note that the covr project is released with a [Contributor Code of Conduct](https://github.com/r-lib/covr/blob/main/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fcovr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-lib%2Fcovr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-lib%2Fcovr/lists"}