ronin-rb/ronin-core

View on GitHub

Showing 19 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 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 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 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 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 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 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        module Core
          module CLI
            module Generator
              module Options
                #
      Severity: Minor
      Found in lib/ronin/core/cli/generator/options/summary.rb and 1 other location - About 20 mins to fix
      lib/ronin/core/cli/generator/options/description.rb on lines 20..49

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 28.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        module Core
          module CLI
            module Generator
              module Options
                #
      Severity: Minor
      Found in lib/ronin/core/cli/generator/options/description.rb and 1 other location - About 20 mins to fix
      lib/ronin/core/cli/generator/options/summary.rb on lines 20..49

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 28.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        module Core
          module Metadata
            #
            # Adds a {Summary::ClassMethods#summary summary} metadata
            # attribute to a class.
      Severity: Minor
      Found in lib/ronin/core/metadata/summary.rb and 1 other location - About 15 mins to fix
      lib/ronin/core/metadata/description.rb on lines 20..97

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 26.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        module Core
          module Metadata
            #
            # Adds a {Description::ClassMethods#description description} metadata
            # attribute to a class.
      Severity: Minor
      Found in lib/ronin/core/metadata/description.rb and 1 other location - About 15 mins to fix
      lib/ronin/core/metadata/summary.rb on lines 20..75

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 26.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language