Class Chain
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Chain
attr_reader :source, :consistent_read, :key_fields_detector
include Enumerable
File chain.rb
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'key_fields_detector'
require_relative 'nonexistent_fields_detector'
require_relative 'where_conditions'
module Dynamoid
Method field_condition
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def field_condition(key, value_before_type_casting)
name, operator = key.to_s.split('.')
value = type_cast_condition_parameter(name, value_before_type_casting)
operator ||= 'eq'
- 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 delete_all
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete_all
ids = []
ranges = []
if @key_fields_detector.key_present?
- 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 query_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def query_options
opts = {}
# Don't specify select = ALL_ATTRIBUTES option explicitly because it's
# already a default value of Select statement. Explicite Select value
# conflicts with AttributesToGet statement (project option).
- 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 scan_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def scan_options
opts = {}
opts[:index_name] = @key_fields_detector.index_name if @key_fields_detector.index_name
opts[:record_limit] = @record_limit if @record_limit
opts[:scan_limit] = @scan_limit if @scan_limit
- 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 start_key
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def start_key
return @start if @start.is_a?(Hash)
hash_key = @key_fields_detector.hash_key || source.hash_key
range_key = @key_fields_detector.range_key || source.range_key
- 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"