Class SpecificSpec
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class SpecificSpec
include Modules::RelationBetweenChecker
include Modules::GraphDupper
include BondsCounter
extend Forwardable
Method swap_atom
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def swap_atom(from, to)
original_links = dup_graph(links, &:itself)
find_proc = -> atom { @specific_atoms.find { |_, a| a == atom } }
pair = find_proc[from]
if pair
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(spec, specific_atoms = {})
spatoms = specific_atoms.map do |atom_keyname, specific_atom|
atom = spec.atom(atom_keyname)
unused_bonds = spec.external_bonds_for(atom) -
specific_atom.actives - specific_atom.monovalents.size
- 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 reduced
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reduced
return unless extended?
return @correct_reduced if @correct_reduced
@correct_reduced = @reduced.dup
- 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 collect_states
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def collect_states(atom, atom_method, state_method = nil)
atom_keyname = keyname(atom)
states = atom.send(atom_method)
states.empty? ?
[] :
- 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"