bcdice/BCDice

View on GitHub
lib/bcdice/game_system/Elysion.rb

Summary

Maintainability
F
6 days
Test Coverage
A
99%

File Elysion.rb has 1110 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Class Elysion has 47 methods (exceeds 20 allowed). Consider refactoring.
    Open

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

      Method checkAnyCommand has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def checkAnyCommand(command)
              result =
                case command.upcase
                when 'RBT'
                  getClassRoomBreakTable
      Severity: Major
      Found in lib/bcdice/game_system/Elysion.rb - About 2 hrs to fix

        Method eval_game_system_specific_command has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def eval_game_system_specific_command(command)
                debug('eval_game_system_specific_command command', command)
        
                result = ''
                case command
        Severity: Minor
        Found in lib/bcdice/game_system/Elysion.rb - About 1 hr to fix

          Avoid too many return statements within this method.
          Open

                  return '', []
          Severity: Major
          Found in lib/bcdice/game_system/Elysion.rb - About 30 mins to fix

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

                  def getMidnightDateTable()
                    name = "真夜中デート"
            
                    table = [
                      [11, "「こんなはずじゃなかったのにッ!」\n仲良くするつもりが、ひどい喧嘩になってしまう。この表の使用者のお互いに対する《感情値》が1点上昇し、属性が《敵意》になる。"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 303..329
            lib/bcdice/game_system/Elysion.rb on lines 332..359
            lib/bcdice/game_system/Elysion.rb on lines 362..388

            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 73.

            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 4 locations. Consider refactoring.
            Open

                  def getDateTable()
                    name = 'デート'
            
                    table = [
                      [11, "「こんなはずじゃなかったのにッ!」仲良くするつもりが、ひどい喧嘩になってしまう。この表の使用者のお互いに対する《感情値》が1点上昇し、属性が《敵意》になる。"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 332..359
            lib/bcdice/game_system/Elysion.rb on lines 362..388
            lib/bcdice/game_system/Elysion.rb on lines 391..418

            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 73.

            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 4 locations. Consider refactoring.
            Open

                  def getRandomNpcSchoolLife
                    name = "学生生活関連NPC表"
            
                    table = [
                      [11, "振り直し/任意"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 755..782
            lib/bcdice/game_system/Elysion.rb on lines 785..812
            lib/bcdice/game_system/Elysion.rb on lines 815..842

            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 73.

            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 4 locations. Consider refactoring.
            Open

                  def getRandomNpcUpperClassmen
                    name = "学生図鑑 上級学年表"
            
                    table = [
                      [11, "下妻笹緒(しもつま・ささお):高等部2年2組:P117"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 725..752
            lib/bcdice/game_system/Elysion.rb on lines 755..782
            lib/bcdice/game_system/Elysion.rb on lines 785..812

            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 73.

            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 4 locations. Consider refactoring.
            Open

                  def getFrindDateTable()
                    name = "友達デート"
            
                    table = [
                      [11, "「こんなはずじゃなかったのにッ!」\n仲良くするつもりが、ひどい喧嘩になってしまう。この表の使用者のお互いに対する《感情値》が1点上昇し、属性が《敵意》になる。"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 303..329
            lib/bcdice/game_system/Elysion.rb on lines 362..388
            lib/bcdice/game_system/Elysion.rb on lines 391..418

            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 73.

            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 4 locations. Consider refactoring.
            Open

                  def getOnewayDateTable()
                    name = "片思いデート"
            
                    table = [
                      [11, "「気付いてくれないあなたが悪いんだから……!」\n突然の告白と、刃物沙汰。撃退士じゃなかったら死んでいた。受け身キャラは《生命力》が3D6点減少する。攻め気キャラの受け身キャラに対する《感情値》が3点上昇し、属性が《敵意》にあんる。受け身キャラは攻め気キャラに対するフラグがあった場合、フラグを折る。"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 303..329
            lib/bcdice/game_system/Elysion.rb on lines 332..359
            lib/bcdice/game_system/Elysion.rb on lines 391..418

            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 73.

            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 4 locations. Consider refactoring.
            Open

                  def getRandomNpcOther
                    name = "教師・その他NPC表"
            
                    table = [
                      [11, "振り直し/任意"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 725..752
            lib/bcdice/game_system/Elysion.rb on lines 785..812
            lib/bcdice/game_system/Elysion.rb on lines 815..842

            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 73.

            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 4 locations. Consider refactoring.
            Open

                  def getRandomNpcDownClassmen
                    name = "学生図鑑 下級学年表"
            
                    table = [
                      [11, "若菜白兎(わかな・しろう):初等部2年2組:P72"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 3 other locations - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 725..752
            lib/bcdice/game_system/Elysion.rb on lines 755..782
            lib/bcdice/game_system/Elysion.rb on lines 815..842

            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 73.

            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

                  def getBossEncount(level)
                    name = "ボスキャラクター遭遇表"
                    table = [
                      [2, "剥奪天使(p101)、イフリート(基本p126)×PCと同じ数"],
                      [3, "没落悪魔(p105)、ブラックシープ(基本p129)×PCと同じ数"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 1 other location - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 850..870

            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 58.

            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

                  def getUsuallyEncount(level)
                    name = "日常遭遇表"
                    table = [
                      [2, "ブラックシープ(基本p129)×2"],
                      [3, "イフリート(基本p126)、グリフォン(基本p126)"],
            Severity: Major
            Found in lib/bcdice/game_system/Elysion.rb and 1 other location - About 1 hr to fix
            lib/bcdice/game_system/Elysion.rb on lines 873..893

            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 58.

            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

            There are no issues that match your filters.

            Category
            Status