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

Switch statement metrics #1541

Closed
jrfnl opened this issue Jul 3, 2017 · 3 comments · May be fixed by PHPCSStandards/PHP_CodeSniffer#33
Closed

Switch statement metrics #1541

jrfnl opened this issue Jul 3, 2017 · 3 comments · May be fixed by PHPCSStandards/PHP_CodeSniffer#33

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Jul 3, 2017

While analysing something for the WordPress Core CS project, I needed metrics on various bits of switch statements and realized that the most applicable sniff PSR2.ControlStructures.SwitchDeclaration does not record any metrics.

For my purposes, I've added these now locally, but I was wondering if there is any interest in (partially) adding these anyhow so they will be accessible for all analysed projects through https://squizlabs.github.io/PHP_CodeSniffer/analysis/

If so, I'd be happy to send in a PR based on the code I've already created.

@gsherwood
Copy link
Member

Yes, I'd accept new metrics for a sniff. I have to manually add them to the analysis repo and regen all past metrics, so new metrics wont break what I have there.

@jrfnl
Copy link
Contributor Author

jrfnl commented Jul 3, 2017

@gsherwood Thanks for your response. I'll tidy up & create a PR for this. I'm going to presume it will only go into the 3.x branch ? (which in this case would be fine as far as WPCS is concerned).

@gsherwood
Copy link
Member

I'm going to presume it will only go into the 3.x branch

Yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants