Showing 25 of 25 total issues
Method add_yaml_validator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_yaml_validator(base)
base.validate if: :yaml_kind? do
require_safe_yaml do
unless raw.blank?
begin
- 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 apply_defaults!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_defaults!(file, verbose = false)
if File.file?(file)
puts "[settings] Loading from #{file}" if verbose
if defined?(Psych) && Psych.respond_to?(:safe_load)
yaml = Psych.safe_load(File.read(file))
- 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 ns
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ns(name, options = {})
options.symbolize_keys!
if name.nil? || name == @@ns_default
name = @@ns_default.to_s
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 change
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def change
create_table :rails_admin_settings do |t|
t.boolean :enabled, default: true
t.string :kind, null: false, default: 'string'
t.string :ns, default: 'main'
- 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 add_json_validator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_json_validator(base)
base.validate if: :json_kind? do
unless raw.blank?
begin
JSON.load(raw)
- 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"