Showing 8 of 13 total issues
Method fixture
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def self.fixture(modules, repos, modifiers = {})
fixtures = {}
%w{forge_modules repositories}.each do |k|
modifiers[k] = {} if not modifiers.has_key?(k)
- 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 fixture
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.fixture(modules, repos, modifiers = {})
fixtures = {}
%w{forge_modules repositories}.each do |k|
modifiers[k] = {} if not modifiers.has_key?(k)
Method check
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check
t = [nil, nil]
%i{puppetfile metadata}.each do |m|
if not options[m].nil?
t = [m, options[m]]
- 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 mod
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def mod(name, *args)
arg = args[0]
if arg.is_a?(String)
return if arg == 'latest'
- 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 detect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.detect(type = nil, target = nil)
if (type.nil? && !target.nil?) || (!type.nil? && target.nil?)
fail 'Type and target are required to bet both set'
elsif !type.nil? && !target.nil?
return type, target
- 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 initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*args)
require 'hashie'
args = Hashie.symbolize_keys(args[0])
raise "Names with dashes are disallowed: #{args[:name]}" if /-/.match(args[:name])
- 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 eql?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def eql?(other)
return false if not @name.eql?(other.name)
# range has to be checked first, sine version is a method
# returning at least latest
- 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 false