File BeastBindTrinity.rb
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bcdice/arithmetic_evaluator'
require 'bcdice/format'
require 'bcdice/normalize'
require 'bcdice/dice_table/table'
require 'bcdice/dice_table/d66_grid_table'
Method roll
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll(randomizer)
if @parse_error
return nil
end
Method parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse()
m = /^(\d+)(?:R6|BB6?)((?:[+-]\d+)+)?(?:%(-?\d+))?(?:@([+\-\d]+))?(?:#(A)?([+\-\d]+))?(?:\$([1-6]+))?(?:&([1-6]))?(?:([>=]+)(\d+))?$/.match(@command)
unless m
@parse_error = true
return
- 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 roll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def roll(randomizer)
if @parse_error
return nil
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 parse_critical
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_critical(humanity, atmark)
humanity = humanity ? humanity.to_i : 99
atmark_value = atmark ? ArithmeticEvaluator.eval(atmark) : 0
critical =
- 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 calc_total
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def calc_total
total = @dice_total + @modify_number
if fumble?
total = 0 unless @keep_value_on_fumble
elsif critical?
- 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"