Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Teknikode dbd8c07348 Initial Commit of Teknik Source 6 years ago
..
build Initial Commit of Teknik Source 6 years ago
composer/bin Initial Commit of Teknik Source 6 years ago
src Initial Commit of Teknik Source 6 years ago
tests Initial Commit of Teknik Source 6 years ago
.gitattributes Initial Commit of Teknik Source 6 years ago
.gitignore Initial Commit of Teknik Source 6 years ago
.travis.yml Initial Commit of Teknik Source 6 years ago
LICENSE Initial Commit of Teknik Source 6 years ago
README.md Initial Commit of Teknik Source 6 years ago
build.xml Initial Commit of Teknik Source 6 years ago
composer.json Initial Commit of Teknik Source 6 years ago
phploc.bat Initial Commit of Teknik Source 6 years ago
phploc.php Initial Commit of Teknik Source 6 years ago

README.md

Latest Stable Version Build Status

PHPLOC

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

Installation

PHP Archive (PHAR)

The easiest way to obtain PHPLOC is to download a PHP Archive (PHAR) that has all required dependencies of PHPLOC bundled in a single file:

wget https://phar.phpunit.de/phploc.phar
chmod +x phploc.phar
mv phploc.phar /usr/local/bin/phploc

You can also immediately use the PHAR after you have downloaded it, of course:

wget https://phar.phpunit.de/phploc.phar
php phploc.phar

Composer

Simply add a dependency on phploc/phploc to your project’s composer.json file if you use Composer to manage the dependencies of your project. Here is a minimal example of a composer.json file that just defines a development-time dependency on PHPLOC:

{
    "require-dev": {
        "phploc/phploc": "*"
    }
}

For a standalone, system-wide installation via Composer, a composer.json similar to the one shown below can be used from an arbitary directory:

{
    "require": {
        "phploc/phploc": "*"
    },
    "config": {
        "bin-dir": "/usr/local/bin/"
    }
}

PEAR Installer

The following two commands (which you may have to run as root) are all that is required to install PHPLOC using the PEAR Installer:

pear config-set auto_discover 1
pear install pear.phpunit.de/phploc

Usage Examples

Analyse a directory and print the result

➜ ~ phploc /usr/local/src/phpunit/PHPUnit
phploc 2.0.1 by Sebastian Bergmann.

Directories                                         17
Files                                              121

Size
  Lines of Code (LOC)                            29047
  Comment Lines of Code (CLOC)                   14022 (48.27%)
  Non-Comment Lines of Code (NCLOC)              15025 (51.73%)
  Logical Lines of Code (LLOC)                    3484 (11.99%)
    Classes                                       3314 (95.12%)
      Average Class Length                          29
      Average Method Length                          4
    Functions                                      153 (4.39%)
      Average Function Length                        1
    Not in classes or functions                     17 (0.49%)

Complexity
  Cyclomatic Complexity / LLOC                    0.51
  Cyclomatic Complexity / Number of Methods       3.37

Dependencies
  Global Accesses                                   43
    Global Constants                                 1 (2.33%)
    Global Variables                                34 (79.07%)
    Super-Global Variables                           8 (18.60%)
  Attribute Accesses                              1122
    Non-Static                                    1054 (93.94%)
    Static                                          68 (6.06%)
  Method Calls                                    1503
    Non-Static                                     976 (64.94%)
    Static                                         527 (35.06%)

Structure
  Namespaces                                         0
  Interfaces                                         6
  Traits                                             0
  Classes                                          113
    Abstract Classes                                 9 (7.96%)
    Concrete Classes                               104 (92.04%)
  Methods                                          750
    Scope
      Non-Static Methods                           507 (67.60%)
      Static Methods                               243 (32.40%)
    Visibility
      Public Method                                526 (70.13%)
      Non-Public Methods                           224 (29.87%)
  Functions                                        143
    Named Functions                                138 (96.50%)
    Anonymous Functions                              5 (3.50%)
  Constants                                         36
    Global Constants                                 2 (5.56%)
    Class Constants                                 34 (94.44%)

Analyse a directory for each revision in a Git repository and write the result in CSV format

➜ ~ phploc --log-csv log.csv --progress --git-repository . src
phploc 2.0.0-BETA1-11-g188c14e by Sebastian Bergmann.

 295/295 [============================] 100%