File core_ext.rb
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Module
class << self
def demongoize(object)
object.to_s.constantize
Method to_method_name
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def to_method_name(taken = nil)
str = sym2word
{
'-' => 'minus',
'.' => 'dot'
- 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 plain_query
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def plain_query(namespace_or_opts = nil)
namespace =
if (options = namespace_or_opts).is_a?(Hash)
namespace_or_opts[:namespace]
else
- 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 to_method_name
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_method_name(taken = nil)
str = sym2word
{
'-' => 'minus',
'.' => 'dot'
Method each_deep_pair
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def each_deep_pair(&block)
each_pair do |key, value|
if yield(self, key, value)
case value
when Hash
- 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 difference
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def difference(other)
hash = {}
other.each do |other_key, other_value|
unless has_key?(other_key)
hash[other_key] = other_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 to_time_span
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_time_span(metric = :s)
v = self.abs.to_i
str = ''
h = {
ms: 1000,
Method to_time_span
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to_time_span(metric = :s)
v = self.abs.to_i
str = ''
h = {
ms: 1000,
- 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 do_encode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def do_encode(zip, entries, entry_prefix = nil)
entries.each do |name, data|
entry_name = entry_prefix ? "#{entry_prefix}/#{name}" : name
if data.is_a?(Hash)
do_encode(zip, data, entry_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"