EasyRecon/Hunt3r

View on GitHub
backend/lib/platforms/intigriti.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method parse_payouts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def self.parse_payouts(payouts, from, to)
    payouts_data = {}

    payouts.each do |payout|
      next unless payout['createdAt'] > from && payout['createdAt'] < to
Severity: Minor
Found in backend/lib/platforms/intigriti.rb - About 45 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_scopes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def self.parse_scopes(scopes, slug, platform)
    program = Program.find_by(slug: slug)
    scopes.each do |scope|
      type = scope['type']
      next unless type == 1
Severity: Minor
Found in backend/lib/platforms/intigriti.rb - About 45 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

There are no issues that match your filters.

Category
Status