@@ -22,7 +22,7 @@ def run
22
22
file . children . each do |node |
23
23
next unless node . name == "error"
24
24
issue =
25
- if node . attributes . has_key ?( "identifier" )
25
+ if node . attributes . key ?( "identifier" )
26
26
create_issue ( node , path )
27
27
else
28
28
create_error ( node , path )
@@ -35,6 +35,7 @@ def run
35
35
36
36
private
37
37
38
+ # rubocop:disable Metrics/MethodLength
38
39
def create_issue ( node , path )
39
40
check_name = node . attributes . fetch ( "identifier" ) . value
40
41
check_details = CheckDetails . fetch ( check_name )
@@ -62,11 +63,13 @@ def create_issue(node, path)
62
63
rescue KeyError => ex
63
64
raise MissingAttributesError , "#{ ex . message } on XML '#{ node } ' when analyzing file '#{ path } '"
64
65
end
66
+ # rubocop:enable Metrics/MethodLength
65
67
68
+ # rubocop:disable Metrics/MethodLength
66
69
def create_error ( node , path )
67
70
{
68
71
type : "issue" ,
69
- check_name : "parse_error " ,
72
+ check_name : "parse-error " ,
70
73
description : node . attributes . fetch ( "message" ) . value ,
71
74
categories : [ "Bug Risk" ] ,
72
75
remediation_points : 5_000 ,
@@ -87,6 +90,7 @@ def create_error(node, path)
87
90
rescue KeyError => ex
88
91
raise MissingAttributesError , "#{ ex . message } on XML error '#{ node } ' when analyzing file '#{ path } '"
89
92
end
93
+ # rubocop:enable Metrics/MethodLength
90
94
91
95
def results
92
96
@results ||= Nokogiri ::XML ( csslint_xml )
0 commit comments