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

Churn Php Laravel Package

bmitch/churn-php

churn-php helps you spot PHP files that are likely refactoring candidates by analyzing Git commit churn and cyclomatic complexity, then ranking files with a combined score and presenting the results in an easy-to-read table.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Technical Debt Reduction: Integrate into CI/CD pipelines to proactively identify high-churn, high-complexity PHP files for refactoring, reducing long-term maintenance costs.
  • Developer Productivity: Automate code health assessments to prioritize refactoring efforts, freeing engineers from manual codebase audits.
  • Quality Gates: Enforce minimum code quality standards by failing builds when churn scores exceed thresholds (e.g., maxScoreThreshold).
  • Roadmap for Legacy Systems: Target legacy Laravel/PHP monoliths where technical debt is high, using churn-php to quantify and justify refactoring initiatives.
  • Build vs. Buy: Avoid reinventing churn analysis tools; leverage this mature, open-source solution instead of custom scripts.
  • Use Cases:
    • Pre-release code reviews to flag risky files.
    • Onboarding new developers to highlight "hotspots" in the codebase.
    • Post-incident analysis to identify files involved in frequent bugs.

When to Consider This Package

  • Adopt if:

    • Your Laravel/PHP codebase has >50K LOC and shows signs of technical debt (e.g., high cyclomatic complexity, frequent merge conflicts).
    • You lack automated metrics to prioritize refactoring (e.g., no existing SonarQube/PHPStan integration).
    • Your team uses Git (or Mercurial/SVN) and needs a lightweight, CLI-based tool.
    • You want actionable insights beyond static analysis (e.g., "This file changed 50x in the last year and has a complexity score of 20").
  • Look elsewhere if:

    • Your project uses non-Git VCS (e.g., Fossil) or lacks version control entirely.
    • You need real-time IDE integration (consider PHPStan/Psalm plugins instead).
    • Your priority is security vulnerabilities (use tools like php-security-advisory or sensio-labs/security-checker).
    • You require fine-grained dependency analysis (e.g., "Which files depend on this legacy service?").

How to Pitch It (Stakeholders)

For Executives: *"churn-php is a low-cost, high-impact tool to identify the most risky parts of our Laravel codebase—files that change often and are complex. By integrating this into our CI pipeline, we can:

  • Reduce bugs by flagging unstable code early.
  • Lower maintenance costs by targeting refactoring efforts where they matter most.
  • Improve onboarding by surfacing high-churn files to new hires. It’s like a ‘tech debt GPS’ for our PHP codebase, costing nothing to try and paying dividends in developer productivity."*

For Engineering Teams: *"This tool gives us data-driven refactoring priorities by scoring files based on:

  • Churn: How often a file changes (high churn = higher risk).
  • Complexity: Cyclomatic complexity (high complexity = harder to maintain). We can:
  • Fail builds if churn scores exceed thresholds (e.g., maxScoreThreshold: 0.9).
  • Export results to CSV/JSON for tracking over time.
  • Integrate with Slack/GitHub via hooks to alert teams about critical files. It’s fast (parallel processing), configurable (ignore tests, custom paths), and open-source—no vendor lock-in."*

For Developers: *"Think of this as a ‘code health report’ for your PHP files. Run it locally or in CI with:

composer require bmitch/churn-php --dev
./vendor/bin/churn run src

It’ll show you a ranked list of files to refactor, sorted by risk. You can even customize the output (Markdown for PRs, JSON for APIs) or extend it with hooks. No more guessing—just actionable insights."*

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.
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium