ronin-rb/ronin

View on GitHub

Showing 47 of 57 total issues

Method print_cert_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def print_cert_name(name)
          fields = {}

          if name.common_name
            fields["Common Name"] = name.common_name
Severity: Minor
Found in lib/ronin/cli/commands/cert_dump.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 hexdump_kwargs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def hexdump_kwargs
          kwargs = {}

          HEXDUMP_OPTIONS.each do |key|
            kwargs[key] = options[key] if options.has_key?(key)
Severity: Minor
Found in lib/ronin/cli/commands/hexdump.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 hexdump_highlights_kwargs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def hexdump_highlights_kwargs
          highlights = {}

          unless @highlight_index.empty?
            highlights[:index] = @highlight_index
Severity: Minor
Found in lib/ronin/cli/commands/hexdump.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def run(*ips)
          if options[:public]
            if (address = Support::Network::IP.public_address)
              puts address
            else
Severity: Minor
Found in lib/ronin/cli/commands/ip.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def run(*ip_ranges)
          if !@start.empty? && !@stop.empty?
            unless @start.length == @stop.length
              print_error "must specify an equal number of --start and --stop options"
              exit(-1)
Severity: Minor
Found in lib/ronin/cli/commands/iprange.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def run(file=nil)
          parser = Support::Binary::Unhexdump::Parser.new(
                     **hexdump_parser_options
                   )

Severity: Minor
Found in lib/ronin/cli/commands/unhexdump.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 subject_alt_name_ext has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def subject_alt_name_ext
          unless @subject_alt_names.empty?
            @subject_alt_names.map { |name|
              if name =~ IP_REGEXP
                "IP: #{name}"
Severity: Minor
Found in lib/ronin/cli/commands/cert_gen.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