Showing 837 of 1,278 total issues
Method eval
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def eval(game_system, randomizer)
dice = @notation.to_dice(game_system.round_type)
unless dice.valid?
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 getResultText
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def getResultText(rating_total, command, diceResults, diceResultTotals,
rateResults, dice_total, round)
Method checkRoll
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def checkRoll(diceCount, modify, critical, fumble, target, isStormy, optionalText)
Method get_rg_roll_result
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_rg_roll_result(result_header_text, difficulty, feat_die_number, piercing_blows_number, total_dice_number, success_count, opts)
Method checkRoll
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def checkRoll(rollText, target, modify, accidentValue, advancedRoll, luckPoint, isMuse)
Method roll_sp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def roll_sp(command)
m = /^SP(\d+)(?:>=(\d+))?$/i.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 eval_game_system_specific_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
string = command.upcase
string = replace_text(string)
if (result = torg_check(string))
- 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
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_roll(command, base, target, critical_target, diff, modifier)
Method getCombineRoll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getCombineRoll(command)
m = /^CBR(B)?\((\d+),(\d+)\)$/i.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 rollFullAuto
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def rollFullAuto(bullet_count, diff, broken_number, dice_num)
output = ""
loopCount = 0
counts = {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def roll(randomizer)
dice = randomizer.roll_once(@items.length)
chosen = @items[dice - 1]
fumble = chosen == 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 eval_game_system_specific_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
# AA/ALコマンド:調査判定, 成功判定
if command =~ /(\d+)?A(A|L)(\d+)?((x|\*)(\d+)(\+(\d+))?)?(C(\d+))?$/i
diceCount = (Regexp.last_match(1) || 2).to_i
target = (Regexp.last_match(3) || 6).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 check_action
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_action(match_data)
dice_cnt = Arithmetic.eval(match_data[1], RoundType::FLOOR)
target = Arithmetic.eval(match_data[2], RoundType::FLOOR)
debug("dice_cnt", dice_cnt)
debug("target", 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 eval_game_system_specific_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
unless parse(command)
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 getDamages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getDamages(damageFunc, partTable, damages)
resultText = ''
damage, dice, isLrm = damageFunc.call()
damagePartCount = 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 getTotalDamage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getTotalDamage(damages)
parts = ['頭',
'胴中央',
'右胴',
'左胴',
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def result_1d100(total, _dice_total, cmp_op, target)
return nil if target == '?'
return nil if cmp_op != :<=
if total >= 100
- 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_text
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def result_text(total, cmp_op, target)
return nil unless cmp_op == :>=
if target != "?"
return 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 get_judge_result
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_judge_result(command)
return nil unless (m = /^2D6<=(\d)$/i.match(command) || /^SN(\d*)$/i.match(command))
debug("====get_judge_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 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')
unless command =~ /^R(\d+)(,(\d+))?([+\-\d]+)?(>=(\d+))?/
debug('unmatched!')
- 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"