Showing 45 of 138 total issues
Method create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
tool_data = params.require(:tool).permit(:name, infos: %i[config_value user api_key url webhook])
tool = Tool.find_by_name(tool_data[:name].downcase)
if tool.nil?
- 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
Function updateOrCreate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
updateOrCreate(event:any,platform:'yeswehack'|'hackerone'|'intigriti'){
this.loading=true
event.preventDefault()
let formName:'yeswehackForm'|'hackeroneForm'|'intigritiForm'=`${platform}Form`
let data = this[formName].value
- 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_reports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_reports(platform, collab, page_id = 1)
api_url = if collab
"https://api.yeswehack.com/collaborator/reports?page=#{page_id}"
else
"https://api.yeswehack.com/user/reports?page=#{page_id}"
- 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"
Further reading
Method report_infos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.report_infos(platform, program_id, report_id)
response = api_request(platform, "https://api.intigriti.com/core/researcher/program/#{program_id}/submission/#{report_id}")
return unless response&.code == 200
report_infos = JSON.parse(response.body)
- 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"