analyzer/lib/organizers/atom_classifier.rb
Class AtomClassifier
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AtomClassifier
# Initialize a classifier by empty sets of properties
# @param [Array] danglings the list of termination species
def initialize(danglings = [])
File atom_classifier.rb
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module VersatileDiamond
module Organizers
# Classifies atoms in specs and associate each atom type with some value,
# which will be used for detecting overlapping specs between each other
Method store_all
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def store_all(prop, termination, &block)
result = []
next_prop = prop
loop do
next_prop = block[next_prop, termination]
- 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
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"