Skip to content

Refactor and optimize code #9

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

Merged
merged 1 commit into from
Oct 14, 2019
Merged

Refactor and optimize code #9

merged 1 commit into from
Oct 14, 2019

Conversation

nikoheikkila
Copy link
Contributor

Thanks for this useful script. I've been using it in a couple of projects. Here are some contributions which you might like to check:

  • Guard against empty data – I've encountered this in a new project where the total number of statements/methods/elements is zero thus PHP crashes on division by zero error
  • Refactor logic to functions and constants since there was moderate duplication
  • Make only-percentage option more canonical by prepending with two dashes (--only-percentage)
  • Add a couple more test cases

- Guard against empty data (division by zero)
- Refactor logic to functions and constants
- Make 'only-percentage' option more canonical by prepending with two dashes
- Update tests
Copy link
Owner

@richardregeer richardregeer left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution

@richardregeer richardregeer merged commit 9618fa7 into richardregeer:master Oct 14, 2019
@nikoheikkila nikoheikkila deleted the refactor branch October 14, 2019 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants