Showing 20 of 20 total issues
Method attack
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def attack(users, wordlist_path, opts = {})
wordlist = File.open(wordlist_path)
create_progress_bar(total: users.size * wordlist.count, show_progression: opts[:show_progression])
- Read upRead up
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 uris_from_page
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def uris_from_page(page = nil, xpath = '//@href|//@src|//@data-src')
page = NS::Browser.get(url(page)) unless page.is_a?(Typhoeus::Response)
found = []
page.html.xpath(xpath).each do |node|
- Read upRead up
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 enumerate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def enumerate(urls, opts = {})
create_progress_bar(opts.merge(total: urls.size))
urls.each do |url, id|
request = browser.forge_request(url, head_or_get_request_params)
- Read upRead up
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 attack
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def attack(users, wordlist_path, opts = {})
wordlist = File.open(wordlist_path)
create_progress_bar(total: users.size * wordlist.count, show_progression: opts[:show_progression])
Method view_path
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def view_path(tpl)
if tpl[0, 1] == '@' # Global Template
tpl = tpl.delete('@')
else
raise 'The controller_name can not be nil' unless controller_name
- Read upRead up
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 <<
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def <<(finding)
return self unless finding
each do |f|
next unless f == finding && f.found_by == finding.found_by
- Read upRead up
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 9 (exceeds 5 allowed). Consider refactoring. Open
def run(opts = {})
opts[:confidence_threshold] ||= 100
symbols_from_mode(opts[:mode]).each do |symbol|
each do |finder|
- Read upRead up
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 aggressive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def aggressive(_opts = {})
potential_urls << target.url('xmlrpc.php')
potential_urls.uniq.each do |potential_url|
next unless target.in_scope?(potential_url)
- Read upRead up
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 include?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def include?(host)
if PublicSuffix.valid?(host, ignore_private: true)
domain = PublicSuffix.parse(host, ignore_private: true)
domains.each { |d| return true if domain.match(d) }
- Read upRead up
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 xpath_pattern_from_page
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def xpath_pattern_from_page(xpath, pattern, page = nil)
page = NS::Browser.get(url(page)) unless page.is_a?(Typhoeus::Response)
matches = []
page.html.xpath(xpath).each do |node|
- Read upRead up
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 interesting_entries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def interesting_entries
results = []
entries.each do |entry|
next unless entry =~ /\A(?:dis)?allow:\s*(.+)\z/i
- Read upRead up
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 7 (exceeds 5 allowed). Consider refactoring. Open
def run
controllers.run
rescue OptParseValidator::NoRequiredOption => e
@run_error = e
- Read upRead up
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 match
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def match(pattern)
pattern = PublicSuffix.parse(pattern) unless pattern.is_a?(PublicSuffix::Domain)
return name == pattern.name unless pattern.trd
return false unless tld == pattern.tld && sld == pattern.sld
- Read upRead up
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 references=
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def references=(refs)
@references = {}
self.class.references_keys.each do |key|
next unless refs.key?(key)
- Read upRead up
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 maybe_get_full_response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def maybe_get_full_response(head_res, opts)
return head_res unless opts[:check_full_response] == true ||
Array(opts[:check_full_response]).include?(head_res.code)
full_res = NS::Browser.get(head_res.effective_url, full_request_params)
- Read upRead up
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 default_request_params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def default_request_params
params = default_connect_request_params.merge(
headers: { 'User-Agent' => user_agent, 'Referer' => url }.merge(headers || {}),
accept_encoding: 'gzip, deflate',
method: :get
- Read upRead up
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 maybe_output_banner_help_and_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def maybe_output_banner_help_and_version
output('banner') if NS::ParsedCli.banner
output('help', help: option_parser.simple_help, simple: true) if NS::ParsedCli.help
output('help', help: option_parser.full_help, simple: false) if NS::ParsedCli.hh
output('version') if NS::ParsedCli.version
- Read upRead up
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 in_scope_uris
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def in_scope_uris(res, xpath = '//@href|//@src|//@data-src')
found = []
uris_from_page(res, xpath) do |uri, tag|
next unless in_scope?(uri)
- Read upRead up
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 exit_hook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def exit_hook
# Avoid hooking the exit when rspec is running, otherwise it will always return 0
# and Travis won't detect failed builds. Couldn't find a better way, even though
# some people managed to https://github.com/rspec/rspec-core/pull/410
return if defined?(RSpec)
- Read upRead up
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 <<
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def <<(finding)
return self unless finding
each do |found|
next unless found == finding
- Read upRead up
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"