Method report_services
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def report_services(host_object)
return unless host_object.kind_of? ::Mdm::Host
snames = {}
( @state[:root]["services"] || {} ).each_pair do |sname, sinfo|
- 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_services
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_services(host_object)
return unless host_object.kind_of? ::Mdm::Host
snames = {}
( @state[:root]["services"] || {} ).each_pair do |sname, sinfo|
Method end_element
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name=nil)
block = @block
case name
when "entity" # Wrap it up
if @state[:address]
- 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)
@report_data = {
:ports => [:ignore],
:state => Msf::HostState::Alive,
:host => @state[:address]
- 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 start_element
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def start_element(name=nil,attrs=[])
attrs = normalize_attrs(attrs)
block = @block
r = { :e => 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"