Showing 7 of 27 total issues
Method valid?
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def valid?()
if @cachedValidity == nil
if @bag.valid? == false
@validationErrors.push(@bag.errors.full_messages)
end
- Read upRead up
- Create a ticketCreate a ticket
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 from_existing
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def from_existing(file_location)
@dpnInfoKeysArrays.each do |key|
@dpnInfo[key.to_sym] = []
end
- Read upRead up
- Create a ticketCreate a ticket
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 valid?
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def valid?()
if @cachedValidity == nil
if @bag.valid? == false
@validationErrors.push(@bag.errors.full_messages)
end
- Create a ticketCreate a ticket
Method from_existing
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def from_existing(file_location)
@dpnInfoKeysArrays.each do |key|
@dpnInfo[key.to_sym] = []
end
- Create a ticketCreate a ticket
Method consistent?
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def consistent?
(manifest_files|tagmanifest_files).each do |mf|
# get the algorithm implementation
readAlgo = /manifest-(.+).txt$/.match(File.basename(mf))[1]
algo = case readAlgo
- Read upRead up
- Create a ticketCreate a ticket
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 consistent?
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def consistent?
(manifest_files|tagmanifest_files).each do |mf|
# get the algorithm implementation
readAlgo = /manifest-(.+).txt$/.match(File.basename(mf))[1]
algo = case readAlgo
- Create a ticketCreate a ticket
Method fixity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fixity(algorithm)
if @cachedFixity == nil
case algorithm
when :sha256
digest = Digest::SHA256
- Read upRead up
- Create a ticketCreate a ticket
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"