File acunetix_document.rb
has 513 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rex/parser/nokogiri_doc_mixin"
require 'rex'
require 'uri'
module Rex
Class AcunetixDocument
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
load_nokogiri && class AcunetixDocument < Nokogiri::XML::SAX::Document
include NokogiriDocMixin
# The resolver prefers your local /etc/hosts (or windows equiv), but will
Method end_element
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name=nil)
block = @block
case name
when "Scan"
# Clears most of the @state out, we're done with this web site.
Method collect_vuln_from_report_item
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def collect_vuln_from_report_item
@state[:vuln_info] = nil
return unless @host_object
return unless in_tag("Scan")
return unless in_tag("ReportItems")
- 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 report_web_page
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def report_web_page(&block)
return if should_skip_this_page
return unless @state[:web_site]
@state[:page_request_verb] = nil
return unless @state[:page_request]
- 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 report_web_site
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def report_web_site(url,&block)
return unless in_tag("Crawler")
return unless url
return if url.strip.empty?
uri = URI.parse(url) rescue nil
- 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 end_element
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name=nil)
block = @block
case name
when "Scan"
# Clears most of the @state out, we're done with this web site.
- 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 collect_service_from_kbitem_text
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def collect_service_from_kbitem_text
return unless @host_object
return unless in_tag("Scan")
return unless in_tag("KBase")
return unless in_tag("KBItem")
- 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 report_web_vuln
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def report_web_vuln(&block)
return if should_skip_this_page
return unless @state[:web_page]
return unless @state[:web_site]
return unless @state[:vuln_info]
- 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 report_web_page
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_web_page(&block)
return if should_skip_this_page
return unless @state[:web_site]
@state[:page_request_verb] = nil
return unless @state[:page_request]
Method collect_service_from_url
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def collect_service_from_url
return unless @report_data[:host]
return unless in_tag("Scan")
return unless @text
return if @text.strip.empty?
- 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 report_web_form
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def report_web_form(&block)
return unless in_tag("SiteFiles")
return unless @state[:web_site]
return unless @state[:fullurl].kind_of? URI
return unless @state[:form_variables].kind_of? Array
- 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 collect_report_item_reference_url
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def collect_report_item_reference_url
return unless in_tag("ReportItem")
return unless in_tag("References")
return unless in_tag("Reference")
return unless @text
- 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 report_kbitem_service
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def report_kbitem_service(service,&block)
return unless @host_object
return unless @state[:starturl_uri]
addr = @host_object.address
svc = {
- 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 report_starturl_service
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def report_starturl_service(&block)
return unless @host_object
return unless @state[:starturl_uri]
name = @state[:starturl_uri].scheme
port = @state[:starturl_uri].port
- 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 collect_host
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def collect_host
return unless in_tag("Scan")
return unless @text
return if @text.strip.empty?
uri = URI.parse(@text) rescue nil
- 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 record_variable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def record_variable(attrs)
return unless in_tag("Inputs")
return unless @state[:fullurl].kind_of? URI
method = attr_hash(attrs)["Type"]
return unless method
- 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 collect_scan_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def collect_scan_name
return unless in_tag("Scan")
return if in_tag("ReportItems")
return if in_tag("Crawler")
return unless @text
- 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 report_os_fingerprint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def report_os_fingerprint
return unless @state[:starturl_service_object]
return unless @text
return if @text.strip.empty?
return unless in_tag("Scan")
- 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 collect_page_request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def collect_page_request
return unless in_tag("TechnicalDetails")
return unless in_tag("ReportItem")
return unless @text
return if @text.to_s.empty?
- 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 collect_and_report_banner
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def collect_and_report_banner
return unless (svc = @state[:starturl_service_object]) # Yes i want assignment
return unless @text
return if @text.strip.empty?
return unless in_tag("Scan")
- 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 report_host
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def report_host(&block)
return unless @report_data[:host]
return unless in_tag("Scan")
if host_is_okay
db.emit(:address,@report_data[:host],&block) if block
- 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 collect_page_response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def collect_page_response
return unless in_tag("TechnicalDetails")
return unless in_tag("ReportItem")
return unless @text
return if @text.to_s.empty?
- 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
Avoid too many return
statements within this method. Open
return unless @text
Avoid too many return
statements within this method. Open
return unless @state[:report_item][:severity]
Avoid too many return
statements within this method. Open
return unless parsed_response
Avoid too many return
statements within this method. Open
return matched
Avoid too many return
statements within this method. Open
return unless path
Avoid too many return
statements within this method. Open
return unless scheme[/^https?/]
Avoid too many return
statements within this method. Open
return if @text.strip.empty?
Avoid too many return
statements within this method. Open
return unless @state[:report_item][:name]
Avoid too many return
statements within this method. Open
return unless @state[:report_item][:severity].downcase == "high"
Avoid too many return
statements within this method. Open
return if @state[:form_variables].empty?
Avoid too many return
statements within this method. Open
return if @text.strip.empty?
Avoid too many return
statements within this method. Open
return @state[:vuln_info]
Avoid too many return
statements within this method. Open
return unless @text =~ /server is running/
Avoid too many return
statements within this method. Open
return unless uri # Sanity checker
Avoid too many return
statements within this method. Open
return unless (host && port && scheme)
Avoid too many return
statements within this method. Open
return if @text.strip.empty?
Avoid too many return
statements within this method. Open
return unless address
Avoid too many return
statements within this method. Open
return unless uri
Avoid too many return
statements within this method. Open
return unless service_object
Method record_crawler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def record_crawler(attrs)
return unless in_tag("Scan")
return unless @state[:starturl_service_object]
starturl = attr_hash(attrs)["StartUrl"]
return unless starturl
- 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 parse_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_request(request)
headers = Rex::Proto::Http::Packet::Header.new
headers.from_s request.dup # It's destructive.
return unless headers.cmd_string
verb,req = headers.cmd_string.split(/\s+/)
- 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 parse_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_response(response)
headers = Rex::Proto::Http::Packet::Header.new
headers.from_s response.dup # It's destructive.
return unless headers.cmd_string
http,code,msg = headers.cmd_string.split(/\s+/)
- 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"