Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Static Analysis & Code Quality
  3. phploc

phploc

BSD-3-ClausePHP

A command-line tool for quickly measuring the size and complexity of PHP projects.

GitHubGitHub
2.3k stars163 forks0 contributors

What is phploc?

PHPLOC is a command-line tool that analyzes PHP projects to measure their size, complexity, and structure. It provides statistics like lines of code, comment density, cyclomatic complexity, and class/method counts, helping developers assess codebase health and maintainability.

Target Audience

PHP developers, team leads, and architects who need to evaluate project scale, track technical debt, or enforce code quality standards in PHP applications.

Value Proposition

PHPLOC offers a fast, dependency-light way to gather essential code metrics without complex setup. Its focus on core size and complexity metrics makes it a straightforward alternative to heavier static analysis tools.

Overview

A tool for quickly measuring the size of a PHP project.

Use Cases

Best For

  • Generating size metrics for PHP project documentation
  • Tracking codebase growth and complexity over time
  • Quickly assessing maintainability of legacy PHP code
  • Integrating basic code analysis into CI/CD pipelines
  • Comparing size and structure across multiple PHP projects
  • Identifying overly complex methods via cyclomatic complexity

Not Ideal For

  • Projects requiring active maintenance and security updates
  • Teams needing in-depth static analysis like bug detection or coding standards enforcement
  • Developers wanting graphical dashboards or real-time feedback in IDEs
  • Organizations integrating with comprehensive quality platforms for advanced metrics

Pros & Cons

Pros

Lightweight Speed

Runs quickly with minimal dependencies via PHAR or Phive, as highlighted in the README for fast analysis.

Clear Tabular Output

Presents metrics in a structured, readable format ideal for reports or CI pipelines, shown in the usage example.

Simple Installation

Easy setup through PHAR downloads or Phive, avoiding complex configuration, as recommended in the installation section.

Focused Metrics

Provides essential size and complexity data like LOC and cyclomatic complexity without bloat, aligning with its philosophy.

Cons

Abandoned Project

The README explicitly states it's no longer maintained, risking compatibility issues and lack of support for newer PHP versions.

Limited Analysis Depth

Only covers basic metrics like size and complexity, missing advanced features such as security scanning or code style checks.

Command-Line Only

Lacks GUI or interactive features, making it less suitable for teams preferring visual dashboards or real-time insights.

Frequently Asked Questions

Quick Stats

Stars2,347
Forks163
Contributors0
Open Issues0
Last commit1 year ago
CreatedSince 2009

Tags

#maintainability#cli-tool#code-quality#php#complexity#code-analysis#static-analysis#metrics

Built With

P
PHP

Included in

Static Analysis & Code Quality14.5k
Auto-fetched 1 day ago

Related Projects

PHP ParserPHP Parser

A PHP parser written in PHP

Stars17,440
Forks1,121
Last commit3 months ago
TypeScript ESLintTypeScript ESLint

:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

Stars16,266
Forks2,918
Last commit1 day ago
pyrightpyright

Static Type Checker for Python

Stars15,472
Forks1,787
Last commit2 days ago
ReviewdogReviewdog

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

Stars9,345
Forks489
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub