Showing 837 of 1,278 total issues
Method get_urge
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_urge(string) # パラサイトブラッドの衝動表
unless /(\w*)URGE\s*(\d+)/i =~ string
return '1'
end
Method roll_d
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_d(command, times, sides, target)
dice_list = @randomizer.roll_barabara(times, sides).sort
total = dice_list.sum
success = total <= target
Method getStepInfo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def getStepInfo(step)
baseStepTable = getBaseStepTable
baseMaxStep = baseStepTable.last.first
if step <= baseMaxStep
Method check_action
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Method translate_tables
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def translate_tables(locale)
{
"TT" => DiceTable::D66GridTable.from_i18n("StellarKnights.tables.TT", locale),
"STA" => DiceTable::Table.from_i18n("StellarKnights.tables.STA", locale),
"STB" => DiceTable::D66OneThirdTable.from_i18n("StellarKnights.tables.STB", locale),
Method roll_ability
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_ability(command)
parser = Command::Parser.new("MS", round_type: @round_type)
.has_prefix_number
.disable_modifier
.restrict_cmp_op_to(:<=)
Method check_roll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def check_roll(command)
m = /^2D6([+\-\d]*)>=(\d+)(\[(\d+)?(,(\d+))?\])?$/i.match(command)
unless m
return nil
end
Method command_sn
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def command_sn(command)
debug("SN", command)
cmd = Command::Parser.new(/[1-9]?SN(\d{0,2})/, round_type: round_type)
.restrict_cmp_op_to(nil)
.enable_fumble.parse(command)
Method roll_skill_check
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_skill_check(command)
parser = Command::Parser.new("BI", round_type: @round_type)
.enable_suffix_number
.enable_critical
.enable_fumble
Method checkRoll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def checkRoll(string)
debug("checkRoll begin string", string)
m = %r{^(\d+)DS(\d+)?(([+-/])(\d+))?(?:>=(\d+))?$}i.match(string)
unless m
Method eval_game_system_specific_command
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def eval_game_system_specific_command(command)
parser = Command::Parser.new(/\d+D6/, round_type: round_type)
cmd = parser.parse(command)
unless cmd
return nil
Method get_table_minus_index
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_table_minus_index(table, operator, value)
index = 7
modify = 0
dice_list = nil
result = []
Method roll_symphony_check
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_symphony_check(command)
m = /^([1-6]+)PD([1-6])([+-]\d+)?$/.match(command)
unless m
return nil
end
Method getCrashWorldRoll
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def getCrashWorldRoll(target)
debug("target", target)
output = "("
isEnd = false
Method resolute_action
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def resolute_action(command)
m = /^(\d+)([-+]\d+)?AM<=(\d+),(\d)$/.match(command)
return nil unless m
num_dice = m[1].to_i
Method get_table_index
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_table_index(table, operator, value, dice_count, dice_type)
index = 0
modify = 0
dice_list = nil
result = []
Method eval_game_system_specific_command
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def eval_game_system_specific_command(command)
# 命中判定・回避判定
parser = Command::Parser.new('SGS', round_type: @round_type).restrict_cmp_op_to(nil)
command = parser.parse(command)
Method roll_treat
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_treat(command)
m = /^TREAT(-?\d+)?$/.match(command)
return nil unless m
unless m[1]
Method rollFullAuto
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def rollFullAuto(bullet_count, diff, broken_number, dice_num)
output = ""
loopCount = 0
counts = {
Method getTotalDamage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def getTotalDamage(damages)
parts = ['頭',
'胴中央',
'右胴',
'左胴',