Showing 837 of 1,278 total issues
Method roll_basic_battle
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def roll_basic_battle(command)
m = /^BB(M)?([-+][-+\d]+)?(>([-+\d]+))?/.match(command)
return nil unless m
mob = m[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 getDamageResult
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getDamageResult(command)
biggun = [0, 0, 0]
case command
when /^DC(\d+)(\[(\d+)(,(\d+))?(,(\d+))?(,(\d+))?(,(\d+))?(,(\d+))?\])?$/i
Method initiative_roll
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initiative_roll(command)
m = /^(\d+\.?\d*)?(INTI|inti)([+-](\d+))?(#(\d+))?/.match(command)
unless m
return nil
end
Method getJudgeResult
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getJudgeResult(command)
case command
when /^(\d+)?D20<=(\d+)?(\[(\d+)(,(\d+))?\])?(@(\d+))?$/i
number = (Regexp.last_match(1) || 1).to_i # ダイス数。省略時は1
target = (Regexp.last_match(2) || 14).to_i # 目標値。省略時は14 if 空白 then 14 else 記載の値
Method getWeaponTable
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getWeaponTable(weaponCommand)
debug('getWeaponTable weaponCommand', weaponCommand)
case weaponCommand.upcase
when 'SW'
Method eval_game_system_specific_command
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
string = command.upcase
string = replace_text(string)
if (result = torg_check(string))
Method getExtraTableResult
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getExtraTableResult(type)
tableName = translate("KillDeathBusiness.EXT.name")
extraTable1 = [
[11, translate("KillDeathBusiness.EXT.table1.11")],
[12, translate("KillDeathBusiness.EXT.table1.12")],
Method eval_game_system_specific_command
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
case command
when /\AFF/
# 対抗なしロール
# '成功' or '失敗' を出力する
Method getCreateNpcDiceCommandResult
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getCreateNpcDiceCommandResult(command)
return nil unless command =~ /^CNP$/
name = "NPC作成表"
table = [
Method skill_roll
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def skill_roll(command)
m = /^CC([-+]?\d+)?(?:<=(\d+)([RHEC])?)?$/.match(command)
unless m
return nil
end
Method parse
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(command)
scanner = StringScanner.new(command)
scanner.skip(/\s+/)
secret = !scanner.scan(/S/i).nil?
Method eval_game_system_specific_command
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
m = /\A(\d+)?(YZE|MYZ)(\d+)((\+|-)(\d+))?(\+(\d+))?/.match(command)
unless m
return ''
end
Method eval_game_system_specific_command
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(string)
string = replace_text(string)
unless /(^|\s)S?((\d+)[rR]6([+\-\d]+)?([>=]+(\d+))(\[(\d)\]))(\s|$)/i =~ string
return nil
Method get_roll_result
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_roll_result(result_text, success_dice, ten_dice, _desperaton_ten_dice, desperaton_botch_dice, difficulty)
result_text = "#{result_text} 成功数=#{success_dice}"
is_critical = ten_dice >= 2
desperation_result = ""
Method eval_game_system_specific_command
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
debug("eval_game_system_specific_command Begin")
parser = Command::Parser.new('SBS', 'SB', round_type: round_type)
.enable_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 getJudgeResult
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def getJudgeResult(command)
case command
when /^(\d+)?D20<=(\d+)?(\[(\d+)(,(\d+))?\])?(@(\d+))?$/i
number = (Regexp.last_match(1) || 1).to_i # ダイス数。省略時は1
target = (Regexp.last_match(2) || 14).to_i # 目標値。省略時は14 if 空白 then 14 else 記載の値
- 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 getRandomEvent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def getRandomEvent(dice1, dice2, diff)
case diff
when "E"
dif = "初級"
d = 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 result_1d100
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def result_1d100(total, _dice_total, cmp_op, target)
return nil unless cmp_op == :<=
if total >= 100
Result.fumble("ファンブル")
- 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 getReactionText
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def getReactionText(name, typeText1, typeText2, infos1, infos2)
return nil unless checkTypeText(typeText1, infos1)
return nil unless checkTypeText(typeText2, infos2)
ten_value = @randomizer.roll_once(6)
- 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 result_nd6
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def result_nd6(total, dice_total, dice_list, cmp_op, target)
return Result.nothing if target == '?'
return nil unless dice_list.size == 3 && cmp_op == :<=
success = target - total # 成功度
- 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"