Showing 29 of 46 total issues
Method regexp_tree
has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring. Open
def regexp_tree(name=nil)
name ||= start_symbol
env = {}
each_strongly_connected_component_from(name) {|ns|
rules = {}
- 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 parser.rb
has 653 lines of code (exceeds 250 allowed). Consider refactoring. Open
unless $".index 'racc/parser.rb'
$".push 'racc/parser.rb'
self.class.module_eval(<<'...end racc/parser.rb/module_eval...', 'racc/parser.rb', 1)
#
# $Id: ad1fffef443194fdfa1052d2eee6850552f94313 $
File regexptree.rb
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'prettyprint'
require 'natset'
class RegexpTree
@curr_prec = 1
Class RegexpTree
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class RegexpTree
@curr_prec = 1
def RegexpTree.inherited(c)
return if c.superclass != RegexpTree
c.const_set(:Prec, @curr_prec)
Method regexp_tree
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
def regexp_tree(name=nil)
name ||= start_symbol
env = {}
each_strongly_connected_component_from(name) {|ns|
rules = {}
File regexp.rb
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'abnf/abnf'
require 'regexptree'
class ABNF
class TooComplex < StandardError
File natset.rb
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
class NatSet
class << NatSet
alias _new new
end
Method delete_useless!
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def delete_useless!(starts=nil)
if starts
starts = [starts] if Symbol === starts
delete_unreachable!(starts)
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 new
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def NatSet.new(*es)
r = self.empty
es.each {|e|
if String === e
e = e.ord
- 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 merge
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def merge(other)
es1 = @es.dup
es2 = other.es.dup
es0 = []
bool1 = bool2 = bool0 = false
- 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
Class NatSet
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class NatSet
class << NatSet
alias _new new
end
Method pretty_format
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def pretty_format(out)
case @natset
when None; out.text '(?!)'
when Any; out.text '[\s\S]'
when NL; out.text '\n'
- 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 recursion
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def recursion(syms, lhs)
case @elts.length
when 0
NonRecursion
when 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"
Further reading
Method merge
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge(other)
es1 = @es.dup
es2 = other.es.dup
es0 = []
bool1 = bool2 = bool0 = false
Method pretty_format
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pretty_format(out)
case @natset
when None; out.text '(?!)'
when Any; out.text '[\s\S]'
when NL; out.text '\n'
Method delete_useless!
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_useless!(starts=nil)
if starts
starts = [starts] if Symbol === starts
delete_unreachable!(starts)
end
Method new
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def NatSet.new(*es)
r = self.empty
es.each {|e|
if String === e
e = e.ord
Method alt
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def RegexpTree.alt(*rs)
rs2 = []
rs.each {|r|
if r.empty_set?
next
- 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 new
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def Alt.new(*elts)
elts2 = []
elts.each {|e|
if e.empty_set?
next
- 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_format
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pretty_format(out)
@r.parenthesize(Elt).pretty_format(out)
case @m
when 0
case @n