ronin-rb/ronin-web

View on GitHub

Showing 20 of 28 total issues

Method included has 294 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def self.included(command)
          command.usage '[options] {--host HOST | --domain DOMAIN | --site URL}'

          command.option :host, value: {
                                  type:  String,
Severity: Major
Found in lib/ronin/web/cli/spider_options.rb - About 1 day to fix

    File spider_options.rb has 449 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'ronin/web/spider'
    require 'ronin/support/network/http/user_agents'
    
    module Ronin
      module Web
    Severity: Minor
    Found in lib/ronin/web/cli/spider_options.rb - About 6 hrs to fix

      Class CLI has 45 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class CLI
            #
            # Adds options for spidering a website.
            #
            # @since 2.0.0
      Severity: Minor
      Found in lib/ronin/web/cli/spider_options.rb - About 6 hrs to fix

        Class BrowserShell has 32 methods (exceeds 20 allowed). Consider refactoring.
        Open

              class BrowserShell < Core::CLI::CommandShell
        
                shell_name 'browser'
        
                # The browser instance.
        Severity: Minor
        Found in lib/ronin/web/cli/browser_shell.rb - About 4 hrs to fix

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

                    def run
                      @wordlist = ::Wordlist::Builder.new(wordlist_path,**wordlist_builder_kwargs)
          
                      @xpath = "#{@content_xpath}#{TEXT_XPATH}"
                      @xpath << "|#{META_TAGS_XPATH}"                 if @parse_meta_tags
          Severity: Minor
          Found in lib/ronin/web/cli/commands/wordlist.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

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

                    def run
                      archive = if options[:archive]
                                  Web::Spider::Archive.open(options[:archive])
                                elsif options[:git_archive]
                                  Web::Spider::GitArchive.open(options[:git_archive])
          Severity: Major
          Found in lib/ronin/web/cli/commands/spider.rb - About 2 hrs to fix

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

                      def define_printing_callbacks(agent)
                        if options[:print_hosts]
                          agent.every_host do |host|
                            print_verbose "spidering new host #{host}"
                          end
            Severity: Minor
            Found in lib/ronin/web/cli/commands/spider.rb - About 2 hrs to fix

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

                        def run
                          proxy = Ronin::Web::Server::ReverseProxy.new do |proxy|
                            proxy.on_request do |request|
                              puts "[#{request.ip} -> #{request.host_with_port}] #{request.request_method} #{request.url}"
              
              
              Severity: Minor
              Found in lib/ronin/web/cli/commands/reverse_proxy.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 configure_browser has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                        def configure_browser
                          if options[:x] || options[:y]
                            browser.position = {
                              left: options.fetch(:x,0),
                              top:  options.fetch(:y,0)
              Severity: Minor
              Found in lib/ronin/web/cli/commands/browser.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 run has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        def run
                          proxy = Ronin::Web::Server::ReverseProxy.new do |proxy|
                            proxy.on_request do |request|
                              puts "[#{request.ip} -> #{request.host_with_port}] #{request.request_method} #{request.url}"
              
              
              Severity: Minor
              Found in lib/ronin/web/cli/commands/reverse_proxy.rb - About 1 hr to fix

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

                          def run
                            archive = if options[:archive]
                                        Web::Spider::Archive.open(options[:archive])
                                      elsif options[:git_archive]
                                        Web::Spider::GitArchive.open(options[:git_archive])
                Severity: Minor
                Found in lib/ronin/web/cli/commands/spider.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 run has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def run
                            db_connect if options[:import]
                
                            vulns = []
                
                
                Severity: Minor
                Found in lib/ronin/web/cli/commands/vulns.rb - About 1 hr to fix

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

                            def run
                              db_connect if options[:import]
                  
                              vulns = []
                  
                  
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/vulns.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_printing_callbacks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def define_printing_callbacks(agent)
                              if options[:print_hosts]
                                agent.every_host do |host|
                                  print_verbose "spidering new host #{host}"
                                end
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/spider.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 random_kwargs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def random_kwargs
                              kwargs = {}
                  
                              if options[:chrome_version] && options[:browser] == :chrome
                                kwargs[:chrome_version] = options[:chrome_version]
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/user_agent.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 wordlist_builder_kwargs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def wordlist_builder_kwargs
                              kwargs = {}
                  
                              WORDLIST_BUILDER_OPTIONS.each do |key|
                                kwargs[key] = options[key] if options.has_key?(key)
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/wordlist.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 infer_wordlist_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def infer_wordlist_path
                              if    options[:host]   then "#{options[:host]}.txt"
                              elsif options[:domain] then "#{options[:domain]}.txt"
                              elsif options[:site]
                                uri = URI.parse(options[:site])
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/wordlist.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_page has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def print_page(page)
                              print_status(page) if options[:print_status]
                              print_url(page)
                  
                              if options[:print_headers]
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/spider.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def run(source,query=@query)
                              unless query
                                print_error "must specify --xpath or an XPath argument"
                                exit(-1)
                              end
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/xml.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

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

                            def run(url=nil)
                              unless (url || options[:shell] || options[:js_shell])
                                print_error "must specify a URL or --shell / --js-shell"
                                exit(-1)
                              end
                  Severity: Minor
                  Found in lib/ronin/web/cli/commands/browser.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