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

Phploc Laravel Package

cmgmyr/phploc

Laravel-friendly wrapper around phpLOC for measuring PHP project size and structure. Generate lines-of-code, classes, methods, complexity-style stats from the command line or within builds to quickly gauge codebase scope and trends.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Technical Debt Quantification: Provides empirical data to prioritize refactoring efforts by identifying bloated modules (e.g., classes exceeding 500 LOC or methods with high cyclomatic complexity).
  • Codebase Health Metrics: Enables tracking of key indicators (LOC, class/method counts, complexity) over time to justify resource allocation for maintenance vs. new features.
  • CI/CD Enforcement: Supports automated gates to block PRs exceeding predefined thresholds (e.g., "No PRs increasing LOC by >10% in core modules").
  • Onboarding Efficiency: Accelerates new developer ramp-up by surfacing structural insights (e.g., "This module has 80% of the project’s business logic").
  • Architecture Validation: Validates design decisions (e.g., "This service layer has 3x the LOC of the API layer—should we reconsider the split?").
  • Build vs. Buy Tradeoffs: Offers baseline metrics to compare internal tooling against third-party solutions (e.g., "Our custom admin panel has 12K LOC vs. a SaaS alternative’s 5K").

When to Consider This Package

Adopt When:

  • Your Laravel project lacks baseline code metrics and needs lightweight, actionable insights.
  • You require quick, CLI-driven analysis without heavy tooling (e.g., SonarQube, PHPStan).
  • CI/CD integration is needed for simple size/complexity checks (e.g., "Reject PRs adding >200 LOC to a single file").
  • You’re evaluating technical debt and need to justify refactoring efforts with data.
  • Onboarding new engineers requires objective codebase documentation (e.g., "This module is 40% of the project’s LOC").

Avoid When:

  • You need advanced static analysis (e.g., security vulnerabilities, code smells, type safety).
  • Your stack includes non-Laravel PHP (e.g., Symfony, WordPress) or mixed-language projects.
  • You already use enterprise tools (SonarQube, CodeClimate) that provide deeper insights.
  • Performance is critical: This is a post-deployment analysis tool, not a runtime optimizer.
  • You require historical trend analysis beyond a single project snapshot (consider integrating with a database).

How to Pitch It (Stakeholders)

For Executives:

*"This is a no-cost, low-effort way to quantify our codebase health and reduce technical debt. By tracking metrics like lines of code and cyclomatic complexity, we can:

  • Proactively identify bloated modules before they become unmaintainable.
  • Justify refactoring investments with hard data (e.g., ‘This module costs 20% more to maintain’).
  • Accelerate onboarding by giving new hires objective insights into the codebase structure. It integrates seamlessly into our existing Laravel workflow—no new infrastructure needed—and delivers immediate ROI by reducing fire drills from technical debt."*

For Engineering Teams:

*"This gives you instant visibility into your codebase with a single command:

  • Spot hotspots: See which classes/methods are growing uncontrollably.
  • Enforce standards: Block PRs that violate size/complexity thresholds.
  • CI-friendly: Runs in seconds and integrates with GitHub Actions, GitLab CI, etc. No setup—just php artisan phploc and start making data-driven decisions. Perfect for teams that want actionable insights without the overhead of heavy tools."*

For Developers:

*"Tired of guessing which parts of the codebase are a mess? This tool automates the busywork:

  • Run phploc after a big feature to see your impact.
  • Compare metrics before/after refactoring to measure improvement.
  • Get objective answers to ‘Why is this module so slow?’ (e.g., ‘It has 3x the method calls’). It’s like a codebase X-ray—no fluff, just the numbers you need to write cleaner code."*
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata