{"id":15512465,"url":"https://github.com/deep-cover/deep-cover","last_synced_at":"2025-10-12T09:31:22.075Z","repository":{"id":54727233,"uuid":"104405256","full_name":"deep-cover/deep-cover","owner":"deep-cover","description":"The best coverage tool for Ruby code","archived":false,"fork":false,"pushed_at":"2022-02-19T21:42:10.000Z","size":1729,"stargazers_count":206,"open_issues_count":7,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-09T00:24:52.296Z","etag":null,"topics":["branch-coverage","coverage","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deep-cover.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"marcandre"}},"created_at":"2017-09-21T22:33:30.000Z","updated_at":"2025-07-07T16:07:37.000Z","dependencies_parsed_at":"2022-08-14T01:00:47.168Z","dependency_job_id":null,"html_url":"https://github.com/deep-cover/deep-cover","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/deep-cover/deep-cover","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-cover%2Fdeep-cover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-cover%2Fdeep-cover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-cover%2Fdeep-cover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-cover%2Fdeep-cover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deep-cover","download_url":"https://codeload.github.com/deep-cover/deep-cover/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-cover%2Fdeep-cover/sbom","scorecard":{"id":331788,"data":{"date":"2025-08-11","repo":{"name":"github.com/deep-cover/deep-cover","commit":"b546819732ddb8a13aae135c012fc9c17ad00190"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/26 approved changesets -- score normalized to 0","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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 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-18T03:48:42.519Z","repository_id":54727233,"created_at":"2025-08-18T03:48:42.519Z","updated_at":"2025-08-18T03:48:42.519Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005269,"owners_count":26083864,"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-10-10T02:00:06.843Z","response_time":62,"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":["branch-coverage","coverage","ruby"],"created_at":"2024-10-02T09:53:39.833Z","updated_at":"2025-10-12T09:31:20.659Z","avatar_url":"https://github.com/deep-cover.png","language":"Ruby","funding_links":["https://github.com/sponsors/marcandre"],"categories":["Ruby"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/deep-cover/deep-cover.svg?branch=master)](https://travis-ci.org/deep-cover/deep-cover)\n[![Backers on Open Collective](https://opencollective.com/deep-cover/backers/badge.svg)](#backers)\n[![Sponsors on Open Collective](https://opencollective.com/deep-cover/sponsors/badge.svg)](#sponsors)\n\n# Maintenance status\n\nDeep Cover has not been updated for Ruby 3.x new syntax features, in particular:\n\n- pattern match\n- `{x:}` notation\n\nUnfortunately, both co-authors are occupied contributing to other projects and can offer only minimal maintenance: complete PRs will be accepted and we welcome applications if you are interested in becoming a maintainer for this project.\n\n# DeepCover\n\nDeep Cover aims to be the best coverage tool for Ruby code:\n\n- more accurate line coverage\n- branch coverage\n- can be used as a drop-in replacement for the built-in Coverage library.\n\nIt reports a more accurate picture of your code usage. In particular a line is considered covered if and only if it is entirely executed:\n\n```\ndef foo(something: false)\n  bar if something  # =\u003e This is considered covered by builtin coverage,\n                    #    even though `bar` might not even exist\nend\n\n# somewhere in a test:\nfoo\n```\n\nOptionally, branch coverage will detect if some branches are never taken. In the following example, `test_foo` only provides values for `x` that respond to `:to_s`, thus the implicit `else` is never tested (i.e. a value of `x` that does not respond to `:to_s`)\n\n```\ndef foo(x)\n  x = x.to_s if x.respond_to? :to_s\n  # ...\nend\n\ndef test_foo\n  assert_equal something, foo(42)\n  assert_equal something_else, foo(:hello)\nend\n```\n\n## Examples\n\nThese examples are direct outputs from our HTML reporter:\n\n- [Rails' `activesupport`](https://deep-cover.github.io/rails-cover/activesupport/)\n- [Rails' `activerecord`](https://deep-cover.github.io/rails-cover/activerecord/)\n\n## DeepCover vs builtin coverage\n\n| Feature          |    MRI    |    DeepCover     |\n| ---------------- | :-------: | :--------------: |\n| Line coverage    |  partial  |        ✓         |\n| Node coverage    |    no     |        ✓         |\n| Branch coverage  |  partial  |        ✓         |\n| Method coverage  |     ✓     |        ~         |\n| Slowdown         |   \u003c 1%    |       ~20%       |\n| Platform support | Ruby 2.5+ | Ruby 2.1+, JRuby |\n\n**Line coverage**: MRI doesn't cover some lines (e.g. `when some_value`).\n\n**Node coverage**: MRI provides no way to tell which parts of any line is evaluated (e.g. `0.times { never_run }`). DeepCover covers everything.\n\n**Method coverage**: MRI considers every method defined, including methods defined on objects or via `define_method`, `class_eval`, etc. For Istanbul output, DeepCover has a different approach and covers all `def` and all blocks.\n\n| **Branch coverage**     | MRI | DeepCover |\n| ----------------------- | :-: | :-------: |\n| `if` / `unless` / `?:`  |  ✓  |     ✓     |\n| `case` / `when`         |  ✓  |     ✓     |\n| `❘❘` / `\u0026\u0026`             | no  |     ✓     |\n| `foo\u0026.bar`              |  ✓  |     ✓     |\n| `{❘foo = 42, bar: 43❘}` | no  |     ✓     |\n| `while` / `until`       |  ✓  |     !     |\n\n_Note on loops (!)_: DeepCover doesn't consider loops to be branches, but it's\neasy to support it if needed.\n\n## Installation\n\nDo the appropriate of the installation of the gem, then follow the steps that correspond to your situation.\n\n    # if the project is a gem, add this to your .gemspec and then run `bundle install`\n    spec.add_development_dependency 'deep-cover', '~\u003e 0.7'\n\n    # otherwise if using a Gemfile, add this to it and then run `bundle install`\n    gem 'deep-cover', '~\u003e 0.7', group: :test\n\n    # otherwise just run:\n    gem install deep-cover\n\n### Trying `deep-cover` quickly\n\nAn easy way to try `deep-cover`, without any configuration needed:\n\n    deep-cover clone command to run test\n    # ex:\n    deep-cover clone rake test\n\nCheck the produced `coverage/index.html`.\n\nNote, this is a bit slower and may cause issues in your tests if your use relative paths that lead outside of the directory (Such as a dependency that is in a parent directory).\n\n### Regular setup\n\n1. Require `deep-cover`\n\n   You must call `require 'deep-cover'` **before** the code you want to cover is loaded.\n\n   Typically, you want to insert that line **at the very top** of `test/test_helper.rb` or `spec/spec_helper.rb` . If `deep-cover` is required after your code, then it won't be able to detect the coverage.\n\n   Note that if some of your tests run by launching another process, that process will have to `require 'deep-cover'` also. For example you could insert `require 'deep-cover' if ENV['DEEP_COVER']` at the beginning of `lib/my_awesome_gem.rb`, before all the `require_relative 'my_awesome_gem/fabulous_core_part_1'`, ...\n   Note that the environment variable `DEEP_COVER` is set by `deep-cover exec` or `DeepCover.start`.\n\n2. Create a config file (optional)\n\n   You may want to create a config file `.deep_cover.rb` at the root of your project, where you can set the config as you wish.\n\n   ```\n   # File .deep_cover.rb\n   DeepCover.configure do\n     ignore_uncovered :default_argument\n     # ...\n   end\n   ```\n\n3. Launch it\n\n   Even after `DeepCover` is `require`d and configured, only a very minimal amount of code is actually loaded and coverage is _not started_.\n\n   The easiest way to actually start it is to use `deep-cover exec`\n\n   For example:\n\n   ```\n   $ deep-cover exec rspec\n   # ...all the output of rspec\n   # ...coverage report\n   ```\n\n### Already using SimpleCov / builtin Coverage\n\nTo make it easier to transition for projects already using the builtin `Coverage` library (such as those using `SimpleCov`), `deep-cover` can inject itself into those tools so that, while you still only have line-by-line coverage information, it becomes stricter, only marking a line as executed if _everything_ on it has been executed.\n\nYou must call `require 'deep_cover/builtin_takeover'` **before** you require the coverage tool that you normally use.\n\nFor example, the `test/test_helper.rb` file for `SimpleCov` users will look like\n\n```\nrequire 'deep_cover/builtin_takeover'\nrequire 'simplecov'\nSimpleCov.start\n# rest of `test_helper.rb`\n```\n\nOnce this is done, simply generate the coverage as you normally would. In order to get detailed information about why a line is not covered, you will need to the regular `deep-cover` mode.\n\n### Online coverage tools such as Code Climate, Coveralls, Codecov\n\nAt the moment, those tools do not support deep-cover. It is however possible to use the takeover system to, at least, make them stricter. Follow the explanation in the above section for injecting into `SimpleCov`.\n\n## Usage\n\n### Configuration\n\n`configure` is used to specify how specific `DeepCover` should be and which files it should analyse. The following code reflects the default settings:\n\n```\nDeepCover.configure do\n  ignore_uncovered :raise, :default_argument\n  detect_uncovered :trivial_if\n  paths %w[app lib]\n  exclude_paths ['fixtures', /^lib\\/ignore/]\nend\n```\n\nThe file `.deep_cover.rb` is loaded automatically when requiring `deep-cover` and is the best place to put the configuration.\n\n#### Custom filters\n\n`deep-cover` comes with a few filters that make it possible to ignore certain uncovered codes.\n\nIt is easy to add you own filters.\n\nFor example, if one wants to ignore uncovered calls to `raise` but the code uses `our_custom_raise` instead, the following with work:\n\n```\nDeepCover.configure do\n  ignore_uncovered do\n    type == :send \u0026\u0026\n      receiver == nil \u0026\u0026\n      message == :our_custom_raise\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bundle` then `rake dev:install` to install dependencies. Then, run `rake` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nFor detailed analysis:\n\n`deep-cover -d -e \"if(:try_me); puts 'cool'; end\"`\n\nTo run one of the specs in `spec`:\n\n`bin/cov boolean`\n\nMore details in the [contributing guide](https://github.com/deep-cover/deep-cover/blob/master/CONTRIBUTING.md).\n\n## Contributing\n\nPlease ask questions on StackOverflow.com. Maintainers monitor the tag `deep-cover.rb`.\n\nBug reports and pull requests are welcome on GitHub at https://github.com/deep-cover/deep-cover. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/deep-cover/deep-cover/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/deep-cover/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the DeepCover project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/deep-cover/deep-cover/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep-cover%2Fdeep-cover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeep-cover%2Fdeep-cover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep-cover%2Fdeep-cover/lists"}