Showing 28 of 191 total issues
Method generate_error
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def generate_error(input_spec_with_values, check_results)
buf = []
if check_results.size.zero?
if @include_no_error
- 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
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def validate
if allow_blank?
return true if target_value.split(//).size.zero?
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 validate
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def validate
length = target_value.split(//).size
if allow_blank?
return true if length.zero?
- 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 load_rule_from_csv_file
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.load_rule_from_csv_file(file_path, validators)
first = true
header = nil
rule_set = RuleSet.new
- 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 generate_error
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_error(input_spec_with_values, check_results)
buf = []
if check_results.size.zero?
if @include_no_error
Method load_validators_from_csv_file
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.load_validators_from_csv_file(file_path)
first = true
header = nil
validators = {}
Method load_validators_from_csv_file
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.load_validators_from_csv_file(file_path)
first = true
header = nil
validators = {}
- 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 load_rule_from_csv_file
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.load_rule_from_csv_file(file_path, validators)
first = true
header = nil
rule_set = RuleSet.new
Method add_error_level
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.add_error_level(value, symbol, label)
# value check
raise 'Error level value must be Integer' unless value.is_a? Integer
raise 'Error level value must be greater than zero' unless value > 0
raise "Error level value #{value} already exists" if ERROR_LEVELS.values.include?(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 validate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate
if target_value.split(//).size.zero?
return true if allow_blank?
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 generate_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate_data(input_spec_with_values, check_results)
buf = []
buf << @items.map do |item|
if item.is_a? Symbol
case item
- 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 default_options
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def default_options(options = nil)
# initialize from superclass
@default_options = superclass.default_options if @default_options.nil?
unless options.nil?
- 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
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate
if allow_blank?
return true if target_value.split(//).size.zero?
end
Method validate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate
if @options[:validators].nil?
raise ConfigurationError, 'ComplexValidator must have validators option'
end
case @options[:logic]
- 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 options_reader
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.options_reader(row, options = {}, options_index_from = 4)
if row.size > options_index_from
row[options_index_from..-1].each do |column|
next if column.nil?
key, value = column.split(':', 2)
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(target_expressions, message, validator, prerequisite = nil, level = ERROR_LEVELS.values.sort.last, description = nil)
Method valid_option_keys
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid_option_keys(*option_keys)
# initialize from superclass
if @valid_option_keys.nil?
@valid_option_keys = superclass.valid_option_keys
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 []
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def [](target_expression)
raise SourceDataNotProvidedError if @source.nil?
return value_at(target_expression) if target_expression.is_a? Integer
if target_expression =~ /^CALC::(.+)$/
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate
return true if allow_blank? && target_value.split(//).size.zero?
date = parse_date(target_value)
return false unless date
- 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 load_output_spec_from_csv_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.load_output_spec_from_csv_file(file_path,
target = Anodator::OutputSpec::TARGET_ERROR,
include_no_error = false)
first = true
header = nil
- 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"