Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Code Coverage Checker Laravel Package

handcraftedinthealps/code-coverage-checker

CLI tool to enforce PHPUnit code coverage thresholds. Generate a coverage.php report, then check line/class/method coverage against a minimum percentage, optionally limited to specific directories—ideal for CI to fail builds when coverage drops.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enforcing Code Quality Standards: Integrate mandatory coverage thresholds (e.g., 90% line coverage) into CI/CD pipelines to block merges for non-compliant code, reducing technical debt and improving maintainability.
  • Granular Coverage Enforcement: Implement tiered thresholds (e.g., 95% for core logic, 85% for utilities) to prioritize critical paths while balancing development velocity.
  • Build vs. Buy: Avoid reinventing wheel by adopting this lightweight, MIT-licensed solution instead of custom scripts or commercial tools (e.g., SonarQube) for PHP projects.
  • Use Cases:
    • Open-Source Projects: Enforce contributor compliance with coverage standards via pre-commit hooks or CI gates.
    • Legacy Codebases: Identify under-tested modules (e.g., Directory/A) to target refactoring efforts.
    • Symfony/Laravel Apps: Leverage Symfony/PHPUnit integration to enforce coverage alongside existing test suites.

When to Consider This Package

  • Adopt If:
    • Your PHP project uses PHPUnit (v9+) or Symfony’s PHPUnit Bridge (v6–8).
    • You need granular coverage checks (line/method/class-level) with custom thresholds (e.g., 96%).
    • Your team lacks a dedicated QA tool (e.g., SonarQube) but requires CI-friendly enforcement.
    • You want actionable output (e.g., lists of failing files) to debug coverage gaps.
  • Look Elsewhere If:
    • You need advanced static analysis (e.g., duplication, complexity) → Use SonarQube or PHPStan.
    • Your stack uses non-PHPUnit testing frameworks (e.g., PestPHP without PHPUnit).
    • You require historical trend tracking → Integrate with GitHub Actions + custom scripts.
    • Your team prefers visual dashboards over CLI output → Consider CodeClimate or DeepCode.

How to Pitch It (Stakeholders)

For Executives: "This tool automates code coverage enforcement in our PHP stack, reducing bugs and tech debt by blocking low-coverage merges. For example, we can mandate 96% line coverage for critical modules—like a ‘seatbelt’ for our codebase. It’s lightweight, open-source, and integrates seamlessly with our existing PHPUnit tests, requiring minimal setup. Early adoption could cut regression bugs by 30% (per industry benchmarks) while keeping development velocity intact."

For Engineering: *"We’re adding a CI gate for code coverage using code-coverage-checker. Here’s why:

  • No new dependencies: Works with PHPUnit/Symfony out of the box.
  • Flexible thresholds: Enforce per-module rules (e.g., 90% for src/, 80% for tests/).
  • Debug-friendly: Fails fast with a list of under-covered files (e.g., src/Service/X.php: 82%).
  • Lightweight: CLI tool (~500 LOC), no bloated dashboards. Proposal: Add to phpunit.xml as a pre-commit hook and CI check. Example workflow:
phpunit --coverage-php=coverage.clover
vendor/bin/code-coverage-checker coverage.clover line 96 src/

Impact: Catches untested edge cases early, aligns with our ‘quality gates’ initiative."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky