vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.57k stars 660 forks source link

Undefined index: METRIC_STATUS #11163

Open MattMencel opened 1 day ago

MattMencel commented 1 day ago

Hi,

I have a large codebase, over 4000 files. I am unable to init or scan the entire codebase and have had to break the Psalm scans into two batches. When I try to init or scan everything at once it always crashes. Usually something like this.

This is with Psalm 5.26.1.

Here is an init attempt of my PHP directory.

$ vendor-composer/bin/psalm --init myphpdir
Calculating best config level based on project files
Target PHP version: X.X (inferred from composer.json).
Scanning files...
Analyzing files...

Uncaught Exception: RuntimeException PHP Error: Undefined index: METRIC_STATUS in /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:720 for command with CLI args "vendor-composer/bin/psalm --init myphpdir"

And If I create a psalm.xml with ./myphpdir in it and run psalm I get something like this....

$ vendor-composer/bin/psalm -c psalm.xml --debug

.....
Skipping analysis of pre-analyzed method Thread::setbatchid
                                checking foo/components/w/Autoloader.php
                                checking foo/components/data_destroyer/DataDestroyer.php
                              checking foo/components/Facades/ReportingPeriodFacade.php
                                checking foo/components/FiscalReportingPeriod/FiscalReportingPeriod.php
                                  checking foo/components/FiscalReportingPeriod/IPeriodManager.php
                                    checking foo/components/FiscalReportingPeriod/ReportingPeriod.php
                                  checking foo/components/FiscalReportingPeriod/CustomPeriodManager.php
                                    checking foo/components/FiscalReportingPeriod/BasePeriodManager.php
                                  checking foo/components/FiscalReportingPeriod/QuarterlyPeriodManager.php
                                    checking foo/components/FiscalReportingPeriod/MonthTypePeriodManager.php
                              checking foo/components/w/Autoloader.php
                              checking foo/util/GoalUtil.php
                            checking foo/components/api/ApiException.php
                            checking foo/components/objects/metricRelations/MetricRelationsCache.php
Uncaught RuntimeException: PHP Error: Undefined index: METRIC_STATUS in /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:720 for command with CLI args "vendor-composer/bin/psalm -c psalmtest.xml --debug" in /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/ErrorHandler.php:75
Stack trace:
#0 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php(720): Psalm\Internal\ErrorHandler::Psalm\Internal\{closure}(8, 'Undefined index...', '/Users/me...', 720, Array)
#1 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(580): Psalm\Internal\Analyzer\Statements\Expression\ClassConstAnalyzer::analyzeAssignment(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\ClassConst), Object(Psalm\Context))
#2 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\ClassConst), Object(Psalm\Context), Object(Psalm\Context))
#3 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/ClassAnalyzer.php(565): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), Object(Psalm\Context), true)
#4 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(201): Psalm\Internal\Analyzer\ClassAnalyzer->analyze(Object(Psalm\Context), Object(Psalm\Context))
#5 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#6 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#7 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#8 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#9 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#10 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#11 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#12 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#13 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#14 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#15 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#16 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#17 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#18 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#19 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#20 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#21 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#22 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#23 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#24 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#25 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#26 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#27 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#28 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#29 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#30 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#31 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#32 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#33 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#34 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#35 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#36 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#37 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#38 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#39 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#40 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#41 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#42 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#43 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#44 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#45 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#46 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#47 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#48 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#49 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#50 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#51 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#52 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#53 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#54 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#55 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#56 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#57 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#58 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#59 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#60 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#61 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#62 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#63 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#64 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#65 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#66 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#67 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#68 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#69 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#70 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#71 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#72 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#73 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#74 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#75 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#76 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#77 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php(202): Psalm\Internal\Analyzer\FileAnalyzer->analyze(Object(Psalm\Context), NULL)
#78 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(373): Psalm\Internal\Analyzer\Statements\Expression\IncludeAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), NULL)
#79 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php(91): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::handleExpression(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true, NULL, false)
#80 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(569): Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer::analyze(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Expr\Include_), Object(Psalm\Context), false, NULL, true)
#81 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/StatementsAnalyzer.php(197): Psalm\Internal\Analyzer\StatementsAnalyzer::analyzeStatement(Object(Psalm\Internal\Analyzer\StatementsAnalyzer), Object(PhpParser\Node\Stmt\Expression), Object(Psalm\Context), NULL)
#82 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/FileAnalyzer.php(177): Psalm\Internal\Analyzer\StatementsAnalyzer->analyze(Array, Object(Psalm\Context), NULL, true)
#83 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(1587): Psalm\Internal\Analyzer\FileAnalyzer->analyze()
#84 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(518): Psalm\Internal\Codebase\Analyzer->analysisWorker(364, '/Users/me...')
#85 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Codebase/Analyzer.php(272): Psalm\Internal\Codebase\Analyzer->doAnalysis(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1)
#86 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(542): Psalm\Internal\Codebase\Analyzer->analyzeFiles(Object(Psalm\Internal\Analyzer\ProjectAnalyzer), 1, false, true)
#87 /Users/me/myapp/vendor-composer/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(379): Psalm\Internal\Analyzer\ProjectAnalyzer->check('/Users/me...', true)
#88 /Users/me/myapp/vendor-composer/vimeo/psalm/psalm(8): Psalm\Internal\Cli\Psalm::run(Array)
#89 /Users/me/myapp/vendor-composer/bin/psalm(115): include('/Users/me...')
#90 {main}
(Psalm 5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0 crashed due to an uncaught Throwable)
MattMencel commented 1 day ago

Hey @MattMencel, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.

Not without uploading the entire codebase. 😁

I tried just the MetricRelationsCache.php file in psalm.dev, but it worked fine. I only get these crashes if I init or scan all 4000 files at once.