Showing 5 of 5 total issues
Function watch
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
gon.watch = function(name, possibleOptions, possibleCallback, possibleErrorCallback) {
var callback, errorCallback, key, options, performAjax, timer, value, _base, _ref;
if (typeof $ === "undefined" || $ === null) {
return;
}
Function watch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
gon.watch = function(name, possibleOptions, possibleCallback, possibleErrorCallback) {
var callback, errorCallback, key, options, performAjax, timer, value, _base, _ref;
if (typeof $ === "undefined" || $ === null) {
return;
}
- 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 method_missing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(method, *args, &block)
if method.to_s =~ /=$/
if public_method_name?(method)
raise "You can't use Gon public methods for storing data: #{method}"
end
- 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 convert_hash_keys
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def convert_hash_keys(value, current_depth, max_depth)
return value if current_depth > (max_depth.is_a?(Symbol) ? 1000 : max_depth)
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 parse_options_from
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_options_from(args, global)
if old_api? args
unless global
text = "[DEPRECATION] view_path argument is now optional. "
text << "If you need to specify it, "
- 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"