Showing 171 of 292 total issues
Method mksegments
has a Cognitive Complexity of 20 (exceeds 5 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 = []
- 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 to_x12
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def to_x12(truncate = true)
remaining =
if @value.to_i.zero?
definition.max_length
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
File ambiguity.rb
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Stupidedi
using Refinements
module TransactionSets
module Validation
Method read_segment_id
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def read_segment_id
position = 0
buffer = ""
while true
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def process
return unless owner.is_a?(Hash)
return unless owner[:describes]
node = YARD::Registry.resolve(nil, owner[:describes], true)
- 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 18 (exceeds 5 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
- 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 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build(node, out)
if node.element?
if node.composite?
tmp = StringIO.new
node.children.each{|e| build(e, tmp) }
File an.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Stupidedi
using Refinements
module Versions
module Common
Method Segment
has 53 lines of code (exceeds 25 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"
Method mod_element
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def mod_element(element_use, descriptor, requirement, name, arguments)
unless requirement.is_a?(Schema::ElementReq)
raise Exceptions::InvalidSchemaError,
"first argument to Element must be a Schema::ElementReq but got #{requirement.inspect} for #{descriptor}"
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 __filter?
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def __filter?(filter_tok, invalid_val)
return true unless filter_tok.id == invalid_val.id
children = invalid_val.segment_tok.element_toks
filter_tok.element_toks.zip(children) do |f_tok, e_tok|
- 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 filter?
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def filter?(filter_tok, segment_val)
return true unless filter_tok.id == segment_val.id
filter_tok.element_toks.zip(segment_val.children) do |f_tok, e_val|
if f_tok.simple?
- 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 between
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def between(other)
# Collect ancestors of self, sorted oldest first (deepest last). This
# forms a boundary of nodes, which is called a "spine" below
zipper = self
lspine = [self]
File tm.rb
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Stupidedi
using Refinements
module Versions
module Common
Method matches
has 49 lines of code (exceeds 25 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)
Method next
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def next(count = 1)
unless count > 0
raise ArgumentError,
"count 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 sequence
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def sequence(segment_uses, offset = 0)
instructions = []
buffer = []
last = 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 read_elements
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def read_elements(segment_id, element_uses)
if element_uses.empty?
read_simple_element
else
element_use = element_uses.head
- 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 prev
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def prev(count = 1)
unless count > 0
raise ArgumentError,
"count 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 tsequence
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def tsequence(table_defs, offset = 0)
instructions = []
buffer = []
last = 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"