{"id":13462163,"url":"https://github.com/sebastianbergmann/php-code-coverage","last_synced_at":"2026-04-12T07:01:40.442Z","repository":{"id":579763,"uuid":"212659","full_name":"sebastianbergmann/php-code-coverage","owner":"sebastianbergmann","description":"Library that provides collection, processing, and rendering functionality for PHP code coverage information.","archived":false,"fork":false,"pushed_at":"2026-04-07T09:03:57.000Z","size":72505,"stargazers_count":8932,"open_issues_count":24,"forks_count":386,"subscribers_count":51,"default_branch":"main","last_synced_at":"2026-04-09T02:02:34.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastianbergmann.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog-14.0.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/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},"funding":{"github":"sebastianbergmann","liberapay":"sebastianbergmann","thanks_dev":"u/gh/sebastianbergmann","tidelift":"packagist/phpunit/php-code-coverage"}},"created_at":"2009-05-28T16:01:43.000Z","updated_at":"2026-04-07T09:04:01.000Z","dependencies_parsed_at":"2023-07-05T15:02:49.222Z","dependency_job_id":"b9cd115f-e2a7-49f9-b832-c28205b04b4f","html_url":"https://github.com/sebastianbergmann/php-code-coverage","commit_stats":{"total_commits":2474,"total_committers":117,"mean_commits":"21.145299145299145","dds":"0.20129345189975745","last_synced_commit":"e5f59db6f62e7682b46516f81315ac6fab6cbb3f"},"previous_names":[],"tags_count":258,"template":false,"template_full_name":null,"purl":"pkg:github/sebastianbergmann/php-code-coverage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphp-code-coverage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphp-code-coverage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphp-code-coverage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphp-code-coverage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastianbergmann","download_url":"https://codeload.github.com/sebastianbergmann/php-code-coverage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphp-code-coverage/sbom","scorecard":{"id":808518,"data":{"date":"2025-08-11","repo":{"name":"github.com/sebastianbergmann/php-code-coverage","commit":"086553c5b2e0e1e20293d782d788ab768202b621"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"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":"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":10,"reason":"30 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Code-Review","score":0,"reason":"Found 1/23 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":"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":"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":"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:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"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":"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 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-23T12:28:24.587Z","repository_id":579763,"created_at":"2025-08-23T12:28:24.587Z","updated_at":"2025-08-23T12:28:24.587Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31706765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-07-31T12:00:40.911Z","updated_at":"2026-04-12T07:01:40.435Z","avatar_url":"https://github.com/sebastianbergmann.png","language":"PHP","readme":"# phpunit/php-code-coverage\n\n[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v)](https://packagist.org/packages/phpunit/php-code-coverage)\n[![CI Status](https://github.com/sebastianbergmann/php-code-coverage/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-code-coverage/actions)\n[![codecov](https://codecov.io/gh/sebastianbergmann/php-code-coverage/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/php-code-coverage)\n\nProvides collection, processing, and rendering functionality for PHP code coverage information.\n\n## Installation\n\nYou can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):\n\n```\ncomposer require phpunit/php-code-coverage\n```\n\nIf you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:\n\n```\ncomposer require --dev phpunit/php-code-coverage\n```\n\n## Usage\n\n### Collecting code coverage data and generating a report\n\n```php\n\u003c?php declare(strict_types=1);\nuse SebastianBergmann\\CodeCoverage\\CodeCoverage;\nuse SebastianBergmann\\CodeCoverage\\Driver\\Selector as DriverSelector;\nuse SebastianBergmann\\CodeCoverage\\Filter;\nuse SebastianBergmann\\CodeCoverage\\Report\\Facade as ReportFacade;\n\n$filter = new Filter;\n\n$filter-\u003eincludeFiles(\n    [\n        '/path/to/file.php',\n        '/path/to/another_file.php',\n    ],\n);\n\n$coverage = new CodeCoverage(\n    (new DriverSelector)-\u003eforLineCoverage($filter),\n    $filter,\n);\n\n$coverage-\u003estart('\u003cname of test\u003e');\n\n// ...\n\n$coverage-\u003estop();\n\nReportFacade::fromObject($coverage)-\u003erenderOpenClover('/tmp/openclover.xml');\n```\n\n### Generating a report from serialized code coverage data\n\n```php\n\u003c?php declare(strict_types=1);\nuse SebastianBergmann\\CodeCoverage\\Report\\Facade as ReportFacade;\nuse SebastianBergmann\\CodeCoverage\\Serialization\\Unserializer;\n\n$data = (new Unserializer)-\u003eunserialize('/path/to/coverage.php');\n\nReportFacade::fromSerializedData($data)-\u003erenderOpenClover('/tmp/openclover.xml');\n```\n","funding_links":["https://github.com/sponsors/sebastianbergmann","https://liberapay.com/sebastianbergmann","https://thanks.dev/u/gh/sebastianbergmann","https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage"],"categories":["Uncategorized","PHP","类库"],"sub_categories":["Uncategorized","代码检查/静态分析"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbergmann%2Fphp-code-coverage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastianbergmann%2Fphp-code-coverage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbergmann%2Fphp-code-coverage/lists"}