Showing 189 of 197 total issues
Method used_iterators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def used_iterators
return @_used_iterators if @_used_iterators
specs_atoms =
if reaction.clean_links.empty?
concretizable? ? lateral_chunks.targets.to_a : []
- 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 purge_unused_extended_specs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def purge_unused_extended_specs(base_specs_cache, specific_specs_cache)
extended_specs = specific_specs_cache.select do |_, spec|
!spec.simple? && spec.could_be_reduced?
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 fix_instance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fix_instance(instance, &block)
if instance.is_a?(Array)
if instance.one?
instance.first
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 swap_chunk
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def swap_chunk(variants, from, to)
swap_lambda = -> chunk { chunk == from ? to : chunk }
variants.each_with_object({}) do |(cmb, chunk), acc|
new_cmb = cmb.include?(from) ? cmb.map(&swap_lambda) : cmb
acc[new_cmb] = swap_lambda[chunk]
- 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 using
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def using(vars)
if vars.include?(self)
[name] + (@index ? @index.using(vars - [self]) : [])
elsif @index # do not use #item? here
holders = vars.select { |v| v.parent_arr?(self) }
- 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 swap_on
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def swap_on(target, from, to, reverse_too: true)
var = instance_variable_get(:"@#{target}")
idx = var.index(from)
var[idx] = to if idx
- 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 rate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rate(reaction)
temp = current_temperature(reaction.gases_num) # TODO: in engine always using
# the surface temperature
arrenius = reaction.rate * (temp ** reaction.temp_power) *
Math.exp(-reaction.activation / (Dimension::R * temp))
- 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 same?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def same?(other)
return false unless links.size == other.links.size
return false unless self.class == other.class && owner.same?(other.owner)
intersec = mirror_to(other)
- 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 atomic_dangling
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def atomic_dangling
if @_atomic_dangling.nil?
another_danglings = props.flat_map(&:danglings).uniq - [ACTIVE_BOND]
@_atomic_dangling = another_danglings.one? ? another_danglings.first : false
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"