Skip to content

Tune Python Remediation Points #86

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
Jan 27, 2016
Merged

Conversation

ABaldwinHunter
Copy link
Contributor

  • Reduce AST threshold from 40 to 32 (classic is 28)
  • update point formula to match classic computation

Change from
remediations_points = 1000 * mass
to
remediation_points = 1_000_000 + (mass - threshold) * 50_000

@codeclimate/review

Third starfish leg of https://github.com/codeclimate/codeclimate-duplication/pull/78/files

- Reduce AST threshold from 40 to 32 (classic is 28)
- update point formula to match classic computation

Change from
     remediations_points = 1000 * mass
to
     remediation_points = 1_000_000 + (mass - threshold)  * 50_000
@ABaldwinHunter
Copy link
Contributor Author

cc @pbrisbin


private

def overage(mass)
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about assigning a local overage variable directly in #mass, rather than the method call. Names are good, but extra indirection can be bad, and the fact that you have to thread the mass variable down to this private method is a point against IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean in #calculate_points?

That's fine by me...

I think it should be a separate refactor though.

So far, the ruby one uses the same format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good.

Copy link
Contributor

Choose a reason for hiding this comment

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

Something to fix later, not to hold up this PR...

Wait, why do these methods exist more than once? Can't they be shared on Base then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes +1

I guess the overage method could already by shared innocuously.

The calculate_points method hasn't been moved yet because 2 of the 4 languages use the old calculate_points formula (base * mass)

Copy link
Contributor

Choose a reason for hiding this comment

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

The calculate_points method hasn't been moved yet because 2 of the 4 languages use the old calculate_points formula (base * mass)

Is that intentional? Is the card you're working on fix "Duplication" or fix "Python"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ATM I'd say Fix python-duplication which is the child of Fix python.

We've been tackling grade tuning on a per-language basis, descending into the language's engines.

Not sure if that's the best approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, sounds good.

@pbrisbin
Copy link
Contributor

LGTM

ABaldwinHunter pushed a commit that referenced this pull request Jan 27, 2016
@ABaldwinHunter ABaldwinHunter merged commit 8a3234f into master Jan 27, 2016
@ABaldwinHunter ABaldwinHunter deleted the abh-python-points-algorithm branch January 27, 2016 22:22
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.

None yet

2 participants