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

Lines Of Code Laravel Package

sebastian/lines-of-code

Count lines of code in PHP source with sebastian/lines-of-code. A lightweight library for analyzing PHP files and reporting LOC metrics, useful for tooling, CI checks, and development workflows. Install easily via Composer as a runtime or dev dependency.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Codebase Scaling Metrics: Quantify PHP codebase growth to justify hiring, tooling investments, or architectural decisions (e.g., "Team X needs 3 more devs to maintain this 200K LOC monolith").
  • Technical Debt Prioritization: Identify high-LOC modules for refactoring by comparing growth to functionality (e.g., "This 5K LOC service does 1 thing—consolidate it").
  • CI/CD Enforcement: Automate LOC limits in PRs (e.g., "No PR may exceed 500 new LOC") to maintain velocity and reduce churn.
  • Open-Source Contribution Validation: Measure PR impact objectively (e.g., "This feature adds 1.2K LOC to the core—is it worth the maintenance cost?").
  • Developer Onboarding: Set transparent benchmarks (e.g., "New hires must contribute 500+ LOC/week") and track progress.
  • Cost Optimization: Replace manual code review efforts with automated LOC checks for compliance (e.g., open-source license audits).
  • Architecture Decisions: Evaluate microservice boundaries by comparing LOC density (e.g., "Service A has 3x the LOC of Service B—should we split it?").

When to Consider This Package

Adopt When:

  • Your PHP codebase exceeds 50K LOC and requires scalable metrics for maintenance.
  • You need CI/CD integration to enforce LOC thresholds (e.g., GitHub Actions, GitLab CI).
  • Your team lacks standardized ways to measure technical debt or codebase health.
  • You’re evaluating open-source contributions and need to quantify impact (e.g., "This PR adds 200 LOC to the core").
  • PHP 8.4+ is your minimum supported version (or you’re willing to upgrade for this feature).
  • You prioritize lightweight, dependency-free solutions over proprietary tools.

Look Elsewhere If:

  • Your PHP version is < 8.4 (conflicts with Laravel’s PHP 8.3 support; requires framework-specific workarounds).
  • You need language-agnostic LOC counting (e.g., for multi-language repos—consider cloc or tokei).
  • Your priority is cyclomatic complexity or other static analysis (use phpstan/extension-installer or phpmetrics).
  • You require real-time IDE integration (this is CLI/script-focused).
  • Your codebase is <10K LOC and manual tracking is sufficient.
  • You’re using Laravel < 10.x (PHP 8.3+ required for compatibility).

How to Pitch It (Stakeholders)

For Executives/Engineering Leaders

*"This open-source tool gives us data-driven control over codebase growth—critical for scaling our engineering team without sacrificing quality. By integrating LOC metrics into our CI pipeline, we can:

  • Automatically block PRs that violate size limits (e.g., ‘no PR may exceed 500 new LOC’), reducing technical debt.
  • Track trends in codebase expansion to justify hiring, tooling investments, or architectural refactors.
  • Align developers with measurable goals (e.g., ‘new features must not exceed 10% LOC growth’). It’s a zero-maintenance solution—no proprietary licenses, just a Composer install and a few lines of PHP. Competitors like proprietary tools cost $10K+/year; this is free, battle-tested, and integrates seamlessly with Laravel."*

For Engineering Teams

*"This package lets us stop guessing about codebase health. We can:

  • Enforce size limits in CI (e.g., fail builds if a module grows >20% in a sprint).
  • Identify bloated modules for refactoring by comparing LOC to functionality.
  • Standardize metrics for onboarding, mentorship, and performance reviews. It’s PHP-native, so no translation layers—just drop it into a script or test. Works great with our existing tooling like PHPStan or PHPMD for deeper analysis. No fluff, no config—just reliable metrics for your workflow."*

For Developers

*"Tired of manually counting lines of code in PRs? Or want to automate LOC checks in your CI? This tool gives you:

  • Accurate, logical LOC counts (ignores comments/blank lines).
  • Easy integration—just composer require sebastian/lines-of-code and call Counter::count().
  • Flexibility to track files, directories, or even specific patterns (e.g., ‘only count src/’). No setup, no dependencies—just reliable metrics for your workflow. Perfect for: ✅ PR reviews (e.g., ‘This adds 300 LOC—is it worth it?’) ✅ CI checks (e.g., ‘Fail if LOC > 500’) ✅ Local scripts (e.g., php artisan loc:count --dir=src)"

For Product Managers

*"This tool helps us balance speed and quality by:

  • Catching bloat early (e.g., ‘This feature is 2x larger than expected’).
  • Justifying technical debt with data (e.g., ‘Module X is 10K LOC—let’s refactor’).
  • Aligning devs with business goals (e.g., ‘New features must not exceed 10% LOC growth’). It’s non-intrusive, low-cost, and actionable—no fluff, just metrics that drive decisions."*
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