• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

build/H18-Nov-2017-7153

src/H18-Nov-2017-1,8921,367

tests/H18-Nov-2017-713535

.gitattributesH A D18-Nov-201715 21

.gitignoreH A D18-Nov-201779 87

.php_csH A D18-Nov-20172.9 KiB7975

.travis.ymlH A D18-Nov-2017844 3324

ChangeLog.mdH A D18-Nov-20171.1 KiB3218

LICENSEH A D18-Nov-20171.5 KiB3427

README.mdH A D18-Nov-20174.2 KiB10079

build.xmlH A D18-Nov-20174.5 KiB122103

composer.jsonH A D18-Nov-2017843 3635

phive.xmlH A D18-Nov-2017253 65

phplocH A D18-Nov-2017783 3219

phpunit.xmlH A D18-Nov-2017742 2119

README.md

1[![Latest Stable Version](https://img.shields.io/packagist/v/phploc/phploc.svg?style=flat-square)](https://packagist.org/packages/phploc/phploc)
2[![Build Status](https://img.shields.io/travis/sebastianbergmann/phploc/master.svg?style=flat-square)](https://travis-ci.org/sebastianbergmann/phploc)
3
4# PHPLOC
5
6`phploc` is a tool for quickly measuring the size and analyzing the structure of a PHP project.
7
8## Installation
9
10### PHP Archive (PHAR)
11
12The easiest way to obtain PHPLOC is to download a [PHP Archive (PHAR)](http://php.net/phar) that has all required dependencies of PHPLOC bundled in a single file:
13
14    $ wget https://phar.phpunit.de/phploc.phar
15    $ chmod +x phploc.phar
16    $ mv phploc.phar /usr/local/bin/phploc
17
18You can also immediately use the PHAR after you have downloaded it, of course:
19
20    $ wget https://phar.phpunit.de/phploc.phar
21    $ php phploc.phar
22
23### Composer
24
25You can add this tool as a local, per-project, development-time dependency to your project using [Composer](https://getcomposer.org/):
26
27    $ composer require --dev phploc/phploc
28
29You can then invoke it using the `vendor/bin/phploc` executable.
30
31## Usage Examples
32
33### Analyse a directory and print the result
34
35```
36$ phploc src
37phploc 4.0.0 by Sebastian Bergmann.
38
39Directories                                          3
40Files                                               10
41
42Size
43  Lines of Code (LOC)                             1882
44  Comment Lines of Code (CLOC)                     255 (13.55%)
45  Non-Comment Lines of Code (NCLOC)               1627 (86.45%)
46  Logical Lines of Code (LLOC)                     377 (20.03%)
47    Classes                                        351 (93.10%)
48      Average Class Length                          35
49        Minimum Class Length                         0
50        Maximum Class Length                       172
51      Average Method Length                          2
52        Minimum Method Length                        1
53        Maximum Method Length                      117
54    Functions                                        0 (0.00%)
55      Average Function Length                        0
56    Not in classes or functions                     26 (6.90%)
57
58Cyclomatic Complexity
59  Average Complexity per LLOC                     0.49
60  Average Complexity per Class                   19.60
61    Minimum Class Complexity                      1.00
62    Maximum Class Complexity                    139.00
63  Average Complexity per Method                   2.43
64    Minimum Method Complexity                     1.00
65    Maximum Method Complexity                    96.00
66
67Dependencies
68  Global Accesses                                    0
69    Global Constants                                 0 (0.00%)
70    Global Variables                                 0 (0.00%)
71    Super-Global Variables                           0 (0.00%)
72  Attribute Accesses                                85
73    Non-Static                                      85 (100.00%)
74    Static                                           0 (0.00%)
75  Method Calls                                     280
76    Non-Static                                     276 (98.57%)
77    Static                                           4 (1.43%)
78
79Structure
80  Namespaces                                         3
81  Interfaces                                         1
82  Traits                                             0
83  Classes                                            9
84    Abstract Classes                                 0 (0.00%)
85    Concrete Classes                                 9 (100.00%)
86  Methods                                          130
87    Scope
88      Non-Static Methods                           130 (100.00%)
89      Static Methods                                 0 (0.00%)
90    Visibility
91      Public Methods                               103 (79.23%)
92      Non-Public Methods                            27 (20.77%)
93  Functions                                          0
94    Named Functions                                  0 (0.00%)
95    Anonymous Functions                              0 (0.00%)
96  Constants                                          0
97    Global Constants                                 0 (0.00%)
98    Class Constants                                  0 (0.00%)
99```
100