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

Laravel Stats Phploc Laravel Package

stefanzweifel/laravel-stats-phploc

Fork of sebastianbergmann/phploc used to keep wnx/laravel-stats compatible across Laravel versions by supporting multiple sebastian/version releases. Measures PHP project size and structure (LOC, complexity, dependencies). Not intended for real projects.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Codebase Health Metrics: Enables tracking of Lines of Code (LOC), cyclomatic complexity, and structural metrics to inform technical debt prioritization, refactoring efforts, or compliance with coding standards (e.g., "no class should exceed 500 LOC").
  • Developer Productivity Tools: Integrates with CI/CD pipelines to automate code quality checks (e.g., fail builds if complexity exceeds thresholds) or surface trends in pull request reviews (e.g., "This PR adds 200 LOC to a 1,000+ LOC class").
  • Roadmap Data-Driven Decisions: Provides historical trends (e.g., LOC growth over time) to justify hiring, tooling investments (e.g., "We need a static analyzer because class complexity is rising"), or feature deprioritization (e.g., "This module is 3x larger than others—should it be split?").
  • Build vs. Buy: Avoids reinventing wheel for PHP-specific metrics; leverages battle-tested open-source tooling (originally by Sebastian Bergmann) with minimal overhead.
  • Use Cases:
    • Onboarding: Quantify codebase size for new hires ("This repo has 50K LOC").
    • Refactoring: Identify monolithic classes/methods (e.g., "This method has 96 cyclomatic complexity").
    • Architecture Reviews: Track namespace/class growth to enforce modularity (e.g., "Why is App\Services 40% of the codebase?").
    • Security Audits: Flag high-complexity methods as potential attack surfaces.

When to Consider This Package

  • Adopt if:
    • Your team uses Laravel/PHP and lacks automated code metrics in CI or local development.
    • You need lightweight, CLI-driven analysis (not a full IDE plugin like PHPStan/Psalm).
    • Your roadmap includes technical debt reduction or codebase health dashboards.
    • You’re evaluating third-party tooling (e.g., SonarQube) but want a free, PHP-native alternative for initial insights.
  • Look elsewhere if:
    • You require real-time IDE integration (use PHPStan or Psalm instead).
    • Your project is non-PHP (e.g., JavaScript, Python).
    • You need advanced static analysis (e.g., type checking, security vulnerabilities) → use SonarQube or Snyk.
    • You’re constrained by production dependencies (this is a dev tool, not a library for runtime use).
    • Your team prefers GUI tools (e.g., Understand or SourceMonitor).

How to Pitch It (Stakeholders)

For Executives: "This tool gives us objective data to make smarter decisions about our PHP codebase—like identifying bloated classes that slow down development or flagging technical debt before it becomes a crisis. For example, if we see a module growing 20% faster than others, we can either invest in refactoring or deprioritize features there. It’s like a ‘CT scan’ for our code, and it integrates seamlessly into our existing Laravel workflows with zero runtime overhead."

For Engineering: *"We’re adding a 5-minute CLI command (php phploc.phar src) to our CI pipeline that will:

  • Automate code health checks (e.g., fail builds if average method complexity > 10).
  • Surface trends in pull requests (e.g., ‘This PR adds 150 LOC to a 500+ LOC file’).
  • Replace manual ‘code smell’ guesswork with hard metrics—no more debates about ‘Is this class too big?’. No new dependencies, no IDE setup—just drop it into tools/ and run it. We can even hook it into our dashboard for execs to see progress on technical debt."
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.
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
spatie/mailcoach-vapor