Showing 837 of 1,278 total issues
Method getTrapTable
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getTrapTable(diff)
case diff
when "E" # 初級
dif = "初級"
d = 0
Method mk_new_name_table
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mk_new_name_table
nick_table = "1"
name_table = "1"
# 新名前表
nick_n = @randomizer.roll_once(6)
Method result_1d20
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def result_1d20(total, _dice_total, cmp_op, diff)
return Result.nothing if diff == '?'
return nil unless cmp_op == :<=
# 技能値の修正を計算する
Method torg_eternity_dice
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def torg_eternity_dice(check_pos, check_mishap)
isSkilledCritical = true
isCritical = true
skilled = 0
unskilled = 0
Method roll_general_skill
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_general_skill(command)
m = /^GS([-+][-+\d]+)?(>([-+\d]+))?/.match(command)
return nil unless m
modify = ArithmeticEvaluator.eval(m[1])
Method roll_f
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_f(command)
parser = Command::Parser.new(/F(\d+)(\+\d+)*(-\d+)*/, round_type: RoundType::CEIL)
.disable_modifier
.enable_critical
cmd = parser.parse(command)
Method roll_cf
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_cf(command)
# マイナス補正にダイスロールを用いることはシステム上ありえないため、正規表現ではじく
m = /^(H)?CF([LG])?(T)?((?:[+-]*\d+|\+?\d+D\d+)(?:[+-]+\d+|\++\d+D\d+)*)$/.match(command)
return nil unless m
Method result
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def result(value_groups)
r = Result.new
r.fumble = value_groups[0].values.all?(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 getCheckResultText
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def getCheckResultText(total, diff, fumbleable = false)
if total <= diff
return "대성공" if total == 1
return "대단한 성공" if total <= (diff / 5)
return "어려운 성공" if total <= (diff / 2)
- 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_1d20
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def result_1d20(total, _dice_total, cmp_op, target)
return Result.nothing if target == '?'
return nil unless cmp_op == :<=
if total > target
- 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 command_sn
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def command_sn(command)
debug("SN", command)
cmd = Command::Parser.new(/[1-9]?SN(\d{0,2})/, round_type: round_type)
.restrict_cmp_op_to(nil)
.enable_fumble.parse(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 roll_nr
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def roll_nr(command)
m = /^(\d+)?NR(6|8|10|12)$/.match(command)
return nil unless m
times = m[1]&.to_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 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 roll_kansoku
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def roll_kansoku(command)
m = /^KR(?:(\d+)|\((\d),(\d)\))$/.match(command)
return nil unless m
dice_size = m[1]&.to_i || m[2].to_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"
Further reading
Method get_dice
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_dice(mod, abl, skl)
total = 0
crit = 0
fumble = 0
dice_c = 3 + mod.abs
- 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 mk_new_name_table
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def mk_new_name_table
nick_table = "1"
name_table = "1"
# 新名前表
nick_n = @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 roll_d
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def roll_d(command, times, sides, target)
dice_list = @randomizer.roll_barabara(times, sides).sort
total = dice_list.sum
success = total <= target
- 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_burst
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def roll_burst(command)
m = /^(\d{2})C$/.match(command)
unless m
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 die_choice
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def die_choice(dice_list, favoured_state_value)
if favoured_state_value == FavouredState::ILLFAVOURED
if dice_list.count(SAURONS_EYE_NUMBER) >= 1
return SAURONS_EYE_NUMBER
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 getUpRollDiceCommandResult
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def getUpRollDiceCommandResult(command)
debug("Torg Eternity Dice Roll ( UP ) Command ? ", command)
m = /^UP(\d*)$/i.match(command)
unless m
return 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"