Showing 809 of 1,233 total issues
File Paradiso.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class Paradiso < Base
# ゲームシステムの識別子
ID = 'Paradiso'
Method resolute_action
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resolute_action(command)
m = /^(\d*)([+\d]+)*FF<=(\d)(,(\d))?(&(\d))?$/.match(command)
return nil unless m
heat_level = m[1].to_i
Method translate_tables
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def translate_tables(locale, skill_table)
inveterate_enemy_table = SkillExpandTable.from_i18n("MagicaLogia.inveterate_enemy_table", locale, skill_table)
conspiracy_table = DiceTable::Table.from_i18n("MagicaLogia.conspiracy_table", locale)
fate_table = DiceTable::Table.from_i18n("MagicaLogia.fate_table", locale)
cueball_table = DiceTable::Table.from_i18n("MagicaLogia.cueball_table", locale)
Method get_pb_normal_urge_table
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_pb_normal_urge_table
return [[
'『怒り/20』突然強い怒りに駆られる。最も近い対象を罵倒し、そのターンの終了まで[行動不能]となる。',
'『暗闇/20』視神経に悪影響が出て、24時間[暗闇]になる。',
'『悲哀/10』突然の悲みに動きが止まる。そのターンの終了まで[行動不能]となる。',
Method get_pb_aas_urge_table
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_pb_aas_urge_table
return [[
# **第1段階
'『緊急停止/20』機能異常の警報と共に、機能が緊急停止。次のターンのターン終了時まで[行動不能]となる。',
'『動作不調/10』駆動系に異常発生。このターンのターン終了まで[行動不能]となる。',
Method eval_game_system_specific_command
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(string)
string = replace_text(string)
unless /(^|\s)S?((\d+)[rR]6([+\-\d]+)?([>=]+(\d+))(\[(\d)\]))(\s|$)/i =~ string
return nil
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
def checkRoll(diceCount, choiceCount, target)
if diceCount <= 0
correction = 1 + diceCount * -1
rollCount = 1
else
- 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 torg_eternity_dice
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def torg_eternity_dice(check_pos, check_mishap)
isSkilledCritical = true
isCritical = true
skilled = 0
unskilled = 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 getDiceRollResult
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def getDiceRollResult(diceCount, targetNumber, criticalValue, specialValue)
successCount = 0
roundCount = 0
rollResult = ""
specialCount = 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 get_accident_table
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_accident_table(damageType, roc)
case damageType
when 'G'
name = '格闘アクシデント表'
table = [
File Nuekagami.rb
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class Nuekagami < Base
# ゲームシステムの識別子
ID = 'Nuekagami'
Method result_1d100
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def result_1d100(total, dice_total, cmp_op, target)
return nil if target == '?'
return nil unless cmp_op == :<=
# ゾロ目ならC-ResultかBotch
- 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 getJudgeResult
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. 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
- 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 a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
if command =~ /(-)?(\d+)?RD(\d+)?(@(\d+))?$/i
diceCount = (Regexp.last_match(2) || 1).to_i
diceCount *= -1 unless Regexp.last_match(1).nil?
choiceCount = (Regexp.last_match(3) || 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 getTotalResult
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def getTotalResult(bitList, successList, countOneList, targetNumber, isStop, canReRoll)
success = successList.inject { |sum, i| sum + i }
countOne = countOneList.inject { |sum, i| sum + i }
result = ""
- 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
File GranCrest.rb
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class GranCrest < Base
# ゲームシステムの識別子
ID = 'GranCrest'
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
File game_system.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "bcdice/game_system/AFF2e"
require "bcdice/game_system/AceKillerGene"
require "bcdice/game_system/Ainecadette"
require "bcdice/game_system/Airgetlamh"
require "bcdice/game_system/AlchemiaStruggle"
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"