Showing 6 of 6 total issues
Method initialize
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, address1, address2, address3, address4,
address5, country_code, cdsid, occurred_on= nil)
Method flat_dig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.flat_dig(data,*path)
path.flatten.inject(data) do |d,key|
if d.is_a? Hash
d[key].is_a?(Array) ? d[key] : [d[key]]
elsif d.is_a? Array
- 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_range
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.validate_range(range_start, range_end)
range_start = 1 unless range_start
range_end = 10 unless range_end
if range_start > range_end
range_start, range_end = range_end, range_start
- 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_hash_flat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_hash_flat(hash_layer, target)
result = []
if hash_layer.nil?
return []
elsif hash_layer.class == String
- 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 request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.request(verb, url, options = {})
EpoOps::Logger.debug("Sending Request: #{verb} #{url}")
response = case EpoOps.config.authentication
when :oauth then do_oauth_request(verb, url, options)
when :plain then do_plain_request(verb,url,options)
- 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 process_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.process_file(file)
# Process every line (There is a line for every class entry, name and description are separated by a \t)
file.each_line.inject(Hash.new { |h, k| h[k] = [] }) do |mem, line|
next if line.to_s.strip.empty?
ipc_class_generic, _description = line.split("\t")
- 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"