Showing 171 of 292 total issues
Method lsequence
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def lsequence(loop_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"
Further reading
Method process
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process
return unless owner.is_a?(Hash)
return unless owner[:source] and 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 process
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process
params = []
if m = MATCH_A.match(statement.tokens.to_s)
name = m.captures.first
- 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 mksegment_tok
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mksegment_tok(segment_dict, id, elements, position)
id = id.to_sym
element_toks = []
unless segment_dict.defined_at?(id)
Method hipaa
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def hipaa(base = default)
base.customize do |c|
c.transaction_set.customize do |x|
x.register("004010", "HP", "835") { Stupidedi::TransactionSets::FortyTen::Standards::HP835 }
x.register("004010X091A1", "HP", "835") { Stupidedi::TransactionSets::FortyTen::Implementations::X091A1::HP835 }
Method mod_element
has 44 lines of code (exceeds 25 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
Method build_distinct
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def build_distinct(total, n, m, instructions)
if total.finite?
# The sum of all allowed value sets is finite, so we know that each
# individual allowed value set is finite (we can iterate over it).
map = Hash.new{|h,k| h[k] = [] }
- 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_segment
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def read_segment
consume_control_chars.flatmap do |start|
# We might start reading a segment at "\nNM1...", where the "\n" is on
# line 5, but "NM1" is on line 6. So to ensure the segment position is
# line 6, we start with consume_control_characters.
- 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_disjoint
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def build_disjoint(total, n, m, instructions)
if total.finite?
# The sum of all allowed value sets is finite, so we know that each
# individual allowed value set is finite (we can iterate over it).
map = Hash.new
- 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 count
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def count(*args)
if block_given?
inject(0){|n, e| yield(e) ? n + 1 : n }
elsif args.empty?
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 consume_prefix
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def consume_prefix(s)
return success(self) if s.empty?
position = 0
buffer = ""
- 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 parent
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def parent
active = []
@active.each do |zipper|
state = zipper
- 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 a Cognitive Complexity of 13 (exceeds 5 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]
- 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 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process
name = statement.parameters.first.jump(:symbol, :ident).source.slice(1..-1)
args = statement.parameters.jump(:assoc)
params = []
Method basis
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def basis(instructions, mode)
@__basis[mode] ||= begin
# When inserting segments, given a choice between two otherwise
# equivalent instructions, prefer the one with smallest `pop_count`.
# For example, when inserting an HL*20 in X221 835, the new 2000A
Method value
has 36 lines of code (exceeds 25 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)
Method tsequence
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tsequence(table_defs, offset = 0)
instructions = []
buffer = []
last = nil
Method optional_elements
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def optional_elements(disjoint, instructions)
designators = []
disjoint.each do |(m, n), map|
required = 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 pretty_print
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def pretty_print(q)
id = definition.bind do |d|
"[#{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 mksimple
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def mksimple(designator, element_use, element_tok)
# We don't validate that element_tok is simple because the TokenReader
# will always produce a SimpleElementTok given a SimpleElementUse from
# the SegmentDef. On the other hand, the BuilderDsl API will throw an
# exception if the programmer constructs the wrong kind of element
- 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"