ronin-rb/ronin

View on GitHub

Showing 54 of 66 total issues

Method run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

        def run(*args)
          local, upstream = *args

          if local.include?(':')
            proxy_host, proxy_port = host_and_port(local)
Severity: Minor
Found in lib/ronin/cli/commands/proxy.rb - About 4 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 run has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def run(*args)
          local, upstream = *args

          if local.include?(':')
            proxy_host, proxy_port = host_and_port(local)
Severity: Major
Found in lib/ronin/cli/commands/proxy.rb - About 4 hrs to fix

    Method server_loop has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

            def server_loop
              finished    = Async::Notification.new
              endpoint    = async_endpoint
              stdin       = async_stdin
              clients     = []
    Severity: Minor
    Found in lib/ronin/cli/commands/netcat.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

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

            def run(*args)
              if options[:hexdump]
                require 'hexdump'
                @hexdump = Hexdump::Hexdump.new
              end
    Severity: Minor
    Found in lib/ronin/cli/commands/netcat.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 hexdump.rb has 298 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative '../file_processor_command'
    
    require 'hexdump'
    
    module Ronin
    Severity: Minor
    Found in lib/ronin/cli/commands/hexdump.rb - About 3 hrs to fix

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

      require_relative '../value_processor_command'
      require_relative '../printing/http'
      require_relative '../http_shell'
      require 'ronin/support/network/http'
      require 'ronin/support/network/http/cookie'
      Severity: Minor
      Found in lib/ronin/cli/commands/http.rb - About 2 hrs to fix

        Method process_hostname has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                def process_hostname(host)
                  if options[:subdomain]
                    puts host.subdomain(options[:subdomain])
                  elsif options[:domain]
                    puts host.domain
        Severity: Minor
        Found in lib/ronin/cli/commands/host.rb - About 2 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 proxy.rb has 280 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require_relative '../command'
        require_relative '../host_and_port'
        require 'ronin/core/cli/logging'
        
        require 'ronin/support/network/tcp/proxy'
        Severity: Minor
        Found in lib/ronin/cli/commands/proxy.rb - About 2 hrs to fix

          Class HTTPShell has 24 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class HTTPShell < Core::CLI::CommandShell
          
                include Printing::HTTP
          
                # The base URI.
          Severity: Minor
          Found in lib/ronin/cli/http_shell.rb - About 2 hrs to fix

            Method define_char_sets has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def self.define_char_sets(command)
                    command.option :numeric, short: '-N',
                                             desc: 'Searches for numeric characters (0-9)' do
                                               @char_set = Chars::NUMERIC
                                             end
            Severity: Major
            Found in lib/ronin/cli/char_set_options.rb - About 2 hrs to fix

              File netcat.rb has 259 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require_relative '../command'
              require 'ronin/core/cli/logging'
              require 'ronin/support/network/ssl'
              
              require 'command_kit/options/verbose'
              Severity: Minor
              Found in lib/ronin/cli/commands/netcat.rb - About 2 hrs to fix

                Method client_loop has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                        def client_loop
                          finished    = Async::Notification.new
                          endpoint    = async_endpoint
                          stdin       = async_stdin
                          buffer_size = options[:buffer_size]
                Severity: Minor
                Found in lib/ronin/cli/commands/netcat.rb - About 2 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 pattern_options.rb has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'ronin/support/text/patterns'
                
                module Ronin
                  class CLI
                    #
                Severity: Minor
                Found in lib/ronin/cli/pattern_options.rb - About 2 hrs to fix

                  Method run has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def run(*args)
                            if options[:hexdump]
                              require 'hexdump'
                              @hexdump = Hexdump::Hexdump.new
                            end
                  Severity: Minor
                  Found in lib/ronin/cli/commands/netcat.rb - About 2 hrs to fix

                    Method define_source_code_options has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def self.define_source_code_options(command)
                            command.option :identifier, desc: 'Searches for all identifier names' do
                              @pattern = IDENTIFIER
                            end
                    
                    
                    Severity: Minor
                    Found in lib/ronin/cli/pattern_options.rb - About 2 hrs to fix

                      Method process_value has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def process_value(url)
                                uri = URI(url)
                      
                                if options[:user]
                                  puts uri.user
                      Severity: Minor
                      Found in lib/ronin/cli/commands/url.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 process_value has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def process_value(domain)
                                if options[:has_addresses]
                                  each_typo_squat(domain) do |typo_domain|
                                    if typo_domain.has_addresses?
                                      puts typo_domain
                      Severity: Minor
                      Found in lib/ronin/cli/commands/typosquat.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 process_value has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def process_value(domain)
                                if options[:has_addresses]
                                  each_bit_squat(domain) do |host|
                                    puts host if host.has_addresses?
                                  end
                      Severity: Minor
                      Found in lib/ronin/cli/commands/bitsquat.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 server_loop has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def server_loop
                                finished    = Async::Notification.new
                                endpoint    = async_endpoint
                                stdin       = async_stdin
                                clients     = []
                      Severity: Minor
                      Found in lib/ronin/cli/commands/netcat.rb - About 1 hr to fix

                        Method client_loop has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def client_loop
                                  finished    = Async::Notification.new
                                  endpoint    = async_endpoint
                                  stdin       = async_stdin
                                  buffer_size = options[:buffer_size]
                        Severity: Minor
                        Found in lib/ronin/cli/commands/netcat.rb - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language