Showing 837 of 1,278 total issues
Method get_exploration_table
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_exploration_table
dice = @randomizer.roll_once(20)
case dice
when 1
text = "クソっ!このマスに付与されていた\[手がかり\]を失う。"
Method check_action
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_action(command)
parser = Command::Parser.new("AB", round_type: RoundType::CEIL).has_prefix_number.enable_critical.enable_dollar.restrict_cmp_op_to(nil, :>=)
parsed = parser.parse(command)
return nil if parsed.nil?
Method roll_gr
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_gr(command)
parser = Command::Parser.new("GR", round_type: round_type)
.enable_fumble
.restrict_cmp_op_to(nil, :>=)
cmd = parser.parse(command)
Method twohands_damage_roll
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def twohands_damage_roll(command)
m = /^2H(\d+)D(\d+)([+-]\d+)?/.match(command)
unless m
return nil
end
Method getCreateSatasupeResult
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getCreateSatasupeResult(counts)
debug("getCreateSatasupeResult counts", counts)
name = "サタスペ作成"
Method check_roll
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_roll(command)
m = %r{^RB(-?\d+([+\-*/]\d+)*)(@(\d+))?(#(\d+))?$}.match(command)
unless m
return nil
end
Method check_roll_loop
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_roll_loop(roll_times, min_suc, target, critical, fumble, is_critical_stop)
dice_str = ''
is_fumble = false
is_critical = false
total_suc = 0
Method roll_burst
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_burst(command)
m = /^(\d{2})C$/.match(command)
unless m
return nil
end
Method checkDamage
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def checkDamage(diceCount, armor)
if diceCount <= 0
correction = 1 + diceCount * -1
rollCount = 1
else
Method resolute_action
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resolute_action(command)
m = /^TC([+\d]*)(>=(\d+))?/.match(command)
return nil unless m
bonus =
Method check_action
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check_action(command)
parser = Command::Parser.new("BK", round_type: RoundType::FLOOR).enable_critical.enable_prefix_number.has_suffix_number
parsed = parser.parse(command)
return nil if parsed.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 check_roll
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check_roll(command)
m = /^(\d+)D6([+\-\d]*)>=(\?|\d+)(\[(\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 getDamageResult
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def getDamageResult(command)
biggun = [0, 0, 0]
case command
when /^DC(\d+)(\[(\d+)(,(\d+))?(,(\d+))?(,(\d+))?(,(\d+))?(,(\d+))?\])?$/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 eval_game_system_specific_command
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
command = command.upcase
if (table = self.class::TABLES[command])
table.roll(@randomizer)
- 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_AlterRaise_d66_table_result
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_AlterRaise_d66_table_result(name, table, roc)
if roc > 10
diceText = roc.to_s
dice1 = diceText[0, 1].to_i
dice1 = 6 if dice1 > 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_gr
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def roll_gr(command)
parser = Command::Parser.new("GR", round_type: round_type)
.enable_fumble
.restrict_cmp_op_to(nil, :>=)
cmd = parser.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 eval_game_system_specific_command
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(string)
string = replace_text(string)
return nil unless /(^|\s)S?((\d+)[rR]6(\[([,\d]+)\])?)(\s|$)/i =~ 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 eval_game_system_specific_command
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
parser = Command::Parser.new("LWD", "LW", round_type: round_type)
.restrict_cmp_op_to(nil, :<=)
cmd = parser.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 result_1d100
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def result_1d100(total, _dice_total, cmp_op, target)
return Result.nothing if target == '?'
return nil unless cmp_op == :<=
t10 = total / 10
- 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 checkDamage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def checkDamage(diceCount, armor)
if diceCount <= 0
correction = 1 + diceCount * -1
rollCount = 1
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"