Showing 5 of 5 total issues
Method get_csns
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def get_csns(host)
if config[:user] # rubocop:disable Style/ConditionalAssignment
ldap = Net::LDAP.new host: host,
port: config[:port],
auth: {
- 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 get_metrics
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_metrics(host)
ldap = Net::LDAP.new host: host,
port: config[:port],
auth: {
method: :simple,
Method get_csns
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_csns(host)
if config[:user] # rubocop:disable Style/ConditionalAssignment
ldap = Net::LDAP.new host: host,
port: config[:port],
auth: {
Method get_metrics
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_metrics(host)
ldap = Net::LDAP.new host: host,
port: config[:port],
auth: {
method: :simple,
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run
unknown 'Cannot compare 1 node (to anything else).' if config[:hosts].length == 1
(config[:retries] + 1).times do
# Build a list of contextCSNs from each host
- 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"