Showing 837 of 1,278 total issues
Method roll_action
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def roll_action(command)
m = /^(\d+)?(AI|CA)$/.match(command)
return nil unless m
is_senpai = m[2] == "AI"
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
def checkRoll(diceCount, modify, type, target)
diceArray = @randomizer.roll_barabara(diceCount, 6).sort
dice = diceArray.sum()
diceText = diceArray.join(",")
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
def result_1d100(total, _dice_total, cmp_op, target)
return nil if target == '?'
return nil unless cmp_op == :<=
dice_value = total % 100 # 出目00は100ではなく00とする
- 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 judgeDice
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def judgeDice(command)
fumble_match = /,(\d+)$/.match(command)
parser = Command::Parser.new(/JD\d+/, round_type: round_type)
.enable_critical
Method checkAnyCommand
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def checkAnyCommand(command)
result =
case command.upcase
when 'RBT'
getClassRoomBreakTable
File RyuTuber.rb
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "bcdice/dice_table/table"
module BCDice
module GameSystem
class RyuTuber < Base
File GundogRevised.rb
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bcdice/game_system/Gundog'
module BCDice
module GameSystem
class GundogRevised < Base
Method eval_game_system_specific_command
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
debug("eval_game_system_specific_command Begin")
parser = Command::Parser.new('VT', round_type: round_type)
.enable_critical
Method cp_roll_result
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cp_roll_result(command)
parser = Command::Parser.new('CP', round_type: RoundType::FLOOR)
.enable_suffix_number
.restrict_cmp_op_to(nil, :>)
parsed = parser.parse(command)
Method check_strike_rank
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_strike_rank(strikeRank)
strikeRank = strikeRank.to_i
dice = ''
dice_add = ''
Method check_action
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_action(command)
parser = Command::Parser.new(/!?VC/, round_type: RoundType::FLOOR)
.enable_critical
.enable_fumble
.restrict_cmp_op_to(nil, :>=)
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 proc_nrs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def proc_nrs(dice_num, dificulty_s, type)
# 難易度も乱数表の番号も指定が無ければコマンドミス
dificulty_i = dificulty_s.nil? ? 0 : DIFFICULTY_SYMBOL_TO_INTEGER.fetch(dificulty_s)
if dificulty_i == 0 && type == 0
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"
Further reading
Method result_2d6
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def result_2d6(total, dice_total, _dice_list, cmp_op, target)
return Result.nothing if target == '?'
return nil unless [:>=, :>].include?(cmp_op)
critical = false
- 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_pools
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_dice_pools(m)
rage_dice_included_command = m[COMMAND_RAGE_DICE_INCLUDED_INDEX]
if rage_dice_included_command && rage_dice_included_command == "WAI"
# Rage Diceを内数処理するの場合
rage_dice_pool = m[RAGE_DICE_INCLUDED_INDEX].nil? ? -1 : m[RAGE_DICE_INCLUDED_INDEX].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 mk_item_features_table
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def mk_item_features_table(num)
output = ""
dice = @randomizer.roll_sum(2, 6)
if num <= 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 getFullAutoResult
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def getFullAutoResult(command)
m = /^FAR\((-?\d+),(-?\d+),(-?\d+)(?:,(-?\d+)?)?(?:,(-?\w+)?)?(?:,(-?\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 get_dice_pools
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_dice_pools(m)
hunger_dice_included_command = m[COMMAND_HUNGER_DICE_INCLUDED_INDEX]
if hunger_dice_included_command && hunger_dice_included_command == "VMI"
# Hunger Diceを内数処理するの場合
hunger_dice_pool = m[HUNGER_DICE_INCLUDED_INDEX].nil? ? -1 : m[HUNGER_DICE_INCLUDED_INDEX].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 skill_roll
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def skill_roll(command)
m = /^CC([-+]?\d+)?(?:<=(\d+)([RHEC])?)?$/.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 check_action
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def check_action(command)
parser = Command::Parser.new(/!?VC/, round_type: RoundType::FLOOR)
.enable_critical
.enable_fumble
.restrict_cmp_op_to(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"