File BlindMythos.rb
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class BlindMythos < Base
# ゲームシステムの識別子
ID = 'BlindMythos'
Method getRollResult
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def getRollResult(rerollCounts, judgeNumberText, judgeNumber, targetNumber, isReRoll, isStop)
bitList = []
successList = []
countOneList = []
rerollTargetList = []
- 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 getTotalResult
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def getTotalResult(bitList, successList, countOneList, targetNumber, isStop, canReRoll)
success = successList.inject { |sum, i| sum + i }
countOne = countOneList.inject { |sum, i| sum + i }
result = ""
- 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 getRollResult
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getRollResult(rerollCounts, judgeNumberText, judgeNumber, targetNumber, isReRoll, isStop)
bitList = []
successList = []
countOneList = []
rerollTargetList = []
Method getDurtyTableCommandReuslt
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getDurtyTableCommandReuslt(command)
return nil unless /^DT$/i =~ command
table = <<~__TABLE_END__
汚染チャートを2回振り、その効果を適用する(1・2-2,5・6-12 なら振り直す)
Method getTotalResult
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getTotalResult(bitList, successList, countOneList, targetNumber, isStop, canReRoll)
success = successList.inject { |sum, i| sum + i }
countOne = countOneList.inject { |sum, i| sum + i }
result = ""
Method getRollResult
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def getRollResult(rerollCounts, judgeNumberText, judgeNumber, targetNumber, isReRoll, isStop)
Method reRoll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reRoll(command, isStop)
debug("ReRoll Begin", command)
return nil unless /^ReRoll([\d,]+)(@(\d+))?>=(\d+)$/i =~ command
- 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 eval_game_system_specific_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
debug("eval_game_system_specific_command Begin")
result = judgeRoll(command)
return result unless result.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 getTotalResult
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def getTotalResult(bitList, successList, countOneList, targetNumber, isStop, canReRoll)
Avoid too many return
statements within this method. Open
return roll_tables(command, TABLES)
Avoid too many return
statements within this method. Open
return Result.fumble(result)
Avoid too many return
statements within this method. Open
return Result.success(result)
Avoid too many return
statements within this method. Open
return Result.failure(result)
Method getSameDieList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getSameDieList(diceList)
sameDiceList = []
diceList.uniq.each do |i|
next if i == 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 getSuccessResultText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getSuccessResultText(diceList, judgeNumber)
success = 0
countOne = 0
diceList.each do |i|
- 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"