Showing 10 of 18 total issues
File spider.rb
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ronin/web/cli/command'
require 'ronin/web/spider'
require 'ronin/web/spider/archive'
require 'ronin/web/spider/git_archive'
require 'ronin/support/network/http/user_agents'
Method agent_kwargs
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def agent_kwargs
kwargs = {}
kwargs[:proxy] = options[:proxy] if options[:proxy]
- 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 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])
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}"
- 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 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}"
Method agent_kwargs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def agent_kwargs
kwargs = {}
kwargs[:proxy] = options[:proxy] if options[:proxy]
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])
- 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 define_printing_callbacks
has 30 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
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]
- 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 define_printing_callbacks
has a Cognitive Complexity of 6 (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
- 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"