PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report.

Overview

PhpMetrics

License Build Status Latest Stable Version Slack

Standard report

PhpMetrics

PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report.

Documentation | Twitter | Contributing



Quick start

composer require phpmetrics/phpmetrics --dev
php ./vendor/bin/phpmetrics --report-html=myreport 
   

   

Then open the generated ./myreport/index.html file in your browser.

Configure

Use the --config= .json option. For example:

{
    "includes": [   // directory and files to analyze, relative to config file directory 
        "src"
    ],
    "exclude": [    // regex of files (or directory) to exclude from analyze
      "tests"
    ],
    "report": {     // list of reports to generate (html, json, csv or violation)
        "html": "/tmp/report/",             // destination directory of HTML report 
        "csv": "/tmp/report.csv",           // destination file for CSV report
        "json": "/tmp/report.json",         // destination file for JSON report
        "violations": "/tmp/violations.xml" // destination file for XML violations report
    },
    "groups": [     // "layers" of code. You can group your classes and packages by regex, 
                    // to visualise specific HTML report for each of them
        {
            "name": "Component",      // name of the layer
            "match": "!component!i"   // regular expression used to match the group (based on 
                                      // the name of the fully qualified class name)
                                      // remember to double escape (for json, then for regex): 
                                      // set "!\\\\MyPackage\\\\!" if you want to capture  
                                      // expression "\MyPackage\"
        },
        {
            "name": "Example",
            "match": "!example!"
        }
    ],
    "plugins": {
        "git": {
            "binary": "git"           // if defined, runs git analyze
        },
        "junit": {
            "file": "/tmp/junit.xml"  // if defined, JUnit report file will be analyzed            
        }
    },
    "extensions": [ "php", "php8" ]   // default: ["php", "inc"]
}

More

If want, you can install PhpMetrics globally with your favorite package manager (APT, Brew...). You can also visit our documentation.

Metrics list

See the metrics file.

Author

License

See the LICENSE file.

Contributing

See the CONTRIBUTING file.

