Skip to content

Parsing fails for some files #18

@dereuromark

Description

@dereuromark

Wanted to try it out, but

Found 99 files. Starting analysis.
 10/99 [==>-------------------------]  10%PHP Fatal error:  Uncaught TypeError: Cannot access offset of type PhpParser\Node\Expr\Variable in isset or empty in /data/work/app/vendor/phauthentic/cognitive-code-analysis/src/PhpParser/CognitiveMetricsVisitor.php:214
Stack trace:
#0 /data/work/app/vendor/phauthentic/cognitive-code-analysis/src/PhpParser/CognitiveMetricsVisitor.php(197): Phauthentic\CognitiveCodeAnalysis\PhpParser\CognitiveMetricsVisitor->trackVariable()
#1 /data/work/app/vendor/phauthentic/cognitive-code-analysis/src/PhpParser/CognitiveMetricsVisitor.php(189): Phauthentic\CognitiveCodeAnalysis\PhpParser\CognitiveMetricsVisitor->gatherMetrics()
#2 /data/work/app/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): Phauthentic\CognitiveCodeAnalysis\PhpParser\CognitiveMetricsVisitor->enterNode()

also, I had to use

vendor/bin/phpcca analyse src/Controller/

as bin/phpcca isnt available via composer require directly

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions