Showing 171 of 292 total issues
Method pretty_print
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def pretty_print(q)
q.text("LoopDef[#{@id}]")
q.group(2, "(", ")") do
q.breakable ""
@header_segment_uses.each do |e|
- 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 read_simple_element
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def read_simple_element(repeatable = false)
position = 0
buffer = ""
while @input.defined_at?(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 pretty_print
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def pretty_print(q)
q.text("TableDef[#{@id}]")
q.group(2, "(", ")") do
q.breakable ""
@header_segment_uses.each do |e|
- 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 mksegments
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mksegments(table)
disjoint, = table.basis(table.instructions, :insert)
remaining = Set.new(table.instructions)
segment_id = table.instructions.head.segment_use.id
segments = []
Method only
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def only(machine, depth=1)
active = machine.active.map do |state|
value = state.node.zipper
_value = value; depth.times { _value = _value.up }
Method sequence
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sequence(segment_uses, offset = 0)
instructions = []
buffer = []
last = nil
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process
params = []
if m = MATCH_A.match(statement.tokens.to_s)
name = m.captures.first
Method lsequence
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def lsequence(loop_defs, offset = 0)
instructions = []
buffer = []
last = nil
Method segment!
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def segment!(name, position, *elements)
segment_tok = mksegment_tok(@reader.segment_dict, name, elements, position)
machine, reader = @machine.insert(segment_tok, @strict, @reader)
if @strict
Method pretty_print
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def pretty_print(q)
q.text("InterchangeDef[#{id}]")
q.group(2, "(", ")") do
q.breakable ""
@header_segment_uses.each do |e|
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def element(e, separators, out)
if e.simple?
out << e.to_x12
elsif e.composite?
- 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 pretty_print
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def pretty_print(q)
q.text("FunctionalGroupDef")
q.group(2, "(", ")") do
q.breakable ""
@header_segment_uses.each do |e|
- 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 inspect
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def inspect
id = definition.bind do |d|
"[#{"% 5s" % d.id}: #{d.name}]".bind do |s|
if usage.forbidden?
ansi.forbidden(s)
- 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 read
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def read(reader, options = {})
limit = options.fetch(:nondeterminism, 1)
machine = self
reader_e = reader.read_segment
- 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 mkrepeated_tok
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def mkrepeated_tok(elements, element_use, designator, position)
element_toks = []
if element_use.composite?
elements.each do |e_tag, e_val, e_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 binary_operators
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def binary_operators(*ops)
file, line, = Stupidedi.caller
if ops.last.is_a?(Hash)
options = ops.pop
Method read_segment
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_segment
consume_isa.flatmap do |rest|
# The character after "ISA" is defined to be the element separator
rest.read_character.flatmap do |char, aR|
separators = Separators.new(nil, nil, char, nil)
Method relational_operators
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def relational_operators(*ops)
file, line, = Stupidedi.caller
if ops.last.is_a?(Hash)
options = ops.pop
Method to_x12
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_x12(truncate = true)
remaining =
if @value.to_i.zero?
definition.max_length
else
Method value
has 31 lines of code (exceeds 25 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)