ronin-rb/ronin-web-spider

View on GitHub

Showing 7 of 7 total issues

Method every_javascript has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def every_javascript(&block)
          # yield inner text of every `<script type="text/javascript">` tag
          # and every `.js` URL.
          every_html_page do |page|
            next unless page.doc
Severity: Minor
Found in lib/ronin/web/spider/agent.rb - About 1 hr 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 every_javascript_string has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        def every_javascript_string(&block)
          every_javascript do |js,page|
            scanner = StringScanner.new(js)

            until scanner.eos?
Severity: Minor
Found in lib/ronin/web/spider/agent.rb - About 1 hr 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 every_html_comment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def every_html_comment(&block)
          every_html_page do |page|
            next unless page.doc

            page.doc.xpath('//comment()').each do |comment|
Severity: Minor
Found in lib/ronin/web/spider/agent.rb - About 55 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 every_javascript_absolute_path_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def every_javascript_absolute_path_string(&block)
          every_javascript_string do |string,page|
            if string =~ JAVASCRIPT_ABSOLUTE_PATH_REGEX
              if block.arity == 2
                yield string, page
Severity: Minor
Found in lib/ronin/web/spider/agent.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 every_javascript_url_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def every_javascript_url_string(&block)
          every_javascript_string do |string,page|
            if string =~ URL_REGEX
              if block.arity == 2
                yield string, page
Severity: Minor
Found in lib/ronin/web/spider/agent.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 every_cert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def every_cert
          @collected_certs ||= []

          serials = Set.new

Severity: Minor
Found in lib/ronin/web/spider/agent.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 every_javascript_relative_path_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def every_javascript_relative_path_string(&block)
          every_javascript_string do |string,page|
            if string =~ JAVASCRIPT_RELATIVE_PATH_REGEX
              if block.arity == 2
                yield string, page
Severity: Minor
Found in lib/ronin/web/spider/agent.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