PHPackages                             developer-samuel/php-codestats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. developer-samuel/php-codestats

ActiveLibrary[CLI &amp; Console](/categories/cli)

developer-samuel/php-codestats
==============================

A high-performance, strictly typed CLI tool for fast source code volume metrics (files, lines, and characters).

1.1.0(3mo ago)16MITPHPPHP ^8.2CI passing

Since Mar 11Pushed 3mo agoCompare

[ Source](https://github.com/Developer-Samuel/php-codestats)[ Packagist](https://packagist.org/packages/developer-samuel/php-codestats)[ RSS](/packages/developer-samuel-php-codestats/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

📊 PHP Code Stats
================

[](#-php-code-stats)

Command-line tool for analyzing source code metrics: files, lines, and characters.

---

Installation
------------

[](#installation)

Install as a development dependency via Composer:

```
composer require --dev developer-samuel/php-codestats
```

Configuration
-------------

[](#configuration)

A configuration file codestats-analyzer.xml is required in the project root. It defines:

- file\_extensions - file types to include.
- ignored\_dirs - directories to skip.

You can bootstrap it automatically from the library:

```
php -r "require 'vendor/autoload.php'; DeveloperSamuel\PhpCodeStats\Installer::copyConfig();"
```

Or copy it manually from vendor/developer-samuel/php-codestats/config/analyzer.xml to your project root.

Example **codestats-analyzer.xml**

```

        php
        js
        css

        bin
        vendor
        node_modules
        public

```

Usage
-----

[](#usage)

Three commands are available:

```
# Count stats
php vendor/bin/count-stats

# Count files
php vendor/bin/count-files

# Count lines
php vendor/bin/count-lines

# Count characters
php vendor/bin/count-chars
```

Commands automatically use the codestats-analyzer.xml in your project root.

Notes
-----

[](#notes)

- The config file can be **edited** to add/remove extensions or ignored directories.
- Using `php -r "Installer::copyConfig();"` is enough to bootstrap the default config. No need to write manually unless you want custom changes.
- Ideal for integrating into CI/CD or dev workflow to monitor project metrics.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance81

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/456ce6c8ea37bc616b198eb6fccb8067a840ea768a41d848e85c8dcf28483db4?d=identicon)[Developer-Samuel](/maintainers/Developer-Samuel)

---

Top Contributors

[![Developer-Samuel](https://avatars.githubusercontent.com/u/56800212?v=4)](https://github.com/Developer-Samuel "Developer-Samuel (4 commits)")

###  Code Quality

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/developer-samuel-php-codestats/health.svg)

```
[![Health](https://phpackages.com/badges/developer-samuel-php-codestats/health.svg)](https://phpackages.com/packages/developer-samuel-php-codestats)
```

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
