bcdice/BCDice

View on GitHub

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'
Severity: Minor
Found in lib/bcdice/game_system/BlindMythos.rb - About 5 hrs to fix

    File BloodCrusade.rb has 378 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module BCDice
      module GameSystem
        class BloodCrusade < Base
          # ゲームシステムの識別子
          ID = 'BloodCrusade'
    Severity: Minor
    Found in lib/bcdice/game_system/BloodCrusade.rb - About 5 hrs to fix

      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つを失う",
      Severity: Minor
      Found in lib/bcdice/game_system/meikyu_kingdom/tables.rb - About 5 hrs to fix

        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
        Severity: Minor
        Found in lib/bcdice/game_system/Ayabito.rb - About 5 hrs to fix

          File BadLife.rb has 373 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module BCDice
            module GameSystem
              class BadLife < Base
                # ゲームシステムの識別子
                ID = 'BadLife'
          Severity: Minor
          Found in lib/bcdice/game_system/BadLife.rb - About 4 hrs to fix

            File HuntersMoon.rb has 371 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module BCDice
              module GameSystem
                class HuntersMoon < Base
                  # ゲームシステムの識別子
                  ID = 'HuntersMoon'
            Severity: Minor
            Found in lib/bcdice/game_system/HuntersMoon.rb - About 4 hrs to fix

              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 = ""
              
              
              Severity: Minor
              Found in lib/bcdice/game_system/HunterTheReckoning5th.rb - About 4 hrs to fix

              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
              Severity: Minor
              Found in lib/bcdice/game_system/KemonoNoMori.rb - About 4 hrs to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                      def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber)
                        totalSuccessCount = 0
                        totalCriticalCount = 0
                        text = ""
                
                
                Severity: Major
                Found in lib/bcdice/game_system/Airgetlamh.rb and 1 other location - About 4 hrs to fix
                lib/bcdice/game_system/Avandner.rb on lines 58..96

                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

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                      def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber)
                        totalSuccessCount = 0
                        totalCriticalCount = 0
                        text = ""
                
                
                Severity: Major
                Found in lib/bcdice/game_system/Avandner.rb and 1 other location - About 4 hrs to fix
                lib/bcdice/game_system/Airgetlamh.rb on lines 75..113

                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

                Further Reading

                File KillDeathBusiness.rb has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module BCDice
                  module GameSystem
                    class KillDeathBusiness < Base
                      # ゲームシステムの識別子
                      ID = 'KillDeathBusiness'
                Severity: Minor
                Found in lib/bcdice/game_system/KillDeathBusiness.rb - About 4 hrs to fix

                  File node.rb has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "singleton"
                  
                  module BCDice
                    module CommonCommand
                      module AddDice
                  Severity: Minor
                  Found in lib/bcdice/common_command/add_dice/node.rb - About 4 hrs to fix

                    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)
                    Severity: Minor
                    Found in lib/bcdice/game_system/filled_with/event_tables.rb - About 4 hrs to fix

                      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(
                              "武具アイテム表",
                      Severity: Minor
                      Found in lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb - About 4 hrs to fix

                        Method getCriticalResult has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def getCriticalResult(string)
                                # クリティカル効果データ
                                whh = [
                                  '01:打撃で状況が把握出来なくなる。次ターンは1回の半アクションしか行なえない。',
                                  '02:耳を強打された為、耳鳴りが酷く目眩がする。1Rに渡って一切のアクションを行なえない。',
                        Severity: Major
                        Found in lib/bcdice/game_system/Warhammer.rb - About 4 hrs to fix

                          Class Base has 34 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class Base
                              class << self
                                # 接頭辞(反応するコマンド)の配列を返す
                                # @return [Array<String>]
                                attr_reader :prefixes
                          Severity: Minor
                          Found in lib/bcdice/base.rb - About 4 hrs to fix

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                    table =
                                      [
                                        ["この世の地獄", "あれはまさに地獄。屍の山。嘆く者。呆然とする者。目の前で潰される者。あの日、人類は霊長ではなく……弱き獣の一種となった。", "15+2D6"],
                                        ["悪の時代", "全ての崩壊、呆然の時。救援が望めぬとわかったなら、少なからぬ者が悪に走った。あの頃は、あなたもまた下劣なる略奪者だった。", "18+2D6"],
                                        ["消えざる罪", "混乱の中、あなたは……私怨を晴らした。許せない人間を、その手で始末した。罪に問う者はいない……他ならぬあなた自身以外は。", "18+2D6"],
                            Severity: Major
                            Found in lib/bcdice/game_system/ColossalHunter.rb and 1 other location - About 4 hrs to fix
                            lib/bcdice/game_system/ColossalHunter.rb on lines 201..238

                            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

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                    table = [
                                      ['ハンター嫌いの', 'ごろつき', '全てへの絶望'],
                                      ['心に傷を負った', '罪人', 'あなたへの殺意'],
                                      ['精神不安定な', '浮浪者', 'ハンターへの殺意'],
                                      ['病に伏した', '盗人', '己自身への殺意'],
                            Severity: Major
                            Found in lib/bcdice/game_system/ColossalHunter.rb and 1 other location - About 4 hrs to fix
                            lib/bcdice/game_system/ColossalHunter.rb on lines 155..193

                            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

                            Further Reading

                            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
                            Severity: Minor
                            Found in lib/bcdice/game_system/DungeonsAndDragons5.rb - About 4 hrs to fix

                            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
                            Severity: Minor
                            Found in lib/bcdice/game_system/VampireTheMasquerade5th.rb - About 4 hrs to fix

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language