lib/bcdice/game_system/Warhammer.rb
Method getCriticalResult
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def getCriticalResult(string)
# クリティカル効果データ
whh = [
'01:打撃で状況が把握出来なくなる。次ターンは1回の半アクションしか行なえない。',
'02:耳を強打された為、耳鳴りが酷く目眩がする。1Rに渡って一切のアクションを行なえない。',
Method wh_atpos
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def wh_atpos(pos_num, pos_type) # WHFRP2命中部位表
debug("wh_atpos begin pos_type", pos_type)
pos_2l = [
'二足',
15, '頭部',
File Warhammer.rb
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module BCDice
module GameSystem
class Warhammer < Base
# ゲームシステムの識別子
ID = 'Warhammer'
Method wh_atpos
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def wh_atpos(pos_num, pos_type) # WHFRP2命中部位表
debug("wh_atpos begin pos_type", pos_type)
pos_2l = [
'二足',
15, '頭部',
- 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 getCriticalResult
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def getCriticalResult(string)
# クリティカル効果データ
whh = [
'01:打撃で状況が把握出来なくなる。次ターンは1回の半アクションしか行なえない。',
'02:耳を強打された為、耳鳴りが酷く目眩がする。1Rに渡って一切のアクションを行なえない。',
- 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"