Skip to content

Tune remediation points #42

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 2 commits into from
Dec 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions config/cops.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
Metrics/AbcSize:
violation_points: 100_000
base_points: 1_000_000
violation_points: 70_000
Metrics/BlockNesting:
base_points: 30_000
base_points: 100_000
Metrics/ClassLength:
base_points: 400_000
Metrics/CyclomaticComplexity:
base_points: 75_000
violation_points: 10_000
base_points: 5_000_000
violation_points: 35_000
Metrics/CyclomaticComplexity: # This check is per method
base_points: 1_000_000
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this effectively mean that any instance of Cyclomatic complexity makes a file a "B"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2,000,000 remediation points are needed in penalties to go from A to B.

So not always, but a lot of the time an instance of Cyclomatic Complexity could have that large of grade impact.

I was talking with @brynary yesterday and had the impression that that level of grade impact would be close to what we want for complexity - but maybe requires some additional discussion?

violation_points: 70_000
Metrics/LineLength:
base_points: 20_000
violation_points: 5_000
Metrics/MethodLength:
base_points: 50_000
violation_points: 10_000
Metrics/MethodLength:
base_points: 1_000_000
violation_points: 70_000
Metrics/ModuleLength:
base_points: 500_000
violation_points: 5_000
base_points: 5_000_000
violation_points: 35_000
Metrics/ParameterList:
base_points: 10_000
violation_points: 50_000
base_points: 500_000
violation_points: 100_000
Metrics/PerceivedComplexity:
base_points: 50_000
violation_points: 5000
base_points: 1_000_000
violation_points: 70_000
2 changes: 1 addition & 1 deletion spec/cc/engine/rubocop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def includes_check?(output, cop_name)
def includes_content_for?(output, cop_name)
issue = issues(output).detect { |i| i["check_name"] =~ /#{cop_name}$/ }

issue["content"]["body"].present?
issue["content"] && issue["content"]["body"].present?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change isn't related, but came up when running tests. Happy to remove for cleaner diff if preferred.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with this drive-by, but I'd make it its own commit if you can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted. Moved to separate commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still only see one commit on this branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhh sorry.
Fixed. Then made additional changed and squashed everything again. My bad. Updating.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks for the catch.

end

def issues(output)
Expand Down