Showing 837 of 1,278 total issues
Method getDiceRollResult
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getDiceRollResult(diceCount, targetNumber, criticalValue, specialValue)
successCount = 0
roundCount = 0
rollResult = ""
specialCount = 0
Method get_takeoff_table
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_takeoff_table
dice = @randomizer.roll_once(20)
case dice
when 1
text = "エンジンがぶっ壊れた!ただちに【機体コンディション】が「20」となり、このターン中は2つ目のアクションも含め「●移動」することができない。"
Method translate_tables
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def translate_tables(locale)
{
"HST" => DiceTable::Table.from_i18n("KillDeathBusiness.table.HST", locale),
"DWT" => DiceTable::Table.from_i18n("KillDeathBusiness.table.DWT", locale),
"RWT" => DiceTable::Table.from_i18n("KillDeathBusiness.table.RWT", locale),
Method roll_strike_rank_result
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_strike_rank_result(string)
debug('strike_rank begin string', string)
wounds = 0
sta_loss = 0
Method getBig6Table
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getBig6Table
table =
[
["この世の地獄", "あれはまさに地獄。屍の山。嘆く者。呆然とする者。目の前で潰される者。あの日、人類は霊長ではなく……弱き獣の一種となった。", "15+2D6"],
["悪の時代", "全ての崩壊、呆然の時。救援が望めぬとわかったなら、少なからぬ者が悪に走った。あの頃は、あなたもまた下劣なる略奪者だった。", "18+2D6"],
Method getFullAutoResult
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getFullAutoResult(command)
m = /^FAR\((-?\d+),(-?\d+),(-?\d+)(?:,(-?\d+)?)?(?:,(-?\w+)?)?(?:,(-?\d+)?)?\)$/i.match(command)
unless m
return nil
end
Method get_roll_result
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_roll_result(result_text, success_dice, ten_dice, hunger_ten_dice, hunger_botch_dice, difficulty)
result_text = "#{result_text} 成功数=#{success_dice}"
is_critical = ten_dice >= 2
if difficulty > 0
Method rokumon2_roll
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def rokumon2_roll(mod, target, abl)
suc = 0
dice = @randomizer.roll_barabara(3 + mod.abs, 6).sort
dicestr = dice.join(",")
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def check_roll(command, base, target, critical_target, diff, modifier)
if base <= 0 # クリティカルしない1D
critical_target = 0
base = 1
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 13 (exceeds 5 allowed). Consider refactoring. 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))
- 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 action_roll
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def action_roll(command)
parser = Command::Parser.new(/\d*SG/, round_type: round_type)
.restrict_cmp_op_to(:>=, nil)
.enable_critical
.enable_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 roll_ippan
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def roll_ippan(command)
m = /^(-?\d+)?AG((?:[-+]\d+)*)$/.match(command)
return nil unless m
level = 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 cf_roll
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def cf_roll(command)
parser = Command::Parser.new(/\d*CF/, round_type: round_type)
.enable_critical
.enable_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 rollAct
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def rollAct(counts, judgment = 0, critical = 0, fumble = 0)
if critical < 1
critical = 1
end
if judgment <= 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_mythos_madness_table
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def roll_mythos_madness_table(command)
m = /^MMT(\[?([1-8],[1-8])\]?)?/.match(command)
return nil unless m
sequence = []
- 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 mk_rare_weapon_item_table
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mk_rare_weapon_item_table(num)
table = [
[11, "虚弾"],
[12, "怪物毒"],
[13, "小鬼の襟巻"],
Method checkRoll
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def checkRoll(diceCount, modify, critical, fumble, target, isStormy, optionalText)
isAnticipation = optionalText.include?('A') # 先見の明
isHeavyAttack = optionalText.include?('H') # 重撃
dice_list = @randomizer.roll_barabara(diceCount, 20)
Method mk_rare_item_table
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mk_rare_item_table(num)
table = [
[11, "ブルーリボン"],
[12, "聖痕"],
[13, "剥製"],
Method get_mechanicAccident_table
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_mechanicAccident_table(locationType, roc, correction)
case locationType
when 'A'
name = '空中メカニック事故表'
table = [
Method checkRoll
has 39 lines of code (exceeds 25 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