ronin-rb/ronin-exploits

View on GitHub

Showing 10 of 28 total issues

Class Exploit has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Exploit

      include Core::Metadata::ID
      include Core::Metadata::Authors
      include Core::Metadata::Summary
Severity: Minor
Found in lib/ronin/exploits/exploit.rb - About 3 hrs to fix

    Method print_metadata has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

              def print_metadata(exploit)
                fields = {
                  'Type' => exploit_type(exploit)
                }
    
    
    Severity: Minor
    Found in lib/ronin/exploits/cli/commands/show.rb - About 3 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

    File run.rb has 282 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'ronin/exploits/cli/exploit_command'
    require 'ronin/exploits/cli/ruby_shell'
    require 'ronin/exploits/mixins/has_payload'
    require 'ronin/exploits/mixins/has_targets'
    require 'ronin/exploits/mixins/loot'
    Severity: Minor
    Found in lib/ronin/exploits/cli/commands/run.rb - About 2 hrs to fix

      Method print_metadata has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                def print_metadata(exploit)
                  fields = {
                    'Type' => exploit_type(exploit)
                  }
      
      
      Severity: Minor
      Found in lib/ronin/exploits/cli/commands/show.rb - About 1 hr to fix

        Method print_target has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

                  def print_target(target)
                    fields = {}
        
                    fields['Arch'] = target.arch if target.arch
        
        
        Severity: Minor
        Found in lib/ronin/exploits/cli/commands/show.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 shouts has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

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

                  def post_exploitation
                    if @exploit_class.include?(Mixins::HasPayload) &&
                       @exploit.payload.kind_of?(Ronin::Payloads::Payload) &&
                       @exploit.payload.kind_of?(Ronin::Payloads::Mixins::PostEx)
                      unless @exploit.payload.session
        Severity: Minor
        Found in lib/ronin/exploits/cli/commands/run.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 select_target has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                def select_target(arch: nil, os: nil, os_version: nil, software: nil, version: nil)
                  targets = self.class.targets.lazy
        
                  if arch
                    targets = targets.select { |target| target.arch == arch }
        Severity: Minor
        Found in lib/ronin/exploits/mixins/has_targets.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 print_exploit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                  def print_exploit(exploit)
                    puts "[ #{exploit.id} ]"
                    puts
        
                    indent do
        Severity: Minor
        Found in lib/ronin/exploits/cli/commands/show.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 depth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def self.depth(new_depth=nil)
                if new_depth
                  @depth = new_depth
                else
                  @depth || if superclass < LFI
        Severity: Minor
        Found in lib/ronin/exploits/lfi.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