PHPackages                             cmgmyr/phploc - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cmgmyr/phploc

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cmgmyr/phploc
=============

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

8.0.7(1mo ago)267.5M↓38.5%63BSD-3-ClausePHPPHP ^7.4 || ^8.0CI passing

Since Nov 9Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/cmgmyr/phploc)[ Packagist](https://packagist.org/packages/cmgmyr/phploc)[ Docs](https://github.com/cmgmyr/phploc)[ GitHub Sponsors](https://github.com/cmgmyr)[ RSS](/packages/cmgmyr-phploc/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (8)Dependencies (10)Versions (39)Used By (3)

PHPLOC
======

[](#phploc)

`phploc` is a tool for quickly measuring the size and analyzing the structure of a PHP project.

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

[](#installation)

```
$ composer global install cmgmyr/phploc
```

Usage Examples
--------------

[](#usage-examples)

### Analyse a directory and print the result

[](#analyse-a-directory-and-print-the-result)

```
$ phploc src
phploc 8.0.6 by Chris Gmyr.

Directories                                          3
Files                                               10

Size
  Lines of Code (LOC)                             1882
  Comment Lines of Code (CLOC)                     255 (13.55%)
  Non-Comment Lines of Code (NCLOC)               1627 (86.45%)
  Logical Lines of Code (LLOC)                     377 (20.03%)
    Classes                                        351 (93.10%)
      Average Class Length                          35
        Minimum Class Length                         0
        Maximum Class Length                       172
      Average Method Length                          2
        Minimum Method Length                        1
        Maximum Method Length                      117
    Functions                                        0 (0.00%)
      Average Function Length                        0
    Not in classes or functions                     26 (6.90%)

Cyclomatic Complexity
  Average Complexity per LLOC                     0.49
  Average Complexity per Class                   19.60
    Minimum Class Complexity                      1.00
    Maximum Class Complexity                    139.00
  Average Complexity per Method                   2.43
    Minimum Method Complexity                     1.00
    Maximum Method Complexity                    96.00

Dependencies
  Global Accesses                                    0
    Global Constants                                 0 (0.00%)
    Global Variables                                 0 (0.00%)
    Super-Global Variables                           0 (0.00%)
  Attribute Accesses                                85
    Non-Static                                      85 (100.00%)
    Static                                           0 (0.00%)
  Method Calls                                     280
    Non-Static                                     276 (98.57%)
    Static                                           4 (1.43%)

Structure
  Namespaces                                         3
  Interfaces                                         1
  Traits                                             0
  Classes                                            9
    Abstract Classes                                 0 (0.00%)
    Concrete Classes                                 9 (100.00%)
  Methods                                          130
    Scope
      Non-Static Methods                           130 (100.00%)
      Static Methods                                 0 (0.00%)
    Visibility
      Public Methods                               103 (79.23%)
      Non-Public Methods                            27 (20.77%)
  Functions                                          0
    Named Functions                                  0 (0.00%)
    Anonymous Functions                              0 (0.00%)
  Constants                                          0
    Global Constants                                 0 (0.00%)
    Class Constants                                  0 (0.00%)

```

###  Health Score

68

—

FairBetter than 99% of packages

Maintenance91

Actively maintained with recent releases

Popularity55

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 82.6% 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 ~133 days

Recently: every ~255 days

Total

38

Last Release

43d ago

Major Versions

3.0.x-dev → 4.0.02017-06-06

4.0.1 → 5.0.02019-03-16

5.0.0 → 6.0.02020-02-20

6.0.2 → 7.0.02020-08-13

7.0.2 → 8.0.02023-02-23

PHP version history (9 changes)1.7.3PHP &gt;=5.3.3

2.1.0PHP &gt;=5.4

3.0.0PHP &gt;=5.6

4.0.0PHP ^5.6 || ^7.0

5.0.0PHP ^7.2

6.0.0PHP ^7.3

7.0.2PHP &gt;=7.3

8.0.0PHP ^8.1

8.0.1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d987f3caa2f921deded28dc8cf4a6f8ecb6cd6acf79ebd5f7d6191835ba7f1a?d=identicon)[cmgmyr](/maintainers/cmgmyr)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (538 commits)")[![cmgmyr](https://avatars.githubusercontent.com/u/4693481?v=4)](https://github.com/cmgmyr "cmgmyr (29 commits)")[![kubawerlos](https://avatars.githubusercontent.com/u/9282069?v=4)](https://github.com/kubawerlos "kubawerlos (21 commits)")[![matthiasnoback](https://avatars.githubusercontent.com/u/1193078?v=4)](https://github.com/matthiasnoback "matthiasnoback (7 commits)")[![krzysiekpiasecki](https://avatars.githubusercontent.com/u/4520629?v=4)](https://github.com/krzysiekpiasecki "krzysiekpiasecki (6 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (5 commits)")[![ReenExe](https://avatars.githubusercontent.com/u/10358615?v=4)](https://github.com/ReenExe "ReenExe (4 commits)")[![tommygnr](https://avatars.githubusercontent.com/u/929392?v=4)](https://github.com/tommygnr "tommygnr (4 commits)")[![Sgoettschkes](https://avatars.githubusercontent.com/u/628796?v=4)](https://github.com/Sgoettschkes "Sgoettschkes (3 commits)")[![reinholdfuereder](https://avatars.githubusercontent.com/u/145182?v=4)](https://github.com/reinholdfuereder "reinholdfuereder (3 commits)")[![christeredvartsen](https://avatars.githubusercontent.com/u/25402?v=4)](https://github.com/christeredvartsen "christeredvartsen (2 commits)")[![dennisdegreef](https://avatars.githubusercontent.com/u/361905?v=4)](https://github.com/dennisdegreef "dennisdegreef (2 commits)")[![derrabus](https://avatars.githubusercontent.com/u/1506493?v=4)](https://github.com/derrabus "derrabus (2 commits)")[![edorian](https://avatars.githubusercontent.com/u/247397?v=4)](https://github.com/edorian "edorian (2 commits)")[![ihabunek](https://avatars.githubusercontent.com/u/482138?v=4)](https://github.com/ihabunek "ihabunek (2 commits)")[![ircmaxell](https://avatars.githubusercontent.com/u/660654?v=4)](https://github.com/ircmaxell "ircmaxell (2 commits)")[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (2 commits)")[![ramonornela](https://avatars.githubusercontent.com/u/187946?v=4)](https://github.com/ramonornela "ramonornela (2 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (2 commits)")[![Stelian](https://avatars.githubusercontent.com/u/195211?v=4)](https://github.com/Stelian "Stelian (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cmgmyr-phploc/health.svg)

```
[![Health](https://phpackages.com/badges/cmgmyr-phploc/health.svg)](https://phpackages.com/packages/cmgmyr-phploc)
```

###  Alternatives

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k955.1M155.2k](/packages/phpunit-phpunit)[brianium/paratest

Parallel testing for PHP

2.5k136.1M986](/packages/brianium-paratest)[phpunit/phpcov

CLI frontend for php-code-coverage

24122.8M673](/packages/phpunit-phpcov)[systemsdk/phpcpd

Copy/Paste Detector for PHP code

11101.2k13](/packages/systemsdk-phpcpd)

PHPackages © 2026

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