Beautiful and understandable static analysis tool for PHP

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 <folder-to-analyze>

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

Configure

Use the --config=<file>.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)
A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

Felix Becker 1.1k Jan 4, 2023
The SensioLabs DeprecationDetector runs a static code analysis against your project's source code to find usages of deprecated methods, classes and interfaces

SensioLabs DeprecationDetector CAUTION: This package is abandoned and will no longer receive any updates. The SensioLabs DeprecationDetector runs a st

QOSSMIC GmbH 389 Nov 24, 2022
WooCommerce function and class declaration stubs for static analysis.

WooCommerce Stubs This package provides stub declarations for WooCommerce functions, classes and interfaces. These stubs can help plugin and theme dev

PHP Stubs Library 54 Dec 27, 2022
Docker image that provides static analysis tools for PHP

Static Analysis Tools for PHP Docker image providing static analysis tools for PHP. The list of available tools and the installer are actually managed

Jakub Zalas 1.1k Jan 1, 2023
Attributes to define PHP language extensions (to be enforced by static analysis)

PHP Language Extensions (currently in BETA) This library provides attributes for extending the PHP language (e.g. adding package visibility). The inte

Dave Liddament 70 Dec 19, 2022
Perform static analysis of Drupal PHP code with phpstan-drupal.

Perform static analysis of Drupal PHP code with PHPStan and PHPStan-Drupal on Drupal using PHP 8. For example: docker run --rm \ -v $(pwd)/example01

Dcycle 0 Dec 10, 2021
Dockerise Symfony Application (Symfony 6 + Clean Architecture+ DDD+ CQRS + Docker + Xdebug + PHPUnit + Doctrine ORM + JWT Auth + Static analysis)

Symfony Dockerise Symfony Application Install Docker Install Docker Compose Docker PHP & Nginx Create Symfony Application Debugging Install Xdebug Con

null 48 Jan 5, 2023
PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

null 464 Dec 28, 2022
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

⚗️ About Larastan Larastan was created by Can Vural and Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural, Nuno Maduro, and Vik

Nuno Maduro 4.4k Jan 4, 2023
This project is a microcosm of a system for booking doses, booking analysis, and consulting a doctor

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Abdelrahman Badawy 2 Dec 25, 2022
the examples of head first object oriented analysis & design - in PHP

Head First object oriented analysis & design in (PHP) after cloning the repository, you have to install the project's dependancies by running the foll

Muhammed ElFeqy 3 Oct 16, 2021
An extension for PHPStan for adding analysis for PHP Language Extensions.

PHPStan PHP Language Extensions (currently in BETA) This is an extension for PHPStan for adding analysis for PHP Language Extensions. Language feature

Dave Liddament 9 Nov 30, 2022
Extension for PHPStan to allow analysis of Drupal code.

phpstan-drupal Extension for PHPStan to allow analysis of Drupal code. Sponsors Would you like to sponsor? Usage When you are using phpstan/extension-

Matt Glaman 154 Jan 2, 2023
Realtime BirdNET powered soundscape analysis for bird song identification.

BirdNET-stream Realtime BirdNET powered soundscape analysis for bird song identification. Introduction BirdNET-stream records sound 24/7 on any Linux

Samuel Ortion 9 Dec 26, 2022
A beautiful, fully open-source, tunneling service - written in pure PHP

Expose A completely open-source ngrok alternative - written in pure PHP. Documentation For installation instructions, in-depth usage and deployment de

Beyond Code 3.9k Jan 7, 2023
Simple WHOIS script with beautiful design.

Simple PHP Whois It is ideal in terms of design and has easy operation. / Tasarım açısından idealdir ve kullanımı kolaydır. It has a simple interface.

Raiven 1 Jul 16, 2022
Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use.

Shiki is a beautiful syntax highlighter powered by the same language engine that many code editors use. This package allows you to use Shiki from PHP.

Spatie 229 Jan 4, 2023
🖍 Write beautiful blog articles using Markdown inside your Laravel app.

Blogged Write beautiful blog articles using Markdown inside your Laravel app. Blogged ?? Blogged is a carefully designed Laravel package provides an e

Saleem Hadad 131 Dec 16, 2022
Simple, beautiful, open source publishing.

Simple, beautiful publishing. Website Documentation Created by Cory LaViska Maintained by Marc Apfelbaum Requirements PHP 7.1+ with curl, gd lib, mbst

Leafpub 646 Dec 21, 2022