Method tab_complete_option_values
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def tab_complete_option_values(mod, str, words, opt:)
if words.last.casecmp?('SessionTlvLogging')
return %w[console true false file:<file>]
end
- 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 option_values_dispatch
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def option_values_dispatch(mod, o, str, words)
res = []
res << o.default.to_s if o.default
case o
when Msf::OptAddress
- 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
File module_option_tab_completion.rb
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Msf
module Ui
module Console
###
#
Method option_values_dispatch
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def option_values_dispatch(mod, o, str, words)
res = []
res << o.default.to_s if o.default
case o
when Msf::OptAddress
Method tab_complete_option_names
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def tab_complete_option_names(mod, str, words)
res = tab_complete_module_datastore_names(mod, str, words) || [ ]
if !mod
return res
- 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 tab_complete_option_names
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tab_complete_option_names(mod, str, words)
res = tab_complete_module_datastore_names(mod, str, words) || [ ]
if !mod
return res
Method tab_complete_option_values
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tab_complete_option_values(mod, str, words, opt:)
if words.last.casecmp?('SessionTlvLogging')
return %w[console true false file:<file>]
end
Avoid too many return
statements within this method. Open
return option_values_encoders if opt.upcase == 'STAGEENCODER'
Avoid too many return
statements within this method. Open
return option_values_actions(mod) if opt.upcase == 'ACTION'
Avoid too many return
statements within this method. Open
return option_values_sessions(mod) if opt.upcase == 'SESSION'
Avoid too many return
statements within this method. Open
return res
Avoid too many return
statements within this method. Open
return option_values_targets(mod) if opt.upcase == 'TARGET'
Avoid too many return
statements within this method. Open
return option_values_nops if opt.upcase == 'NOPS'
Avoid too many return
statements within this method. Open
return option_values_payloads(mod) if opt.upcase == 'PAYLOAD'
Avoid too many return
statements within this method. Open
return option_values_encoders
Method option_values_target_addrs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def option_values_target_addrs(mod)
res = [ ]
res << Rex::Socket.source_address
return res if !framework.db.active
- 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"