Showing 171 of 292 total issues
Method read_component_element
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_component_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 initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, min_length, max_length, precision, description = nil, parent = nil)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, min_length, max_length, code_list = nil, description = nil, parent = nil)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, min_length, max_length, max_precision = nil, description = nil, parent = nil)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(separators, segment_dict, instructions, zipper, children, gs01, gs08)
Avoid deeply nested control flow statements. Open
unless o <= components
raise ArgumentError,
"repeatable composite element #{descriptor} only has #{components} components"
end
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, min_length, max_length, description = nil, parent = nil)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, description, component_uses, syntax_notes, parent)
Method read_segment
has a Cognitive Complexity of 8 (exceeds 5 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)
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, min_length, max_length, description = nil, parent = nil)
Avoid deeply nested control flow statements. Open
unless __value.eql?(__state.node.zipper)
__state = __state.replace(__state.node.copy(:zipper => __value))
end
Method process
has a Cognitive Complexity of 8 (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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, purpose, element_uses, syntax_notes, parent)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, name, min_length, max_length, description = nil, parent = nil)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, position, header_segment_uses, loop_defs, trailer_segment_uses, parent)
Avoid deeply nested control flow statements. Open
if element_zip.node.blank?
Either.failure("repeatable composite element #{descriptor} does not occur")
elsif occurs_count < n
Either.failure("repeatable composite element #{descriptor} only occurs #{occurs_count} times")
else
Method process
has a Cognitive Complexity of 8 (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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def segment(pos, type, name, requirement, repeat, &block)
Method Segment
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Segment(position, segment_def, name, requirement, repeat_count, *elements)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, repeat_count, header_segment_uses, loop_defs, trailer_segment_uses, parent)