"description":"Method `new_array` has 12 arguments (exceeds 4 allowed). Consider refactoring.",
"fingerprint":"15cdb5c53afd42bc22f8ca366a08d547",
"location":{
"path":"foo.rb",
"lines":{
"begin":10,
"end":10
}
},
"other_locations":[],
"remediation_points":900000,
"severity":"major",
"type":"issue",
"engine_name":"structure"
}.with_indifferent_access
end
let(:degradation_2)do
{
"type":"Issue",
"check_name":"Rubocop/Metrics/ParameterLists",
"description":"Avoid parameter lists longer than 5 parameters. [12/5]",
"categories":[
"Complexity"
],
"remediation_points":550000,
"location":{
"path":"foo.rb",
"positions":{
"begin":{
"column":14,
"line":10
},
"end":{
"column":39,
"line":10
}
}
},
"content":{
"body":"This cop checks for methods with too many parameters.\nThe maximum number of parameters is configurable.\nKeyword arguments can optionally be excluded from the total count."
"description":"Method `new_array` has 12 arguments (exceeds 4 allowed). Consider refactoring.",
"fingerprint":"15cdb5c53afd42bc22f8ca366a08d547",
"location":{
"path":"foo.rb",
"lines":{
"begin":10,
"end":10
}
},
"other_locations":[],
"remediation_points":900000,
"severity":"major",
"type":"issue",
"engine_name":"structure"
}.with_indifferent_access
end
let(:degradation_2)do
{
"type":"Issue",
"check_name":"Rubocop/Metrics/ParameterLists",
"description":"Avoid parameter lists longer than 5 parameters. [12/5]",
"categories":[
"Complexity"
],
"remediation_points":550000,
"location":{
"path":"foo.rb",
"positions":{
"begin":{
"column":14,
"line":10
},
"end":{
"column":39,
"line":10
}
}
},
"content":{
"body":"This cop checks for methods with too many parameters.\nThe maximum number of parameters is configurable.\nKeyword arguments can optionally be excluded from the total count."
expect(subject[:description]).toeq("Method `new_array` has 12 arguments (exceeds 4 allowed). Consider refactoring.")
expect(subject[:severity]).toeq("major")
expect(subject[:file_path]).toeq("foo.rb")
expect(subject[:file_path]).toeq("file_a.rb")
expect(subject[:line]).toeq(10)
end
end
context'when line is included in positions'do
let(:codequality_degradation)do
{
"type":"Issue",
"check_name":"Rubocop/Metrics/ParameterLists",
"description":"Avoid parameter lists longer than 5 parameters. [12/5]",
"categories":[
"Complexity"
],
"remediation_points":550000,
"location":{
"path":"foo.rb",
"positions":{
"begin":{
"column":24,
"line":14
},
"end":{
"column":49,
"line":14
}
}
},
"content":{
"body":"This cop checks for methods with too many parameters.\nThe maximum number of parameters is configurable.\nKeyword arguments can optionally be excluded from the total count."
"description":"Method `new_array` has 12 arguments (exceeds 4 allowed). Consider refactoring.",
"fingerprint":"15cdb5c53afd42bc22f8ca366a08d547",
"location":{
"path":"foo.rb",
"lines":{
"begin":10,
"end":10
}
},
"other_locations":[],
"remediation_points":900000,
"severity":"major",
"type":"issue",
"engine_name":"structure"
}.with_indifferent_access
end
let(:degradation_2)do
{
"type":"Issue",
"check_name":"Rubocop/Metrics/ParameterLists",
"description":"Avoid parameter lists longer than 5 parameters. [12/5]",
"categories":[
"Complexity"
],
"remediation_points":550000,
"location":{
"path":"foo.rb",
"positions":{
"begin":{
"column":14,
"line":10
},
"end":{
"column":39,
"line":10
}
}
},
"content":{
"body":"This cop checks for methods with too many parameters.\nThe maximum number of parameters is configurable.\nKeyword arguments can optionally be excluded from the total count."
"description":"Method `new_array` has 12 arguments (exceeds 4 allowed). Consider refactoring.",
"fingerprint":"15cdb5c53afd42bc22f8ca366a08d547",
"location":{
"path":"foo.rb",
"lines":{
"begin":10,
"end":10
}
},
"other_locations":[],
"remediation_points":900000,
"severity":"major",
"type":"issue",
"engine_name":"structure"
}.with_indifferent_access
end
let(:degradation_2)do
{
"type":"Issue",
"check_name":"Rubocop/Metrics/ParameterLists",
"description":"Avoid parameter lists longer than 5 parameters. [12/5]",
"categories":[
"Complexity"
],
"remediation_points":550000,
"location":{
"path":"foo.rb",
"positions":{
"begin":{
"column":14,
"line":10
},
"end":{
"column":39,
"line":10
}
}
},
"content":{
"body":"This cop checks for methods with too many parameters.\nThe maximum number of parameters is configurable.\nKeyword arguments can optionally be excluded from the total count."