Showing 837 of 1,278 total issues
Method result_nd6
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def result_nd6(total, dice_total, value_list, cmp_op, target); end
Method check_nD10
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_nD10(total, dice_total, dice_list, cmp_op, target); end
Method result_nd10
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def result_nd10(total, _dice_total, value_list, cmp_op, target)
Method result_nd10
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def result_nd10(total, dice_total, value_list, cmp_op, target); end
Method check_2D6
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_2D6(total, dice_total, dice_list, cmp_op, target); end
Method result_2d6
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, value_list, cmp_op, target); end
Method check_nD6
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_nD6(total, dice_total, dice_list, cmp_op, target); end
Method eval_game_system_specific_command
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command) # ダイスロールコマンド
# 通常判定部分をgetJudgeResultコマンドに切り分け
result = getJudgeResult(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 result_2d6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, _dice_list, cmp_op, target)
return nil unless cmp_op == :<=
if dice_total <= 2
Result.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 result_2d6
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, _dice_list, cmp_op, target)
return nil unless cmp_op == :>=
if dice_total <= 2
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 check_roll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_roll(string)
parser = Command::Parser.new(/RC\d+/, round_type: round_type)
.restrict_cmp_op_to(nil)
cmd = parser.parse(string)
return nil unless cmd
- 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 compare_result
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def compare_result(success)
if success < 0
Result.fumble(translate("fumble"))
elsif success == 0
Result.failure(translate("failure"))
- 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 getCombineRoll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def getCombineRoll(command)
return nil unless /CBR\((\d+),(\d+)\)/i =~ command
diff_1 = Regexp.last_match(1).to_i
diff_2 = Regexp.last_match(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 check_roll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_roll(dice_count, count_no)
dice_array = @randomizer.roll_barabara(dice_count, 10).sort
dice_text = dice_array.join(',')
result_array = []
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def checkRoll(diceCount, target, damage)
target = 1 if target < 1
target = 10 if target > 10
diceArray = @randomizer.roll_barabara(diceCount, 10).sort
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(string)
cmd = parse_nw(string) || parse_2r6(string)
unless cmd
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 check_action
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_action(command)
m = /^(\d+)(?:NC|D6?)((?:[-+]\d+)*)(>=(\d+))?$/i.match(command)
dice_count = m[1].to_i
modify_str = m[2]
modify_number = ArithmeticEvaluator.eval(modify_str)
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def roll(randomizer)
dice = randomizer.roll_once(6)
chosen = TABLE[dice - 1]
Result.new.tap do |r|
- 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 proc_dice_2nd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def proc_dice_2nd(match)
output_text = ''
total_success_num = 0
difficulty = DIFFICULTY_SYMBOL_TO_INTEGER.fetch(match[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 consciousness_roll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def consciousness_roll(damage)
unless (1..6).include?(damage)
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"