★ wanayoo — archive 1999 https://github.com/codeclimate/codeclimate-phpmd/issues/49Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception error: Call to a member function getPriority() on null #49

Open
efueger opened this issue Nov 11, 2019 · 0 comments
Open

Exception error: Call to a member function getPriority() on null #49

efueger opened this issue Nov 11, 2019 · 0 comments

Comments

@efueger
Copy link
Member

@efueger efueger commented Nov 11, 2019

Repo getting exception errors when DuplicatedArrayKey and MissingImport checks added.

Customer reports:

It seems that we have activated some checks, that were added to phpmd in version 2.7.0 (DuplicatedArrayKey and MissingImport). If I remove the two checks, everything seems to be working.

I have also tested with an older version (2.6.1) of phpmd against my local version (2.7.0) and with the older version I get the same error as I get on CodeClimate.


The errors don't fail the build, but produces logs like:

Exception: Call to a member function getPriority() on null in /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php
#0 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(288): PHPMD\RuleSetFactory->parseRuleReferenceNode(Object(PHPMD\RuleSet), Object(SimpleXMLElement))
#1 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(265): PHPMD\RuleSetFactory->parseRuleNode(Object(PHPMD\RuleSet), Object(SimpleXMLElement))
#2 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(141): PHPMD\RuleSetFactory->parseRuleSetNode('/code/./codesiz...')
#3 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(125): PHPMD\RuleSetFactory->createSingleRuleSet('/code/./codesiz...')
#4 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/PHPMD.php(217): PHPMD\RuleSetFactory->createRuleSets('/code/./codesiz...')
#5 /usr/src/app/Runner.php(116): PHPMD\PHPMD->processFiles('/code/artisan', '/code/./codesiz...', Array, Object(PHPMD\RuleSetFactory))
#6 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1852): CodeClimate\PHPMD\Runner->run(Array)
#7 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1772): fork_daemon->invoke_callback(Array, Array, false)
#8 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1673): fork_daemon->fork_work_unit(Array, '', -1)
#9 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1445): fork_daemon->process_work_unit(-1)
#10 /usr/src/app/Runner.php(31): fork_daemon->process_work(false)
#11 /usr/src/app/engine.php(35): CodeClimate\PHPMD\Runner->queueDirectory('/code')
#12 {main}Exception: Call to a member function getPriority() on null in /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php
#0 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(288): PHPMD\RuleSetFactory->parseRuleReferenceNode(Object(PHPMD\RuleSet), Object(SimpleXMLElement))
#1 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(265): PHPMD\RuleSetFactory->parseRuleNode(Object(PHPMD\RuleSet), Object(SimpleXMLElement))
#2 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(141): PHPMD\RuleSetFactory->parseRuleSetNode('/code/./codesiz...')
#3 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/RuleSetFactory.php(125): PHPMD\RuleSetFactory->createSingleRuleSet('/code/./codesiz...')
#4 /usr/src/app/vendor/phpmd/phpmd/src/main/php/PHPMD/PHPMD.php(217): PHPMD\RuleSetFactory->createRuleSets('/code/./codesiz...')
#5 /usr/src/app/Runner.php(116): PHPMD\PHPMD->processFiles('/code/app/Http/...', '/code/./codesiz...', Array, Object(PHPMD\RuleSetFactory))
#6 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1852): CodeClimate\PHPMD\Runner->run(Array)
#7 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1772): fork_daemon->invoke_callback(Array, Array, false)
#8 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1673): fork_daemon->fork_work_unit(Array, '', -1)
#9 /usr/src/app/vendor/barracudanetworks/forkdaemon-php/fork_daemon.php(1445): fork_daemon->process_work_unit(-1)
#10 /usr/src/app/Runner.php(31): fork_daemon->process_work(false)
#11 /usr/src/app/engine.php(35): CodeClimate\PHPMD\Runner->queueDirectory('/code')
#12 {main}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.