bcdice/BCDice

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

Summary

Maintainability
D
2 days
Test Coverage
A
94%

File DemonParasite.rb has 479 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Method get_urge has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def get_urge(string)
            m = /([NAMUC])?URGE\s*(\d+)/i.match(string)
            unless m
              return '1'
            end
    Severity: Minor
    Found in lib/bcdice/game_system/DemonParasite.rb - About 1 hr to fix

      Method result_nd6 has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def result_nd6(_total, _dice_total, dice_list, _cmp_op, target)
      Severity: Minor
      Found in lib/bcdice/game_system/DemonParasite.rb - About 35 mins to fix

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

              URGE_TABLE = [
                [
                  '『怒り』突然強い怒りに駆られる。近くの対象に(非暴力の)怒りを全力でぶつける。このターンの終了まで「行動不能」となる。[経験値20点]',
                  '『絶叫』寄生生物が体内で蠢く。その恐怖に絶叫。このターンの終了まで「行動不能」となる。[経験値10点]',
                  '『悲哀』急に悲しいことを思い出して動きが止まる。このターンの終了まで「行動不能」となる。[経験値10点]',
        Severity: Major
        Found in lib/bcdice/game_system/DemonParasite.rb and 5 other locations - About 1 hr to fix
        lib/bcdice/game_system/DemonParasite.rb on lines 170..236
        lib/bcdice/game_system/DemonParasite.rb on lines 239..305
        lib/bcdice/game_system/DemonParasite.rb on lines 308..374
        lib/bcdice/game_system/DemonParasite.rb on lines 377..443
        lib/bcdice/game_system/DemonParasite.rb on lines 446..512

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

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

              ONIMITAMA_BATTLE_TABLE = [
                [
                  '『恐怖』効果が発生したターンの終了時まで「行動不能」状態となる。',
                  '『落涙』1ターン(10秒)「通常」行動を行えない。回避行動に影響はない。',
                  '『哄笑』効果が発生したターンの終了時まで「行動不能」となる。',
        Severity: Major
        Found in lib/bcdice/game_system/DemonParasite.rb and 5 other locations - About 1 hr to fix
        lib/bcdice/game_system/DemonParasite.rb on lines 101..167
        lib/bcdice/game_system/DemonParasite.rb on lines 170..236
        lib/bcdice/game_system/DemonParasite.rb on lines 239..305
        lib/bcdice/game_system/DemonParasite.rb on lines 308..374
        lib/bcdice/game_system/DemonParasite.rb on lines 377..443

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

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

              ONIMITAMA_OUT_OF_BATTLE_TABLE = [
                [
                  '『恐怖』恐怖の感情が爆発し、目に映るすべてが恐ろしくなる。[20点]',
                  '『落涙』過去の悲しい思い出が去来し、涙が溢れる。[10点]',
                  '『哄笑』突如として精神が高揚し、狂ったように笑う。[10点]',
        Severity: Major
        Found in lib/bcdice/game_system/DemonParasite.rb and 5 other locations - About 1 hr to fix
        lib/bcdice/game_system/DemonParasite.rb on lines 101..167
        lib/bcdice/game_system/DemonParasite.rb on lines 170..236
        lib/bcdice/game_system/DemonParasite.rb on lines 239..305
        lib/bcdice/game_system/DemonParasite.rb on lines 308..374
        lib/bcdice/game_system/DemonParasite.rb on lines 446..512

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

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

              MUTANT_TABLE = [
                [
                  '『怒り』突然強い怒りに駆られる。近くの対象にあたりちらす。このターンの終了まで「行動不能」となる。[20点]',
                  '『絶叫』悪魔寄生体が蠢きだす。その恐怖に絶叫。このターンの終了まで「行動不能」となる。[10点]',
                  '『悲哀』急に悲しいことを思い出す。このターンの終了まで「行動不能」となる。[10点]',
        Severity: Major
        Found in lib/bcdice/game_system/DemonParasite.rb and 5 other locations - About 1 hr to fix
        lib/bcdice/game_system/DemonParasite.rb on lines 101..167
        lib/bcdice/game_system/DemonParasite.rb on lines 170..236
        lib/bcdice/game_system/DemonParasite.rb on lines 239..305
        lib/bcdice/game_system/DemonParasite.rb on lines 377..443
        lib/bcdice/game_system/DemonParasite.rb on lines 446..512

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

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

              MALFUNCTION_TABLE = [
                [
                  '『緊急停止』機能に異常発生。次のターンの終了まで、「行動不能」になる。[30点]',
                  '『動力不調』動力装置に異常発生。このターンの終了時まで、「行動不能」になる。[30点]',
                  '『腕部停止』腕部機構に異常発生。このターンの終了時まで、「タイミング:攻撃」が行えない。[20点]',
        Severity: Major
        Found in lib/bcdice/game_system/DemonParasite.rb and 5 other locations - About 1 hr to fix
        lib/bcdice/game_system/DemonParasite.rb on lines 101..167
        lib/bcdice/game_system/DemonParasite.rb on lines 170..236
        lib/bcdice/game_system/DemonParasite.rb on lines 308..374
        lib/bcdice/game_system/DemonParasite.rb on lines 377..443
        lib/bcdice/game_system/DemonParasite.rb on lines 446..512

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

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

              NEW_URGE_TABLE = [
                [
                  '『開眼』潜在能力が発揮される。10分間、あらゆる戦闘以外の判定に+5。',
                  '『集中』感覚が研ぎ澄まされる。次のターンの終了まで、射撃の命中判定に+5。',
                  '『迅速』運動神経が上昇する。20分間、戦闘以外の【機敏】判定に+5。',
        Severity: Major
        Found in lib/bcdice/game_system/DemonParasite.rb and 5 other locations - About 1 hr to fix
        lib/bcdice/game_system/DemonParasite.rb on lines 101..167
        lib/bcdice/game_system/DemonParasite.rb on lines 239..305
        lib/bcdice/game_system/DemonParasite.rb on lines 308..374
        lib/bcdice/game_system/DemonParasite.rb on lines 377..443
        lib/bcdice/game_system/DemonParasite.rb on lines 446..512

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

        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