Showing 14 of 17 total issues
Method finalize!
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def finalize!
super
@inventory.groups = @groups unless @groups == UNSET_VALUE
@inventory.vars = @vars unless @vars == UNSET_VALUE
@inventory.children = @children unless @children == UNSET_VALUE
- 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 with_default_gateway_addresses
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def with_default_gateway_addresses(machine)
return enum_for(__method__, machine) unless block_given?
machine.communicate.execute('ip route show', error_check: false) do |type, data|
if type == :stdout
- 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
Class Inventory
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Inventory
include VagrantPlugins::AnsibleAuto::Util::Config
UNNAMED_GROUP = '_'.freeze
Method with_candidate_addresses
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def with_candidate_addresses(machine)
return enum_for(__method__, machine) unless block_given?
seen_candidates = Set.new
yield_unseen_candidate = lambda do |host_and_port|
- 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 groups=
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def groups=(new_groups)
@groups = nil
new_groups.each do |group_heading, entries|
group, type = parse_group_heading(group_heading)
- 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 provision
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def provision
@config = @__ansible_config.merge(config)
return super unless machine.guest.capability?(:ssh_server_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 with_candidate_addresses
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def with_candidate_addresses(machine)
return enum_for(__method__, machine) unless block_given?
seen_candidates = Set.new
yield_unseen_candidate = lambda do |host_and_port|
Method with_open_ports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def with_open_ports(machine, target_machine = nil)
return enum_for(__method__, machine, target_machine) unless block_given?
return unless machine.guest.capability?(:port_open?)
- 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 validate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate(machine)
super
errors = _detected_errors + @__errors
- 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 fetch_public_key
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fetch_public_key(machine, path)
return unless machine.guest.capability?(:executable_installed?) \
&& machine.guest.capability(:executable_installed?, 'ssh-keygen')
public_key = ''
- 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 merge!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def merge!(other)
if block_given?
other.each do |key, value|
convert_key(key).tap do |ckey|
self[ckey] = if key? ckey
- 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 parse_superclass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_superclass(superclass)
return nil unless superclass
case superclass.type
when :call, :command_call
- 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 add_host
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_host(host, hostvars = nil)
hosts.add case host
when Host
host.tap { |h| h.hostvars = hostvars unless hostvars.nil? }
when String, Symbol
- 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 with_ini_lines_groups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def with_ini_lines_groups
return enum_for(__method__) unless block_given?
to_h.tap { |h| h.delete(UNNAMED_GROUP) }.sort.each do |group, entries|
yield "[#{group}]"
- 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"