Showing 14 of 36 total issues
Method tokenize
has a Cognitive Complexity of 130 (exceeds 5 allowed). Consider refactoring. Open
def tokenize(data)
data = data.unpack("c*") if(data.is_a?(String))
eof = data.length
token_array = []
- 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 tokenize
has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring. Open
def tokenize(data)
data = data.unpack("c*") if(data.is_a?(String))
eof = data.length
token_array = []
- 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 tokenize
has 215 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tokenize(data)
data = data.unpack("c*") if(data.is_a?(String))
eof = data.length
token_array = []
Method initialize
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
# line 21 "lib/manamana/tdsl/lexer.rb"
class << self
attr_accessor :_lexer_actions
Method tokenize
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tokenize(data)
data = data.unpack("c*") if(data.is_a?(String))
eof = data.length
token_array = []
Method initialize
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
# line 20 "lib/manamana/rdsl/lexer.rb"
class << self
attr_accessor :_lexer_actions
File lexer.rb
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ManaMana
module RDSL
class Lexer
File lexer.rb
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ManaMana
module TDSL
class Lexer
File parser.rb
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'racc/parser.rb'
require 'manamana/rdsl/lexer'
require 'manamana/rdsl/nodes'
Method translate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def translate(requirement)
spec = ""
spec << " describe %Q%#{ requirement }% do\n"
spec << " before do\n"
Avoid deeply nested control flow statements. Open
case _lexer_actions[_acts - 1]
when 3 then
# line 1 "NONE"
begin
te = p+1
Avoid deeply nested control flow statements. Open
case _lexer_actions[_acts - 1]
when 2 then
# line 1 "NONE"
begin
te = p+1
Method recursive_require
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def recursive_require(in_dir)
Dir.entries(in_dir).each do |entry|
next if ['.', '..'].include? entry
path = File.join(in_dir, entry)
- 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 load_files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load_files(in_dir, lines = '')
Dir.entries(in_dir).each do |entry|
next if ['.', '..'].include? entry
path = File.join(in_dir, entry)
- 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"