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

Commit 32cfe66

Browse files
author
Will Fleming
committed
cc issues
1 parent fd1773d commit 32cfe66

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/cc/engine/csslint.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def run
2222
file.children.each do |node|
2323
next unless node.name == "error"
2424
issue =
25-
if node.attributes.has_key?("identifier")
25+
if node.attributes.key?("identifier")
2626
create_issue(node, path)
2727
else
2828
create_error(node, path)
@@ -35,6 +35,7 @@ def run
3535

3636
private
3737

38+
# rubocop:disable Metrics/MethodLength
3839
def create_issue(node, path)
3940
check_name = node.attributes.fetch("identifier").value
4041
check_details = CheckDetails.fetch(check_name)
@@ -62,11 +63,13 @@ def create_issue(node, path)
6263
rescue KeyError => ex
6364
raise MissingAttributesError, "#{ex.message} on XML '#{node}' when analyzing file '#{path}'"
6465
end
66+
# rubocop:enable Metrics/MethodLength
6567

68+
# rubocop:disable Metrics/MethodLength
6669
def create_error(node, path)
6770
{
6871
type: "issue",
69-
check_name: "parse_error",
72+
check_name: "parse-error",
7073
description: node.attributes.fetch("message").value,
7174
categories: ["Bug Risk"],
7275
remediation_points: 5_000,
@@ -87,6 +90,7 @@ def create_error(node, path)
8790
rescue KeyError => ex
8891
raise MissingAttributesError, "#{ex.message} on XML error '#{node}' when analyzing file '#{path}'"
8992
end
93+
# rubocop:enable Metrics/MethodLength
9094

9195
def results
9296
@results ||= Nokogiri::XML(csslint_xml)

0 commit comments

Comments
 (0)