Showing 837 of 1,278 total issues
Method roll_color
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def roll_color(command)
m = /^B(\d{1,2})W(\d{1,2})$/.match(command)
return nil unless m
black = m[1].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 mayokin_check
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def mayokin_check(string)
debug("mayokin_check string", string)
string = replace_text(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 get_horidasibukuro_table
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_horidasibukuro_table(dice)
output = '1'
material_kind = [ # 2D6
"蟲甲", # 5
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def result_1d100(total, _dice_total, cmp_op, target)
return nil unless cmp_op == :<=
if total >= 100
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 result_detail
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def result_detail(sl, total, target)
if sl == 0
if total <= 5
'小成功'
elsif total >= 96
- 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 judgeRoll
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def judgeRoll(command)
return nil unless /^(R([A-DS]|\d+)([+\-\d,]*))(@(\d))?((>(=)?)([+\-\d]*))?(@(\d))?$/i =~ command
skillRank = Regexp.last_match(2)
modifyText = Regexp.last_match(3)
- 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_performance_check
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def roll_performance_check(command)
m = /^PD(\d+)([+-]\d+)?$/.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 checkRoll
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def checkRoll(string)
string = replace_text(string)
return nil unless /(^|\s)S?(2[rR]10([+\-\d]+)?([>=]+(\d+))(\[(\d+),(\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 roll_barna_kronika
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_barna_kronika(dice_n, criticalCallDice)
dice_n = dice_n.to_i
output = ''
suc = 0
Method checkRoll
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def checkRoll(diceCount, choiceCount, target)
if diceCount <= 0
correction = 1 + diceCount * -1
rollCount = 1
else
Method getSuccessTable
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getSuccessTable
successTable =
[
# Pathetic Poor Average Good Excellent Extraordinary
[2, [0, 1, 2, 5, 7, 9]],
Method eval_game_system_specific_command
has 42 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('SBS', 'SB', round_type: round_type)
.enable_critical
Method roll_ub
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_ub(command)
parser = Command::Parser.new("UB", round_type: @round_type)
.has_prefix_number
.enable_critical
parsed = parser.parse(command)
Method checkRoll
has 42 lines of code (exceeds 25 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
Method judgeRoll
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def judgeRoll(command)
return nil unless /^(R([A-DS]|\d+)([+\-\d,]*))(@(\d))?((>(=)?)([+\-\d]*))?(@(\d))?$/i =~ command
skillRank = Regexp.last_match(2)
modifyText = Regexp.last_match(3)
Method check_action
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_action(command)
parser = Command::Parser.new("ZL", round_type: @round_type)
.enable_prefix_number
.disable_modifier
.restrict_cmp_op_to(:<=)
Consider simplifying this complex logical expression. Open
if order.length > 9 && order[2] =~ /^\d+$/ && order[3] =~ /^\d+$/ && order[4] =~ /^\d+$/ && order[5] =~ /^\d+$/ && order[6] =~ /^\d+$/ && order[7] =~ /^\d+$/ && order[8] =~ /^\d+$/ && order[9] =~ /^\d+$/
if order[2].to_i > 0
modified_result.concat(@randomizer.roll_barabara(order[2].to_i, 2))
end
if order[3].to_i > 0
Method roll_action
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_action(command)
parser = Command::Parser.new("DS", round_type: @round_type)
.enable_prefix_number
.restrict_cmp_op_to(nil)
parsed = parser.parse(command)
Method fate_monster
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fate_monster(_natural_result, order)
modified_result = []
if order.length > 9 && order[2] =~ /^\d+$/ && order[3] =~ /^\d+$/ && order[4] =~ /^\d+$/ && order[5] =~ /^\d+$/ && order[6] =~ /^\d+$/ && order[7] =~ /^\d+$/ && order[8] =~ /^\d+$/ && order[9] =~ /^\d+$/
if order[2].to_i > 0
modified_result.concat(@randomizer.roll_barabara(order[2].to_i, 2))
Method getDurtyTableCommandReuslt
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getDurtyTableCommandReuslt(command)
return nil unless /^DT$/i =~ command
table = <<~__TABLE_END__
汚染チャートを2回振り、その効果を適用する(1・2-2,5・6-12 なら振り直す)