Showing 837 of 1,278 total issues
Method get_roll_result
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def get_roll_result(result_text, success_dice, ten_dice, _desperaton_ten_dice, desperaton_botch_dice, difficulty)
result_text = "#{result_text} 成功数=#{success_dice}"
is_critical = ten_dice >= 2
desperation_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 KemonoNoMori.rb
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bcdice/dice_table/table'
require 'bcdice/dice_table/range_table'
module BCDice
module GameSystem
File KillDeathBusiness.rb
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class KillDeathBusiness < Base
# ゲームシステムの識別子
ID = 'KillDeathBusiness'
File node.rb
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "singleton"
module BCDice
module CommonCommand
module AddDice
File event_tables.rb
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class FilledWith
class EventTable
def initialize(area_name, area_id, rows)
File item_table.rb
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class MeikyuKingdomBasic
WEAPON_ITEM_TABLE = DiceTable::D66Table.new(
"武具アイテム表",
Method translate_tables
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
def translate_tables(locale)
ordinary_days_place_table = DiceTable::Table.from_i18n("KizunaBullet.table.OP", locale)
ordinary_days_content_table = DiceTable::Table.from_i18n("KizunaBullet.table.OC", locale)
ordinary_days_work_place_table = DiceTable::Table.from_i18n("KizunaBullet.table.OWP", locale)
ordinary_days_work_content_table = DiceTable::Table.from_i18n("KizunaBullet.table.OWC", locale)
Method getCriticalResult
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getCriticalResult(string)
# クリティカル効果データ
whh = [
'01:打撃で状況が把握出来なくなる。次ターンは1回の半アクションしか行なえない。',
'02:耳を強打された為、耳鳴りが酷く目眩がする。1Rに渡って一切のアクションを行なえない。',
Class Base
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
class << self
# 接頭辞(反応するコマンド)の配列を返す
# @return [Array<String>]
attr_reader :prefixes
Method attack_roll
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def attack_roll(command)
m = /^AT([-+]\d+)?(@(\d+))?(>=(\d+))?([AD]?)/.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 get_roll_result
has a Cognitive Complexity of 29 (exceeds 5 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
- 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 getTresureTable
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getTresureTable(num)
case num
# 初級マイナス
when -1
table = [
Method getSW2_0_RatingTable
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getSW2_0_RatingTable
rate_sw2_0 = [
# 0
'*,0,0,0,1,2,2,3,3,4,4',
'*,0,0,0,1,2,3,3,3,4,4',
File item_table.rb
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class MeikyuKingdom
# デバイスファクトリー(1D6)
def mk_device_factory_table()
File StellarLife.rb
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class StellarLife < Base
# ゲームシステムの識別子
ID = 'StellarLife'
Method getDamageTypeAndTable
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getDamageTypeAndTable(head)
case head
when "S"
type = '射撃'
# 射撃ダメージペナルティー表
Method getDamageTypeAndTable
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getDamageTypeAndTable(head)
case head
when "S"
type = '射撃'
# 射撃ダメージペナルティー表
Method get_roll_result
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def get_roll_result(result_text, success_dice, ten_dice, _rage_ten_dice, brutal_outcome, difficulty)
is_critical = ten_dice >= 2
if brutal_outcome > 0 && difficulty != 0
success_dice += 4
- 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 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eval_game_system_specific_command(string)
if /^\d+D\d+/i.match?(string)
return roll_action(string)
end
Method wh_atpos
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
def wh_atpos(pos_num, pos_type) # WHFRP2命中部位表
debug("wh_atpos begin pos_type", pos_type)
pos_2l = [
'二足',
15, '頭部',