ronin-rb/ronin-core

View on GitHub

Showing 15 of 19 total issues

Method print_authors has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

          def print_authors(klass)
            unless klass.authors.empty?
              puts "Authors:"
              puts

Severity: Minor
Found in lib/ronin/core/cli/printing/metadata.rb - About 6 hrs 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 complete has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

        def complete(word,preposing)
          if preposing.empty?
            self.class.commands.keys.select { |name| name.start_with?(word) }
          else
            name = preposing.split(/\s+/,2).first
Severity: Minor
Found in lib/ronin/core/cli/command_shell.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 print_authors has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          def print_authors(klass)
            unless klass.authors.empty?
              puts "Authors:"
              puts

Severity: Minor
Found in lib/ronin/core/cli/printing/metadata.rb - About 1 hr to fix

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

            def self.start(*arguments,**kwargs)
              shell = new(*arguments,**kwargs)
    
              prev_completion_proc   = Reline.completion_proc
              Reline.completion_proc = shell.method(:complete)
    Severity: Minor
    Found in lib/ronin/core/cli/shell.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 coerce has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

              def coerce(value)
                if @range
                  unless @range.include?(value)
                    raise(ValidationError,"value is not within the range of acceptable values #{@range.begin}-#{@range.end} (#{value.inspect})")
                  end
    Severity: Minor
    Found in lib/ronin/core/params/types/numeric.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 coerce has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

              def coerce(value)
                case value
                when Enumerable
                  raise(ValidationError,"cannot convert an Enumerable into a String (#{value.inspect})")
                else
    Severity: Minor
    Found in lib/ronin/core/params/types/string.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 start has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def self.start(*arguments,**kwargs)
              shell = new(*arguments,**kwargs)
    
              prev_completion_proc   = Reline.completion_proc
              Reline.completion_proc = shell.method(:complete)
    Severity: Minor
    Found in lib/ronin/core/cli/shell.rb - About 1 hr to fix

      Method references has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

                def references(new_references=nil)
                  if new_references
                    @references = if superclass.kind_of?(ClassMethods)
                                    superclass.references + new_references
                                  else
      Severity: Minor
      Found in lib/ronin/core/metadata/references.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 load_class has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def load_class(id)
                # short-circuit if the module is already loaded
                if (klass = registry[id])
                  return klass
                end
      Severity: Minor
      Found in lib/ronin/core/class_registry.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 coerce has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

                def coerce(value)
                  case value
                  when ::URI then value
                  when ::String
                    if value.empty?
      Severity: Minor
      Found in lib/ronin/core/params/types/uri.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 download has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def self.download(url,dest)
              uri = URI(url)
              url = url.to_s
      
              if File.directory?(dest)
      Severity: Minor
      Found in lib/ronin/core/system.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 call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

              def call(name,*args)
                unless (command = self.class.commands[name])
                  return command_missing(name,*args)
                end
      
      
      Severity: Minor
      Found in lib/ronin/core/cli/command_shell.rb - About 35 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 coerce has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

                def coerce(value)
                  case value
                  when ::Regexp then value
                  when ::String
                    unless (value.start_with?('/') && value.end_with?('/'))
      Severity: Minor
      Found in lib/ronin/core/params/types/regexp.rb - About 35 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 coerce has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

                def coerce(value)
                  case value
                  when ::Float
                    super(value)
                  when ::String
      Severity: Minor
      Found in lib/ronin/core/params/types/float.rb - About 35 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 coerce has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

                def coerce(value)
                  case value
                  when ::Integer then super(value)
                  when ::String
                    case value
      Severity: Minor
      Found in lib/ronin/core/params/types/integer.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