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

Generic/CyclomaticComplexity: add metrics #745

Open
1 of 2 tasks
jrfnl opened this issue Nov 27, 2024 · 0 comments
Open
1 of 2 tasks

Generic/CyclomaticComplexity: add metrics #745

jrfnl opened this issue Nov 27, 2024 · 0 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented Nov 27, 2024

Is your feature request related to a problem?

PHPCS can provide statistics about a code base via the --report=info feature.

This information is recorded by sniffs via the File::recordMetric() method.

I believe it could be interesting for code base owners already using PHPCS to have a straight forward way to get insight into the cyclomatic complexity across their codebase.

Describe the solution you'd like

For the sniff to start recording metrics, probably grouped in a few "steps", possibly along the lines of those mentioned in this comment (+ some more for very high complexity).

Maybe a grouping like this ?

  • 1-5 (low risk)
  • 6-10 (normal risk)
  • 11-20 (moderate risk)
  • 21-50 (high risk)
  • 51-100 (very high risk)
  • 101-500 (very high risk)
  • 501-1000 (very high risk)
  • 1001-5000 (very high risk)
  • 5001-10000 (very high risk)
  • 10000+ (very high risk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant