Method client_side_form_settings
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def client_side_form_settings(object, options, builder)
if options[:validate]
if options[:id]
var_name = options[:id]
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 form_for
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def form_for(record, *args, &block)
raise ArgumentError, "Missing block" unless block_given?
options = args.extract_options!
if options[:validate]
- 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 form_for
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def form_for(record, *args, &block)
raise ArgumentError, "Missing block" unless block_given?
options = args.extract_options!
if options[:validate]
Method construct_validators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def construct_validators
@validators.inject({}) do |validator_hash, object_opts|
option_hash = object_opts[1].inject({}) do |option_hash, attr|
option_hash.merge!(attr[0] => attr[1][:options])
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"