Comments
  • v2 of PhpMetrics: roadmap and ideas

    v2 of PhpMetrics: roadmap and ideas

    Hi !

    Edit: this issue has been translated by C-Duv here.

    Please note that [you'll find the associated PR here](https://github.com/phpmetrics/PhpMetrics/issues/220#issuecomment-217040620(https://github.com/phpmetrics/PhpMetrics/pull/221)


    PhpMetrics fonctionne bien et est aujourd'hui stable, grâce au travail de tous les contributeurs. Je crois avoir à peu près respecté la vision initiale : offrir un moyen simple et ludique de disposer de métriques sur son code source.

    Cependant, il y a un défaut de conception majeur. A l'origine, j'ai conçu cet outil comme une "preuve de concept" (poc), et mon unité de base était le fichier.

    J'ai ajouté un certain nombre d'analyseurs de code (Halstead, McCabe...), mais à chaque fois en prenant comme réferentiel le fichier. Puis est apparu le besoin de travailler sur des objets PHP. Que faire ? J'ai procédé à une rustine : le parsage du code objet est un analyseur comme un autre, bien qu'il soit utilisé à peu près partout.

    Il en résulte des lourdeurs (performande) et des incohérences de conception.

    Par ailleurs, l'utilisation de la fonction token_get_all() a posé de nombreux problèmes : de performance, de RAM, mais aussi de cohérence. PHP manque de logique dans la nomenclature des tokens.

    Par exemple, en PHP, un if est représenté par le token T_IF, alors qu'une expression ternaire par le token T_STRING (le même qui sera utilisé pour les accolades { et } par exemple). Ce qui nous oblige à jongler en permanence avec des conditions pour tester la valeur du token avec le lequel on travaille...

    Je souhaite inverser les postulats et repartir de zéro. Aujourd'hui, je connais mieux le besoin en terme de métriques, aussi j'ai refondu le code en posants les principes suivants:

    • le code objet est l'unité de base. La première étape consiste à parser le code
    • le parsage du code ne dépend plus de la fonction token_get_all() ni d'aucune fonction native
    • le code est représenté sous forme d'arbre
    • les composants de calcul de métrique travaillent au choix sur
      • un arbre
      • un noeud de l'arbre
      • une classe
      • (rarement) un fichier
    • le projet réduit ses dépendances externes

    Par ailleurs, les rapports CLI (tableaux immenses affichés dans le terminal) ne semblent que très peu utilisés. Au contraire, le rapport HTML semble être l'outil de base. une refonte serait donc l'occasion de faire le tri dans les types de rapports d'analyse.

    Le passage à une représentation en graph permet aussi d'ajouter de nouvelles métriques, aujourd'hui très difficiles à obtenir: NPath complexity, Hauteur de l'arbre moyen, représentation en arbre, diagramme UML...

    Enfin, j'ai réellement honte du diagramme "Evaluation", qui est sensé fournir une idée générale de l'état du projet. J'en ai honte car il n'est ni fiable ni cohérent. J'ai posé des mini-formules à-la-va-vite ; il en résulte quelque chose de fondamentalement inutile et contre-productif.

    C'est pourquoi je propose aujourd'hui une v2.

    J'aimerai avoir vos retours sur ces idées.

    Pour cela, j'ai volontairement exclu tout code applicatif (le code actuel ne contient que les analyseurs et les composants) : j'aimerai d'abord recevoir des idées de chacun, pour améliorer l'ergonomie de l'outil et le rendre encore plus utile.

    Si vous avez des idées, des choses à améliorer / changer dans les rapports, des métriques qui vous manque... n'hésitez donc pas à en faire part ici.

    Merci à tous de votre aide !

    question 
    opened by Halleck45 25
  • svg graphs broken in v1.8.3

    svg graphs broken in v1.8.3

    installed latest version. ran phpmetrics from the command line overcame memory limit problem from #188 by doubling memory to 1024M. Chrome reports javascript errors. Ditto in Firefox and Safari phpmetrics_report_-_by_jean-francois_lepine

    line 1618 begins

    d3=function(){function n(n)
    
    bug 
    opened by pavarnos 22
  • Allowed memory size of XXX bytes exhausted

    Allowed memory size of XXX bytes exhausted

    Get some memory size error when scan code. I try it with different memory_limit.

    Allowed memory size of 268435456 bytes exhausted (tried to allocate 528384 bytes) in phar:///usr/local/bin/phpmetrics/src/Hal/Component/Token/TokenCollection.php on line 118

    Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in phar:///usr/local/bin/phpmetrics/src/Hal/Component/Token/TokenCollectionCompatibility.php on line 56

    Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in phar:///usr/local/bin/phpmetrics/src/Hal/Component/Token/TokenCollectionCompatibility.php on line 34

    Want suggest add option to ignore files by size --max-size

    bug 
    opened by infectormp 20
  • Enable use as a Composer dependency

    Enable use as a Composer dependency

    Currently, when including the project via Composer as a dependency, it isn't possible to run it: including the Composer autoloader from bin/metrics.php fails, since it is assumed that the project is a root-level project, with its own vendor directory.

    To solve that, the following changes would be necessary:

    • Tell Composer to move the metrics.php to the Composer vendor/bin dir (optionally, losing the .php extension)
    • Rewrite the Composer autoloader inclusion in metrics.php so it would work when the project is included as a dependency

    If you'd like, I could try creating a pull request for this.

    waiting 
    opened by anroots 18
  • [Enhancement] Better Relations Map

    [Enhancement] Better Relations Map

    Hi It seems like relations map becomes useless(hard to understand) on projects with a large number of classes. screen shot 2016-02-20 at 4 03 31 am I guess there is a better representation of such data, like a draggable directed graph or something else. So, if it seems interesting and people feels discomfort with relations map(like me), then i could provide a PR with suggestions.

    enhancement legacy-v1 
    opened by YuraLukashik 12
  • Updated pmd priority levels

    Updated pmd priority levels

    PMD uses values 1 to 5 for assigning priority, 1 being the most urgent task and 5 least urgent.

    1 - Change absolutely required. Behavior is critically broken/buggy. 2 - Change highly recommended. Behavior is quite likely to be broken/buggy. 3 - Change recommended. Behavior is confusing, perhaps buggy, and/or against standards/best practices. 4 - Change optional. Behavior is not likely to be buggy, but more just flies in the face of standards/style/good taste. 5 - Change highly optional. Nice to have, such as a consistent naming policy for package/class/fields...

    See http://pmd.sourceforge.net/pmd-5.0.5/rule-guidelines.html

    I think that changing the values here will have no other effect on the application, but will result in a correct pmd file.

    enhancement 
    opened by krukru 11
  • Mark old composer packages as abandoned

    Mark old composer packages as abandoned

    Regarding to #198 and #189 user do not get the current version of phpmetrics because the packages halleck45/phpmetrics and halleck45/php-metrics are still at version v1.8.3 (both packages reference to https://github.com/Halleck45/PhpMetrics.git).

    Instead of changing the repository of both packages we may consider to abandon the packages.

    See composer/composer#3325 for an example how the error message would look.

    bug quality 
    opened by UFOMelkor 11
  • Update of nikic/php-parser dependency

    Update of nikic/php-parser dependency

    Any upgrade plans of this dependency?

    Seems like next versions eg. psalm is using 4.x branch of that library, so basically I need to decide which one I'm going to keep.

    Another solution would be phpmetrics-shim , which would only contain necessary .phar file

    What do you think?

    opened by tarlepp 10
  • PhpMetrics v2.0.0 Fatal error on analyze folder (catchable error)

    PhpMetrics v2.0.0 Fatal error on analyze folder (catchable error)

    My test environment:

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux unstable (sid)
    Release:    unstable
    Codename:   sid
    
    $ php --version
    PHP 7.0.8-3 (cli) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.8-3, Copyright (c) 1999-2016, by Zend Technologies
        with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
    
    $ ../PhpMetrics/bin/phpmetrics --version
    PhpMetrics v2.0.0 <http://phpmetrics.org>
    by Jean-François Lépine <https://twitter.com/Halleck45>
    
    $ ../PhpMetrics/bin/phpmetrics --report-html=build/metrics ./src
     27/34 [======================>-----]  79% 2 secsPHP Catchable fatal error:  Object of class PhpParser\Node\Expr\PropertyFetch could not be converted to string in PhpMetrics/src/functions.php on line 84
    PHP Stack trace:
    PHP   1. {main}() PhpMetrics/bin/phpmetrics:0
    PHP   2. Hal\Application\Application->run() PhpMetrics/bin/phpmetrics:6
    PHP   3. Hal\Application\Analyze->run() PhpMetrics/src/Hal/Application/Application.php:56
    PHP   4. PhpParser\NodeTraverser->traverse() PhpMetrics/src/Hal/Application/Analyze.php:86
    PHP   5. PhpParser\NodeTraverser->traverseArray() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:64
    PHP   6. PhpParser\NodeTraverser->traverseNode() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:135
    PHP   7. PhpParser\NodeTraverser->traverseArray() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:84
    PHP   8. Hal\Metric\Class_\Structural\LcomVisitor->leaveNode() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:139
    PHP   9. iterate_over_node() PhpMetrics/src/Hal/Metric/Class_/Structural/LcomVisitor.php:81
    PHP  10. PhpParser\NodeTraverser->traverse() PhpMetrics/src/functions.php:39
    PHP  11. PhpParser\NodeTraverser->traverseArray() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:64
    PHP  12. PhpParser\NodeTraverser->traverseNode() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:135
    PHP  13. PhpParser\NodeTraverser->traverseArray() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:84
    PHP  14. PhpParser\NodeTraverser->traverseNode() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:135
    PHP  15. PhpParser\NodeTraverser->traverseArray() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:84
    PHP  16. PhpParser\NodeTraverser->traverseNode() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:135
    PHP  17. MyVisitor->leaveNode() PhpMetrics/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php:101
    PHP  18. Hal\Metric\Class_\Structural\LcomVisitor->Hal\Metric\Class_\Structural\{closure}() PhpMetrics/src/functions.php:26
    PHP  19. getNameOfNode() PhpMetrics/src/Hal/Metric/Class_/Structural/LcomVisitor.php:56
    
    bug Cannot reproduce 
    opened by clagiordano 10
  • PhpMetrics v2.0.0 warnings on analyze folder

    PhpMetrics v2.0.0 warnings on analyze folder

    /usr/local/bin/phpmetrics --version
    PhpMetrics v2.0.0 <http://phpmetrics.org>
    by Jean-François Lépine <https://twitter.com/Halleck45>
    

    using this command:

    /usr/local/bin/phpmetrics --report-html=build/metrics ./src/
    

    text output seems to be correct but it returns same repetitive warning, i think, on output html report:

    PHP Warning:  array_push() expects parameter 1 to be array, float given in phar:///usr/local/bin/phpmetrics/src/Hal/Metric/Consolidated.php on line 95
    PHP Stack trace:
    PHP   1. {main}() /usr/local/bin/phpmetrics:0
    PHP   2. Hal\Application\Application->run() /usr/local/bin/phpmetrics:16
    PHP   3. Hal\Report\Html\Reporter->generate() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Application.php:67
    PHP   4. Hal\Metric\Consolidated->__construct() phar:///usr/local/bin/phpmetrics/src/Hal/Report/Html/Reporter.php:44
    PHP   5. array_push() phar:///usr/local/bin/phpmetrics/src/Hal/Metric/Consolidated.php:95
    

    and

    PHP Warning:  array_push() expects parameter 1 to be array, float given in phar:///usr/local/bin/phpmetrics/src/Hal/Metric/Consolidated.php on line 95
    PHP Stack trace:
    PHP   1. {main}() /usr/local/bin/phpmetrics:0
    PHP   2. Hal\Application\Application->run() /usr/local/bin/phpmetrics:16
    PHP   3. Hal\Report\Html\Reporter->generate() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Application.php:67
    PHP   4. Hal\Metric\Consolidated->__construct() phar:///usr/local/bin/phpmetrics/src/Hal/Report/Html/Reporter.php:44
    PHP   5. array_push() phar:///usr/local/bin/phpmetrics/src/Hal/Metric/Consolidated.php:95
    PHP Warning:  array_sum() expects parameter 1 to be array, float given in phar:///usr/local/bin/phpmetrics/src/Hal/Metric/Consolidated.php on line 103
    

    thanks for your work!

    bug 
    opened by clagiordano 10
  • PHP Parse error with phpmetrics.phar v1.10.0

    PHP Parse error with phpmetrics.phar v1.10.0

    Hi,

    I've installed PhpMetrics version v1.10.0 as phar archive, with PHP 5.4.24 (cli) on Windows 10

    When I run this command:

    php phpmetrics.phar folder
    

    I get this output:

    PHPMetrics by Jean-Fran├ºois L├®pine <https://twitter.com/Halleck45>
    
    PHP Parse error:  syntax error, unexpected 'list' (T_LIST) in phar://phpmetrics.phar/vendor/symfony/config/Definition/ArrayNode.php on line 335
    
    Parse error: syntax error, unexpected 'list' (T_LIST) in phar://phpmetrics.phar/vendor/symfony/config/Definition/ArrayNode.php on line 335
    
    bug 
    opened by adrien-thierry 9
  • Add a CCN value to every method in a class

    Add a CCN value to every method in a class

    I've found your package very useful. I want to thank you for the great package.

    During the usage, I realized that there is a thing which I really miss in this package. The possibility to see the Cyclomatic complexity of the most complex method in a class is useful, but I really wanted to see the complexity of every method in a class. So, my proposition is to add this possibility, which I think is quite useful. For now it looks like this.

    image

    opened by kudashevs 3
  • Show error if yaml_parse function does not exists

    Show error if yaml_parse function does not exists

    Feature request

    Problem: I tried to run phpmetrcis with --config option:

    php ./vendor/bin/phpmetrics --config=phpmetrics.yaml
    

    And command finished without any error and not generated report.

    The problem was because my PHP version (8.1) doesn't have yaml_parse function. Class Hal\Application\Config\File\ConfigFileReaderYaml::read() throw RuntimeException:

    if (!function_exists('yaml_parse')) {
        throw new \RuntimeException('YAML parser not found. Please install the PECL extension "yaml".');
    }
    

    My proposition: Make changes in the src/Hal/Application/Application.php from this:

    // config
    $config = (new Parser())->parse($argv);
    

    to this

    // config
    try{
        $config = (new Parser())->parse($argv);
    } catch (\Throwable $exception) {
        $output->writeln($exception->getMessage());
        exit(0);
    }
    
    opened by lutdev 0
  • Xdebug has detected a possible infinite loop,

    Xdebug has detected a possible infinite loop,

    Bug report

    PhpMetrics v2.7.4

    ...PHP Fatal error: Uncaught Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '3000' frames in /third_party/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php:28

    third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(110): PhpParser\Node\Expr\BinaryOp->getSubNodeNames()
    third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    /third_party/phpmetrics/phpmetrics/src/Hal/Component/Ast/Php7NodeTraverser.php(25): PhpParser\NodeTraverser->traverseNode()
    /third_party/nikic/php-parser/lib/PhpParser/NodeTraverser.php(146): Hal\Component\Ast\Php7NodeTraverser->traverseNode()
    
    opened by olleharstedt 3
  • [Bug] Trying to scan an excluded folder

    [Bug] Trying to scan an excluded folder

    Bug report

     php ./vendor/bin/phpmetrics --config=.phpmetrics.json      
    
    Executing system analyzes...
    
    Executing composer analyzes, requesting https://packagist.org...
    Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(./docker/volumes/data-test): Failed to open directory: Permission denied in /var/www/vendor/phpmetrics/phpmetrics/src/Hal/Component/File/Finder.php:88
    Stack trace:
    #0 [internal function]: RecursiveDirectoryIterator->__construct('./docker/volume...', 0)
    #1 [internal function]: RecursiveDirectoryIterator->getChildren()
    #2 /var/www/vendor/phpmetrics/phpmetrics/src/Hal/Component/File/Finder.php(88): FilterIterator->next()
    #3 /var/www/vendor/phpmetrics/phpmetrics/src/Hal/Metric/System/Packages/Composer/Composer.php(76): Hal\Component\File\Finder->fetch(Array)
    #4 /var/www/vendor/phpmetrics/phpmetrics/src/Hal/Metric/System/Packages/Composer/Composer.php(39): Hal\Metric\System\Packages\Composer\Composer->getComposerJsonRequirements()
    #5 /var/www/vendor/phpmetrics/phpmetrics/src/Hal/Application/Analyze.php(144): Hal\Metric\System\Packages\Composer\Composer->calculate(Object(Hal\Metric\Metrics))
    #6 /var/www/vendor/phpmetrics/phpmetrics/src/Hal/Application/Application.php(57): Hal\Application\Analyze->run(Array)
    #7 /var/www/vendor/phpmetrics/phpmetrics/bin/phpmetrics(27): Hal\Application\Application->run(Array)
    #8 {main}
      thrown in /var/www/vendor/phpmetrics/phpmetrics/src/Hal/Component/File/Finder.php on line 88
    

    My config

    {
      "includes": [
        "app"
      ],
      "exclude": [
        "tests",
        "vendor",
        "docker"
      ],
      "report": {
        "html": "./tmp/php-metrics/report/",
        "csv": "./tmp/php-metrics/report.csv",
        "json": "./tmp/php-metrics/report.json",
        "violations": "./tmp/php-metrics/violations.xml"
      }
    }
    

    "docker" folder has access restrictions and added to config exclude. Despite this, the script tries to scan this folder.

    If you run the script from another folder, for example from vendor, then there is no such problem. It looks like at startup there is a search for something without checking permission.

    opened by stolentine 0
Releases(v2.8.1)
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Nov 27, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Apr 20, 2021
Learn how to implement the most important Design Patterns into your PHP application, uses PHP 8.1

Learn how to implement the most important Design Patterns into your PHP application. This project uses PHP 8.1. it has examples for each Pattern and an Article explaining how to use them step by step, their advantages, and disadvantages.

Gabriel Anhaia 201 Dec 4, 2022
Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API

Luracast Restler ![Gitter](https://badges.gitter.im/Join Chat.svg) Version 3.0 Release Candidate 5 Restler is a simple and effective multi-format Web

Luracast 1.4k Nov 20, 2022
Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)

phpDox phpDox is a documentation generator for PHP projects. This includes, but is not limited to, API documentation. The main focus is on enriching t

Arne Blankerts 589 Nov 11, 2022
phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to generate a complete set of API Documentation

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Dec 1, 2022
Documentation Generator for PHP

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Nov 29, 2022
A php API documentation generator, fork of Sami

Doctum, a PHP API documentation generator. Fork of Sami Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documenta

Code LTS 199 Dec 5, 2022
Industrial-strength annotations for PHP

php-annotations Source-code annotations for PHP. Copyright (C) 2011-2015 Rasmus Schultz [email protected] https://github.com/php-annotations/php-anno

php-annotations 139 Nov 13, 2022
A PHP framework foucs on API fast development.接口,从简单开始!PhalApi简称π框架,一个轻量级PHP开源接口框架,专注于接口服务开发。

PhalApi开源接口框架 / PhalApi API Framework 读音:派框架 Stargazers over time 开发文档 / Documents 专为PHPer准备的优雅而详细的开发文档,请看:PhalApi 2.x 开发文档。 PhalApi 2.x English Docs.

dogstar 1.5k Dec 4, 2022
30 seconds of code Short PHP code snippets for all your development needs

30 seconds of code Short PHP code snippets for all your development needs Visit our website to view our snippet collection. Use the Search page to fin

30 seconds of code 2.5k Nov 29, 2022
Source Code for 'PHP 8 Solutions' by David Powers

Apress Source Code This repository accompanies PHP 8 Solutions by David Powers (Apress, 2022). Download the files as a zip using the green button, or

Apress 8 Oct 27, 2022
PHP Developer Roadmap

This is PHP Developer Roadmap

TheCodeholic 2.2k Dec 5, 2022
allourideas allows groups to collect and priorize information in an open, democratic, and efficient process.

All Our Ideas All Our Ideas 2.0. This codebase runs two sites photocracy.org and allourideas.org. The allourideas.org project provides the user-facing

All Our Ideas 153 Sep 13, 2022
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io - Deprecation Notice This repository is deprecated! Daux.io has been moved to an organization, to guarantee future development and support. So

Justin Walsh 4.6k Nov 20, 2022
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io Daux.io is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It help

Daux.io 719 Nov 29, 2022
Next generation phpDoc parser with support for intersection types and generics.

PHPDoc-Parser for PHPStan PHPStan Next generation phpDoc parser with support for intersection types and generics. Code of Conduct This project adheres

PHPStan 890 Nov 27, 2022
Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in.

Metrics Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics API that doesn't cau

Benjamin Eberlei 311 Nov 20, 2022
Relational Metrics - lararvel package help you to make your metrics easier

Relational Metrics This package will help you to make your metrics easier, You could get metrics about your Models, Models depending on their relation

Syrian Open Source 25 Oct 12, 2022
The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

Mark Armendariz 0 Jan 7, 2022