Method parse_scopes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_scopes(scopes, slug, platform)
program = Program.find_by(slug: slug)
scopes.each do |scope|
next unless scope['attributes']['eligible_for_submission']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method get_report_reward
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_report_reward(platform, report_id)
response = api_request(platform, "https://api.hackerone.com/v1/hackers/reports/#{report_id}")
return unless response.code == 200
report_activities = JSON.parse(response.body)['data']['relationships']['activities']['data']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_programs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_programs(programs, platform)
programs.each do |program|
next unless program['attributes']['submission_state'] == 'open'
slug = program['attributes']['handle']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"