Method determine_prerequisites
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def determine_prerequisites
mod_detail = @framework.modules.create(@mod.fullname)
if mod_detail.nil?
@required << :module_not_loadable
return
- 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 matches_host_os?
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def matches_host_os?
hos = @host.os_name&.downcase
return true if hos.nil? || hos.empty?
set = @mod.platform.split(',').map{ |x| x.downcase }
- 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 determine_prerequisites
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def determine_prerequisites
mod_detail = @framework.modules.create(@mod.fullname)
if mod_detail.nil?
@required << :module_not_loadable
return
Method state
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def state
if ready_for_test? || (@missing.empty? && @invalid.empty?)
:READY_FOR_TEST
# TODO: result eval can look for previous attempts to determine :REUSE_PREVIOUS_OPTIONS state
else
- 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 determine_likely_compatibility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def determine_likely_compatibility
if matches_host_os?
@datastore['rhost'] = @host.address
else
@missing << :os_match
- 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 true if set.include?("java")
Avoid too many return
statements within this method. Open
return true if set.include?("php")
Avoid too many return
statements within this method. Open
return true if hos.include?(mos)
Avoid too many return
statements within this method. Open
return false if set.include?("irix") && mod.refname.include?("irix") && !hos.include?("irix")
Avoid too many return
statements within this method. Open
return true if set.include?("python")
Avoid too many return
statements within this method. Open
return true if !hos.include?('windows')
Method description
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def description
if ready_for_test?
"ready for testing"
elsif @missing.empty? && @invalid.empty?
# TODO? confirm vuln match in this class
- 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"