Showing 1,176 of 1,233 total issues
File BlindMythos.rb
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class BlindMythos < Base
# ゲームシステムの識別子
ID = 'BlindMythos'
File BloodCrusade.rb
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class BloodCrusade < Base
# ゲームシステムの識別子
ID = 'BloodCrusade'
Class MeikyuKingdom
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class MeikyuKingdom
# 生活散策表(2d6)
def mk_life_research_table
get_table_by_2d6([
"ハグルマ資本主義神聖共和国から使者が現れる。受け入れる場合[生活レベル/9]に成功すると(1d6)MG獲得。この判定の難易度は、ハグルマとの関係が険悪なら+2、敵対なら+4される。使者を受け入れない場合、ハグルマとの関係が1段階悪化する。すでに関係が敵対なら、領土1つを失う",
File Ayabito.rb
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'bcdice/command/parser'
module BCDice
module GameSystem
class Ayabito < Base
File BadLife.rb
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class BadLife < Base
# ゲームシステムの識別子
ID = 'BadLife'
File HuntersMoon.rb
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BCDice
module GameSystem
class HuntersMoon < Base
# ゲームシステムの識別子
ID = 'HuntersMoon'
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber)
totalSuccessCount = 0
totalCriticalCount = 0
text = ""
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 151.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber)
totalSuccessCount = 0
totalCriticalCount = 0
text = ""
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 151.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
table =
[
["この世の地獄", "あれはまさに地獄。屍の山。嘆く者。呆然とする者。目の前で潰される者。あの日、人類は霊長ではなく……弱き獣の一種となった。", "15+2D6"],
["悪の時代", "全ての崩壊、呆然の時。救援が望めぬとわかったなら、少なからぬ者が悪に走った。あの頃は、あなたもまた下劣なる略奪者だった。", "18+2D6"],
["消えざる罪", "混乱の中、あなたは……私怨を晴らした。許せない人間を、その手で始末した。罪に問う者はいない……他ならぬあなた自身以外は。", "18+2D6"],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 146.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
table = [
['ハンター嫌いの', 'ごろつき', '全てへの絶望'],
['心に傷を負った', '罪人', 'あなたへの殺意'],
['精神不安定な', '浮浪者', 'ハンターへの殺意'],
['病に伏した', '盗人', '己自身への殺意'],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 146.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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"