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.6(1y ago)266.6M—4%43BSD-3-ClausePHPPHP ^7.4 || ^8.0CI failing

Since Nov 9Pushed 1y 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 1mo ago

READMEChangelog (7)Dependencies (5)Versions (38)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

56

—

FairBetter than 98% of packages

Maintenance46

Moderate activity, may be stable

Popularity54

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.3% 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 ~125 days

Recently: every ~185 days

Total

37

Last Release

415d 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 (25 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

[comcast/php-legal-licenses

A utility to generate a Licenses file containing the full license text for every dependency in your project for legal purposes.

821.1M9](/packages/comcast-php-legal-licenses)[xfra35/f3-cron

Job scheduling for the PHP Fat-Free Framework

73107.5k](/packages/xfra35-f3-cron)[bagusindrayana/laravel-coordinate

get nearby location from eloquent laravel

3019.7k](/packages/bagusindrayana-laravel-coordinate)

PHPackages © 2026

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