EasyRecon/Hunt3r

View on GitHub

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?
Severity: Minor
Found in backend/app/controllers/admin/tools_controller.rb - About 25 mins to fix

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
Severity: Minor
Found in frontend/src/app/admin/bugbountySettings/bugbountySettings.component.ts - About 25 mins to fix

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}"
Severity: Minor
Found in backend/lib/platforms/yeswehack.rb - About 25 mins to fix

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']
Severity: Minor
Found in backend/lib/platforms/hackerone.rb - About 25 mins to fix

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)
Severity: Minor
Found in backend/lib/platforms/intigriti.rb - About 25 mins to fix

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

Severity
Category
Status
Source
Language