File appscan_document.rb
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rex/parser/nokogiri_doc_mixin"
module Rex
module Parser
Class AppscanDocument
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
load_nokogiri && class AppscanDocument < Nokogiri::XML::SAX::Document
include NokogiriDocMixin
# The resolver prefers your local /etc/hosts (or windows equiv), but will
Method report_web_site
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def report_web_site(&block)
return unless @state[:uri]
uri = @state[:uri]
hostname = uri.host # Assume the first one is the real hostname
address = resolve_issue_url_address(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 report_web_page
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def report_web_page(&block)
return unless(in_issue && has_text)
return unless @state[:web_site].present?
return unless @state[:response_headers].present?
return unless @state[:uri].present?
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
def report_web_form(page_info,&block)
return unless(in_issue && has_text)
return unless page_info.kind_of? Hash
return unless @state[:request_body]
return if @state[:request_body].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_vuln
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def report_web_vuln(form_info,&block)
return unless(in_issue && has_text)
return unless form_info.kind_of? Hash
return unless @state[:issue]
return unless @state[:issue]["Noise"]
- 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 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_web_site(&block)
return unless @state[:uri]
uri = @state[:uri]
hostname = uri.host # Assume the first one is the real hostname
address = resolve_issue_url_address(uri)
Method report_service_info
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def report_service_info
return unless(in_issue && has_text)
return unless @state[:web_site]
return unless @state[:response_headers]
banner = @state[:response_headers]["server"]
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name=nil)
block = @block
case name
when "Issue" # Wrap it up
record_issue
Method report_web_page
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_web_page(&block)
return unless(in_issue && has_text)
return unless @state[:web_site].present?
return unless @state[:response_headers].present?
return unless @state[:uri].present?
Method collect_entity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def collect_entity(attrs)
return unless in_issue
return unless @state[:issue].kind_of? Hash
ent_hash = attr_hash(attrs)
return unless ent_hash
- 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_request_and_response
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def record_request_and_response
return unless(in_issue && has_text)
return unless @state[:web_site].present?
really_original_traffic = unindent_and_crlf(@text)
request_headers, request_body, response_headers, response_body = really_original_traffic.split(/\r\n\r\n/)
- 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_issue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def record_issue
return unless in_issue
return unless @report_data[:issue].kind_of? Hash
return unless @state[:web_site]
return if @state[:issue]["Noise"].to_s.downcase == "true"
- 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_url
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def record_url
return unless in_issue
return unless has_text
uri = URI.parse(@text) rescue nil
return unless 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
Avoid too many return
statements within this method. Open
return unless code
Avoid too many return
statements within this method. Open
return unless @state[:issue]["Noise"].to_s.downcase == "false"
Avoid too many return
statements within this method. Open
return unless parsed_params
Avoid too many return
statements within this method. Open
return unless service.info.to_s.empty?
Avoid too many return
statements within this method. Open
return unless @state[:issue][:vuln_param]
Avoid too many return
statements within this method. Open
return if parsed_params.empty?
Avoid too many return
statements within this method. Open
return if parsed_headers.empty?
Method in_issue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def in_issue
return false unless in_tag("Issue")
return false unless in_tag("Issues")
return false unless in_tag("XmlReport")
return true
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name=nil)
block = @block
case name
when "Issue" # Wrap it up
record_issue
- 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"