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

PHP_CodeSniffer coding style error #11

Closed
peter279k opened this issue May 26, 2020 · 1 comment · Fixed by #29
Closed

PHP_CodeSniffer coding style error #11

peter279k opened this issue May 26, 2020 · 1 comment · Fixed by #29
Milestone

Comments

@peter279k
Copy link
Contributor

When I execute PHP_CodeSniffer via php vendor/bin/phpcs src/ --standard=./vendor/php-parallel-lint/php-code-style/ruleset.xml, the coding style is as follows:

phpcs:
     [exec] 
     [exec] FILE: ...d/open-source-contributions/PHP-Console-Highlighter/src/Highlighter.php
     [exec] --------------------------------------------------------------------------------
     [exec] FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
     [exec] --------------------------------------------------------------------------------
     [exec]  111 | ERROR | Function's cyclomatic complexity (28) exceeds allowed maximum of
     [exec]      |       | 20
     [exec] --------------------------------------------------------------------------------
     [exec] UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
     [exec] --------------------------------------------------------------------------------
     [exec] 
     [exec] Result: 1
@jrfnl
Copy link
Collaborator

jrfnl commented May 8, 2021

PR #20 downgraded this particular error to a warning and ensured that warnings will not fail the CI builds.

Additionally PR #19 improved the cyclomatic complexity a little by bringing it down from 28 to 24. Considering this is a switch-case with a lot of different token cases, I don't think this can be brought down further, other than by rewriting the code to use token lists with isset().

What do you think ? Is this issue addressed sufficiently by the above mentioned changes ?

@jrfnl jrfnl added this to the 1.0.0 milestone Dec 19, 2021
@grogy grogy closed this as completed in #29 Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants