Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Raise default remediation, categorize checks #19

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 7, 2015
Merged

Conversation

pbrisbin
Copy link
Contributor

@pbrisbin pbrisbin commented Dec 7, 2015

Default remediation was at an abysmal 500, upped it to the "trivial" baseline
for now and built a small class allowing us to easily override later.

Categorized checks loosely based on the CSSLint wiki[1]. The most obvious
departure was categorizing Performance rules as Bug Risk checks.

I chose keyword arguments in CheckDetails so we can easily create an override
object for one, the other, or both of categories and remediation points.

1: https://github.com/CSSLint/csslint/wiki/Rules

/cc @codeclimate/review

Categorize checks loosely based on the CSSLint wiki[1]. The most obvious
departure was categorizing Performance rules as Bug Risk checks.

1: https://github.com/CSSLint/csslint/wiki/Rules

Default remediation was at an abysmal 500, upped it to the "trivial"
baseline for now and built a small class allowing us to easily override
these later.

I chose keyword arguments in the CheckDetails class so we can easily
create an override object for one, the other, or both of categories and
remediation points.
@pbrisbin pbrisbin changed the title Raise default remediation, categories checks Raise default remediation, categorize checks Dec 7, 2015
@pbrisbin
Copy link
Contributor Author

pbrisbin commented Dec 7, 2015

Ignoring CC issues.

  • 1 too-many lines due to the big hash
  • Another too-many lines is an existing method


def self.all
@all ||= {
"net.csslint.Adjoiningclasses" => new(categories: "Compatability"),
Copy link
Contributor

Choose a reason for hiding this comment

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

should these go in a constant? Maybe of the format

"net.csslint.Adjoiningclasses" =>  { categories: "Compatability", }

and then in fetch below you can do

new(all.fetch(check_name, {}))

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, great suggestion.

@gdiggs
Copy link
Contributor

gdiggs commented Dec 7, 2015

LGTM

module Engine
class CSSlint
# https://github.com/CSSLint/csslint/wiki/Rules
class CheckDetails

Choose a reason for hiding this comment

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

It seems like the major function of this class at present is to get the category for an issue.

What do you think about having a category class instead, and have it initialize with a check?

Then, in the CSSLint or an Issue class, we can have

def categories
  Category.new(check_name)
end

def remediation_points
   DEFAULT_REMEDIATION_POINTS
end

pbrisbin added a commit that referenced this pull request Dec 7, 2015
Raise default remediation, categorize checks
@pbrisbin pbrisbin merged commit a265a16 into master Dec 7, 2015
@pbrisbin pbrisbin deleted the pb-categories branch December 7, 2015 22:44
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.

3 participants