ronin-rb/ronin

View on GitHub

Showing 47 of 57 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 'ronin/cli/file_processor_command'
    
    require 'hexdump'
    
    module Ronin
    Severity: Minor
    Found in lib/ronin/cli/commands/hexdump.rb - About 3 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 'ronin/cli/command'
      require 'ronin/cli/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

        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

          Class HTTPShell has 22 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

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

            require 'ronin/cli/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 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 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 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 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

                        Method process_value has a Cognitive Complexity of 12 (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 define_file_system_options has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def self.define_file_system_options(command)
                                command.option :file_name, desc: 'Searches for all file names' do
                                  @pattern = FILE_NAME
                                end
                        
                        
                        Severity: Minor
                        Found in lib/ronin/cli/pattern_options.rb - About 1 hr to fix

                          Method define_pii_options has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def self.define_pii_options(command)
                                  command.option :user_name, desc: 'Searches for all user names' do
                                    @pattern = USER_NAME
                                  end
                          
                          
                          Severity: Minor
                          Found in lib/ronin/cli/pattern_options.rb - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language