Method gather_minion_data
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def gather_minion_data
print_status('Gathering data from minions (this can take some time)')
command = []
if datastore['GETHOSTNAME']
command << 'network.get_hostname'
- 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 master
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def master
list_minions_printer
gather_minion_data if datastore['GETOS'] || datastore['GETHOSTNAME'] || datastore['GETIP']
# get sls files
- 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 master
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
def master
list_minions_printer
gather_minion_data if datastore['GETOS'] || datastore['GETHOSTNAME'] || datastore['GETIP']
# get sls files
Method gather_minion_data
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gather_minion_data
print_status('Gathering data from minions (this can take some time)')
command = []
if datastore['GETHOSTNAME']
command << 'network.get_hostname'
File saltstack_salt.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'yaml'
class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Exploit::Local::Saltstack
Method initialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'SaltStack Salt Information Gatherer',
Method minion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def minion
print_status('Looking for salt minion config files')
# https://github.com/saltstack/salt/blob/b427688048fdbee106f910c22ebeb105eb30aa10/doc/ref/configuration/minion.rst#configuring-the-salt-minion
[
'/etc/salt/minion', # linux, osx
- 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"