ronin-rb/ronin-web

View on GitHub
lib/ronin/web/cli/commands/wordlist.rb

Summary

Maintainability
A
3 hrs
Test Coverage

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

There are no issues that match your filters.

Category
Status