Showing 837 of 1,278 total issues
Method roll_amadeus
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_amadeus(command)
m = /^R([A-DS])([+\-\d]*)(@(\d))?((>=?)([+\-\d]*))?(@(\d))?$/i.match(command)
unless m
return nil
end
Method ability_roll
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ability_roll(command)
m = /^AR([-+]\d+)?(>=(\d+))?([AD]?)/.match(command)
unless m
return nil
end
Method check_roll_loop
has a Cognitive Complexity of 17 (exceeds 5 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
- 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_judge
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def roll_judge(command)
m = /^TN(6|10)([CSBYA]*)$/.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 resolute_attacking
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def resolute_attacking(command)
m = /^([-+]\d+)?AA<=(\d+)$/.match(command)
return nil unless m
num_bonus = 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 eval_game_system_specific_command
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
difficulty = 6
auto_success = 0
enabled_reroll = false
enabled_reroll_with_botch = false
File RuinBreakers.rb
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bcdice/arithmetic_evaluator'
require 'bcdice/dice_table/table'
require 'bcdice/dice_table/range_table'
module BCDice
Class Cthulhu7th_Korean
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Cthulhu7th_Korean < Base
# ゲームシステムの識別子
ID = 'Cthulhu7th:Korean'
# ゲームシステム名
Class Cthulhu7th_ChineseTraditional
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Cthulhu7th_ChineseTraditional < Base
# ゲームシステムの識別子
ID = 'Cthulhu7th:ChineseTraditional'
# ゲームシステム名
Method getStructureEncounter
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getStructureEncounter(number)
debug("getStructureEncounter number", number)
tables = [[1, ['船から降りてきた', '魚を売っている', '仕事で忙しそうな', '異国から来た', 'おもしろおかしい', '汗水流している']],
[2, ['おかしな格好をした', '歌を歌っている', 'ステキな笑顔をした', '日なたぼっこをしている', '悩んでいる', '旅をしている']],
Method getUpRollDiceCommandResult
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getUpRollDiceCommandResult(command)
debug("Torg Eternity Dice Roll ( UP ) Command ? ", command)
m = /^UP(\d*)$/i.match(command)
unless m
return nil
Method roll_judge
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_judge(command)
m = /^TN(6|10)([CSBYA]*)$/.match(command)
unless m
return nil
end
Method roll_basic_battle
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_basic_battle(command)
m = /^BB(M)?([-+][-+\d]+)?(>([-+\d]+))?/.match(command)
return nil unless m
mob = m[1]
File SajinsenkiAGuS2E.rb
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bcdice/game_system/SajinsenkiAGuS'
module BCDice
module GameSystem
class SajinsenkiAGuS2E < SajinsenkiAGuS
Method getResultText
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getResultText(rating_total, command, diceResults, diceResultTotals,
rateResults, dice_total, round)
sequence = []
sequence.push("2D:[#{diceResults.join(' ')}]=#{diceResultTotals.join(',')}")
Method get_horidasibukuro_table
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_horidasibukuro_table(dice)
output = '1'
material_kind = [ # 2D6
"蟲甲", # 5
Method eval_game_system_specific_command
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
text =
case command.upcase
when %r{([AS])R(\d+)(([*/]\d+)*)?(((@|A|L)\d+)*)(!M)?$}i
Method judgeDice
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def judgeDice(command)
fumble_match = /,(\d+)$/.match(command)
parser = Command::Parser.new(/JD\d+/, round_type: round_type)
.enable_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 roll_barna_kronika
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def roll_barna_kronika(dice_n, criticalCallDice)
dice_n = dice_n.to_i
output = ''
suc = 0
- 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_attack
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def roll_attack(power_expression, dice_count_expression, border_expression, modification_operator, modification_expression)
power = Arithmetic.eval(power_expression, RoundType::CEIL)
dice_count = Arithmetic.eval(dice_count_expression, RoundType::CEIL)
border = Arithmetic.eval(border_expression, RoundType::CEIL)
modification_value = modification_expression.nil? ? nil : Arithmetic.eval(modification_expression, RoundType::CEIL)
- 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"