Showing 837 of 1,278 total issues
Method get_supplementary
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_supplementary(command_type, result)
title = ''
supplementary = ''
case command_type
when 'EM'
Method getLifeAndDeathUnknownResult
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def getLifeAndDeathUnknownResult()
table = [
' 1日:生還!',
' 1日:生還!',
' 1日:生還!',
Method eval
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def eval(game_system, randomizer)
round_type = game_system.round_type
cmp_op = @cmp_op || game_system.default_cmp_op
reroll_cmp_op = @reroll_cmp_op || cmp_op || :>=
Method getJudgeResult
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def getJudgeResult(command)
case command
when /(\d+)?DA([\d+*-]*\d)?\[(\d+),(\d+)(,(\d+))?\]/i
number = (Regexp.last_match(1) || 1).to_i
correction = (Regexp.last_match(2) || 0).to_i
Method get_SUV_table
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_SUV_table(armorGrade, damage)
name = '戦闘結果表'
table = [
[0, 1, 6, 16, 26, 36],
[0, 1, 6, 26, 36, 46],
Method getTotalResult
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def getTotalResult(bitList, successList, countOneList, targetNumber, isStop, canReRoll)
success = successList.inject { |sum, i| sum + i }
countOne = countOneList.inject { |sum, i| sum + i }
result = ""
Method rollAct
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def rollAct(counts, judgment = 0, critical = 0, fumble = 0)
if critical < 1
critical = 1
end
if judgment <= 0
Method resolute_attacking
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def resolute_attacking(command)
m = /^([-+]\d+)?AA<=(\d+)$/.match(command)
return nil unless m
num_bonus = m[1].to_i
Method cf_roll
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def cf_roll(command)
parser = Command::Parser.new(/\d*CF/, round_type: round_type)
.enable_critical
.enable_fumble
Method get_interim_reference_number
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_interim_reference_number
table = [
[11, '1'],
[12, '2'],
[13, '3'],
Method ability_roll
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def ability_roll(command)
m = /^(\d+\.?\d*)?AD([+-](\d+))?(#(\d*))?(>=(\d+))?/.match(command)
unless m
return nil
end
Method action_roll
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def action_roll(command)
parser = Command::Parser.new("D6", round_type: round_type)
.has_prefix_number
.restrict_cmp_op_to(:>=)
.enable_critical
Method checkRoll
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def checkRoll(string)
string = replace_text(string)
debug("checkRoll string", string)
unless (m = /(^|\s)S?((\d+)[rR]6([+\-\d]*)(([>=]+)(\d+))?)(\s|$)/i.match(string))
Method roll_nr
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_nr(command)
m = /^(\d+)?NR(6|8|10|12)$/.match(command)
return nil unless m
times = m[1]&.to_i || 1
Method mayokin_check
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def mayokin_check(string)
debug("mayokin_check string", string)
string = replace_text(string)
Method roll_check
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_check(command)
m = /^KS(?:\(([-+\d]+),([-+\d]+)?\)|(\d+))([AD]?)(?:>=([-+\d]+))?$/.match(command)
return nil unless m
dice_size = m[1] ? Arithmetic.eval(m[1], @round_type) : Arithmetic.eval(m[3], @round_type).to_i
Method roll
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll(randomizer)
if @parse_error
return nil
end
Method roll_performance_check
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def roll_performance_check(command)
m = /^PD(\d+)([+-]\d+)?$/.match(command)
unless m
return nil
end
Method get_flightsupply_table
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_flightsupply_table
dice = @randomizer.roll_once(20)
case dice
when 1
text = "……えっ?! キミの【物資点】は0点となる。"
Method action_roll
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def action_roll(command)
parser = Command::Parser.new(/\d*SG/, round_type: round_type)
.restrict_cmp_op_to(:>=, nil)
.enable_critical
.enable_fumble