-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversation
- 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
cc @pbrisbin |
|
||
private | ||
|
||
def overage(mass) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, sounds good.
LGTM |
Tune Python Remediation Points
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