Showing 171 of 292 total issues
Method __find
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
def __find(invalid, id, elements, assert_repeatable = false)
reachable = false
repeatable = false
matches = []
filter_tok = 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 element
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def element(m, n = nil, o = nil)
if m <= 0 or (n || 1) <= 0 or (o || 1) <= 0
raise ArgumentError,
"all arguments must be positive"
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 critique
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def critique(zipper, recursive = false, position = false)
if zipper.node.simple? or zipper.node.component?
if zipper.node.invalid?
raise Exceptions::ParseError,
"invalid #{zipper.node.descriptor} at #{zipper.node.position.inspect}"
- 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
File navigation.rb
has 449 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Stupidedi
using Refinements
module Parser
module Navigation
Method matches
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def matches(segment_tok, strict, mode)
invalid = true # Were all present possibly distinguishing elements invalid?
present = false # Were any possibly distinguishing elements present?
disjoint, distinct = basis(@instructions, mode)
- 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 value
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def value(object, usage, position)
if object.is_a?(TimeVal)
object#.copy(:usage => usage, :position => position)
elsif object.blank?
self::Empty.new(usage, position)
- 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
File dt.rb
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Stupidedi
using Refinements
module Versions
module Common
Method mksegment_tok
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def mksegment_tok(segment_dict, id, elements, position)
id = id.to_sym
element_toks = []
unless segment_dict.defined_at?(id)
- 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 Segment
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def Segment(position, segment_def, name, requirement, repeat_count, *elements)
unless elements.length == segment_def.element_uses.length
raise Exceptions::InvalidSchemaError,
"segment #{segment_def.id} has #{segment_def.element_uses.length}" +
" elements but #{elements.length} arguments were given"
- 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
File token_reader.rb
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Stupidedi
using Refinements
module Reader
class TokenReader
Method step
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def step(machine)
machine.successors.head.constraints.each do |segment_id, table|
case table
when Stupidedi::Parser::ConstraintTable::Shallowest,
Stupidedi::Parser::ConstraintTable::Deepest
- 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 build
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def build(node, out)
if node.element?
if node.composite?
tmp = StringIO.new
node.children.each{|e| build(e, tmp) }
- 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 step
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def step(machine)
machine.successors.head.constraints.each do |segment_id, table|
case table
when Stupidedi::Parser::ConstraintTable::Shallowest,
Stupidedi::Parser::ConstraintTable::Deepest
Method critique
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
def critique(zipper, recursive = false, position = false)
if zipper.node.simple? or zipper.node.component?
if zipper.node.invalid?
raise Exceptions::ParseError,
"invalid #{zipper.node.descriptor} at #{zipper.node.position.inspect}"
Class TokenReader
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class TokenReader
# @private
SEGMENT_ID = /\A[A-Z][A-Z0-9]{1,2}\Z/
include Inspect
Method __find
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __find(invalid, id, elements, assert_repeatable = false)
reachable = false
repeatable = false
matches = []
filter_tok = nil
Method element
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def element(m, n = nil, o = nil)
if m <= 0 or (n || 1) <= 0 or (o || 1) <= 0
raise ArgumentError,
"all arguments must be positive"
end
Method value
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def value(object, usage, position)
if object.is_a?(DateVal)
object#.copy(:usage => usage, :position => position)
elsif object.blank?
self::Empty.new(usage, position)
- 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 process
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def process
name = statement.parameters.first.jump(:symbol, :ident).source.slice(1..-1)
args = statement.parameters.jump(:assoc)
params = []
- 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 recurse
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def recurse(value, separators, out)
return if value.invalid?
if value.segment?
segment(value, separators, out)
- 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"