Showing 171 of 292 total issues
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(separators, segment_dict, instructions, zipper, children)
Method register
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def register(gs08, gs01, st01, definition = nil, &constructor)
Method push
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def push(zipper, parent, segment_tok, segment_use, config)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(segment_id, segment_use, pop, drop, push)
Method push
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def push(zipper, parent, segment_tok, segment_use, config)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(separators, segment_dict, instructions, zipper, children)
Method read_delimiter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_delimiter
position = 0
while @input.defined_at?(position)
character = @input.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 7 (exceeds 5 allowed). Consider refactoring. Open
def pretty_print(q)
if @children.empty?
id = definition.try do |d|
ansi.bold("[#{d.id.to_s}: #{d.name.to_s}]")
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 value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def value(object, usage, position)
if object.is_a?(StringVal)
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 consume
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def consume(s)
return success(self) if s.empty?
position = 0
buffer = " " * s.length
- 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 deconstruct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def deconstruct(element_toks, m, n)
element_tok = element_toks.at(m)
element_tok = element_tok.element_toks.at(0) if element_tok.try(:repeated?)
if element_tok.blank?
- 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(hour, minute, second, usage, position)
@hour, @minute, @second = hour, minute, second
valid = ( hour.nil? or hour.between?(0, 24))
valid &&= (minute.nil? or not hour.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_composite_element
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_composite_element(repeatable = false)
read_component_elements(repeatable).flatmap do |components, aR|
token = composite(components, @input, aR.input)
aR.read_delimiter.flatmap do |delim, bR|
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def process
return unless owner.is_a?(Hash)
return unless statement.first
parse_block(statement.first, owner: owner.merge(source: statement.source))
- 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_isa
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def consume_isa
position = 0
buffer = " "
# @todo: This would probably more optimal if it was written like
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def build(instructions)
if instructions.length <= 1
ConstraintTable::Stub.new(instructions)
elsif instructions.any?{|i| i.segment_use.nil? } and
not instructions.all?{|i| i.segment_use.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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(id, name, min_length, max_length, description = nil, parent = nil)
super(id, name, min_length, max_length, description)
unless min_length == 2 or min_length == 4 or min_length >= 6
raise Exceptions::InvalidSchemaError,
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def value(object, usage, position)
if object.is_a?(FixnumVal)
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 mkelement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mkelement(designator, element_use, element_tok)
if element_use.simple?
if element_use.repeatable?
element_toks = element_tok.element_toks
element_vals = element_toks.map do |element_tok1|
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def process
describes = statement.tokens.to_s[MATCH, 1].gsub(/["']/, '')
# Remove the argument list from describe "#method(a, b, &c)"
if arguments = describes[/[#.](?:.+?)(\([^)]*\))$/, 1]
- 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"