Showing 837 of 1,278 total issues
File GURPS.rb
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class GURPS < Base
# ゲームシステムの識別子
ID = 'GURPS'
File TrinitySeven.rb
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "bcdice/dice_table/table"
require "bcdice/format"
module BCDice
module GameSystem
File GundamSentinel.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class GundamSentinel < Base
# ゲームシステムの識別子
ID = 'GundamSentinel'
Method checkRoll
has a Cognitive Complexity of 25 (exceeds 5 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)
- 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 getResultText
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def getResultText(rating_total, command, diceResults, diceResultTotals,
rateResults, dice_total, round)
sequence = []
sequence.push("2D:[#{diceResults.join(' ')}]=#{diceResultTotals.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 result_1d20
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def result_1d20(total, _dice_total, cmp_op, diff)
return Result.nothing if diff == '?'
return nil unless cmp_op == :<=
# 技能値の修正を計算する
- 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 getRollResult
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def getRollResult(rerollCounts, judgeNumberText, judgeNumber, targetNumber, isReRoll, isStop)
bitList = []
successList = []
countOneList = []
rerollTargetList = []
- 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 enemy_data_tables.rb
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class FilledWith < Base
# 夢幻の迷宮エネミーデータ表
def fetch_enemy_data(command)
Class ShinkuuGakuen
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class ShinkuuGakuen < Base
# ゲームシステムの識別子
ID = 'ShinkuuGakuen'
# ゲームシステム名
Method get_damageEffect_table
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_damageEffect_table(hitPart, damageStage)
damageInfos = [['L', '(LW)'],
['M', '(MW)'],
['H', '(HW)'],
['O', '(MO)']]
Method check_action
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def check_action(command)
parser = Command::Parser.new("AB", round_type: RoundType::CEIL).has_prefix_number.enable_critical.enable_dollar.restrict_cmp_op_to(nil, :>=)
parsed = parser.parse(command)
return nil if parsed.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 rating
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def rating(string) # レーティング表
debug("rating string", string)
command = rating_parser.parse(string)
unless command
- 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 ability_roll
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def ability_roll(command)
m = /^AR([-+]\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 getStepResult
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
def getStepResult(str)
return nil unless /(\d+)E(\d+)?(\+)?(\d+)?(d\d+)?/i =~ str
stepTotal = 0
@isFailed = true
File SwordWorld.rb
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "bcdice/base"
require "bcdice/game_system/sword_world/rating_parser"
module BCDice
module GameSystem
File AlchemiaStruggle.rb
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "bcdice/base"
module BCDice
module GameSystem
class AlchemiaStruggle < Base
Method eval_game_system_specific_command
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def eval_game_system_specific_command(command)
difficulty = 6
auto_success = 0
enabled_reroll = false
enabled_reroll_with_botch = false
- 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_check
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. 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
- 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 use_edible_plant_chart
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def use_edible_plant_chart(command)
match_data = command.match(/EP([VA]?)(\d?)/)
chart_symbol = match_data[1] == '' ? 'V' : match_data[1]
case chart_symbol
- 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 fate_monster
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def fate_monster(_natural_result, order)
modified_result = []
if order.length > 9 && order[2] =~ /^\d+$/ && order[3] =~ /^\d+$/ && order[4] =~ /^\d+$/ && order[5] =~ /^\d+$/ && order[6] =~ /^\d+$/ && order[7] =~ /^\d+$/ && order[8] =~ /^\d+$/ && order[9] =~ /^\d+$/
if order[2].to_i > 0
modified_result.concat(@randomizer.roll_barabara(order[2].to_i, 2))
- 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"