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

Allow running phpmd separately #31

Merged
merged 1 commit into from
Mar 13, 2015
Merged

Allow running phpmd separately #31

merged 1 commit into from
Mar 13, 2015

Conversation

thiemowmde
Copy link
Contributor

I played around with PHPMD and am a bit disappointed. It's not possible to set a number like "this rule is allowed to be broken x times in the legacy code base, but report any new exception".

  • Added composer md composer phpcs and composer phpmd commands.
  • composer cs does not execute PHPMD any more, but composer ci still does.
  • Re-enabled all rules with limits that are exactly as high as the current code is (see Re-enable disabled PHPMD rules #36).
  • Re-wrote one method because of the unused variables rule (reverted).

}

return false;
return (bool)array_filter( array_keys( $array ), 'is_string' );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you got an associative array with a thousand elements, it'll now do a thousand iterations instead of one? Decreasing the quality of the code just to match a fault CS rule is the opposite of what these tools intend you to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Daniel would say something about premature optimization at this point. I even micro-benchmarked this. It's fine.

Not that you get me wrong: I'm perfectly fine with reverting this to the foreach loop.

@thiemowmde thiemowmde changed the title Re-enable disabled PHPMD rules Allow running phpmd separately Feb 23, 2015
JeroenDeDauw added a commit that referenced this pull request Mar 13, 2015
Allow running phpmd separately
@JeroenDeDauw JeroenDeDauw merged commit 17f34c5 into master Mar 13, 2015
@JeroenDeDauw JeroenDeDauw deleted the mdLimits branch March 13, 2015 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants