File Satasupe.rb
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "bcdice/game_system/satasupe/tables"
module BCDice
module GameSystem
class Satasupe < Base
Method check_roll_loop
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def check_roll_loop(roll_times, min_suc, target, critical, fumble, is_critical_stop)
dice_str = ''
is_fumble = false
is_critical = false
total_suc = 0
- 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 checkRoll
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def checkRoll(string)
debug("checkRoll begin string", string)
m = /^(\d+)R>=(\d+)(\[(\d+)?(,|,\d+)?(,\d+(S)?)?\])?$/i.match(string)
return nil unless m
Method checkRoll
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def checkRoll(string)
debug("checkRoll begin string", string)
m = /^(\d+)R>=(\d+)(\[(\d+)?(,|,\d+)?(,\d+(S)?)?\])?$/i.match(string)
return nil unless m
- 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 getCreateSatasupeResult
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getCreateSatasupeResult(counts)
debug("getCreateSatasupeResult counts", counts)
name = "サタスペ作成"
Method check_roll_loop
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_roll_loop(roll_times, min_suc, target, critical, fumble, is_critical_stop)
dice_str = ''
is_fumble = false
is_critical = false
total_suc = 0
Method get_roll_params
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_roll_params(params)
min_suc = 0
fumble = 1
critical = 13
isCriticalStop = 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
Method check_roll_loop
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_roll_loop(roll_times, min_suc, target, critical, fumble, is_critical_stop)
Method check_seigou
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_seigou(string)
debug("check_seigou begin string", string)
sr_parser = Command::Parser.new("SR", round_type: round_type)
.has_suffix_number
- 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"