Method start_element
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def start_element(name, attrs)
@state[:current_tag][name] = true
case name
when "description", "information"
return unless in_tag("detaillist")
- 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 47 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when "description", "information"
return unless in_tag("detaillist")
return unless in_tag("detail")
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when "description", "information"
return unless in_tag("detaillist")
return unless in_tag("detail")
Method start_element
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_element(name, attrs)
@state[:current_tag][name] = true
case name
when "description", "information"
return unless in_tag("detaillist")
Method collect_vuln_data
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def collect_vuln_data(name)
@state[:has_text] = false
if name == "name"
@state[:vname] = @text.strip if @text
elsif name == "description"
- 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_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def collect_service_data(name)
@state[:has_text] = false
if name == "portnumber"
@state[:port] = @text.strip if @text
elsif name == "protocol"
- 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 deeply nested control flow statements. Open
@state[:ref] = @text.strip if @text
Method collect_host_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def collect_host_data(name)
@state[:has_text] = false
if name == "name"
@state[:hname] = @text.strip if @text
elsif name == "platform"
- 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 in_tag("host") || in_tag("detail")
Avoid too many return
statements within this method. Open
return unless in_tag("detaillist")
Avoid too many return
statements within this method. Open
return unless in_tag("detail")
Avoid too many return
statements within this method. Open
return unless in_tag("cve")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist-host")
Avoid too many return
statements within this method. Open
return unless in_tag("detaillist")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist")
Avoid too many return
statements within this method. Open
return unless in_tag("host")
Avoid too many return
statements within this method. Open
return unless in_tag("portinfo")
Avoid too many return
statements within this method. Open
return unless in_tag("hostlist") || in_tag("detaillist")
Avoid too many return
statements within this method. Open
return unless in_tag("hostlist")
Avoid too many return
statements within this method. Open
return unless in_tag("host")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist")
Avoid too many return
statements within this method. Open
return unless in_tag("hostlist")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist")
Avoid too many return
statements within this method. Open
return unless in_tag("detail")
Avoid too many return
statements within this method. Open
return unless in_tag("cve")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist-host")
Avoid too many return
statements within this method. Open
return unless in_tag("portinfo")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist-host")
Avoid too many return
statements within this method. Open
return unless in_tag("portlist-host")