bcdice/BCDice

View on GitHub

Showing 367 of 1,233 total issues

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

      def get_scene_production_table(roc)
        name = "シーン演出表"
        table = [
          [1, '相談。君は相手に相談したいことがあった。'],
          [2, '遊び。君は相手と遊びたかった。'],
Severity: Minor
Found in lib/bcdice/game_system/AlterRaise.rb and 2 other locations - About 25 mins to fix
lib/bcdice/game_system/AlterRaise.rb on lines 114..124
lib/bcdice/game_system/AlterRaise.rb on lines 216..226

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

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 = [
          [1, lambda { mk_passage_placename_table(@randomizer.roll_d66(D66SortType::ASC)) }],
          [2, lambda { mk_natural_placename_table(@randomizer.roll_d66(D66SortType::ASC)) }],
          [3, lambda { mk_artifact_placename_table(@randomizer.roll_d66(D66SortType::ASC)) }],
        ]
Severity: Minor
Found in lib/bcdice/game_system/meikyu_kingdom/placename_table.rb and 1 other location - About 25 mins to fix
lib/bcdice/game_system/meikyu_kingdom/placename_table.rb on lines 29..33

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

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

      def get_stance_table(roc)
        name = "スタンス表"
        table = [
          [1, '友人'],
          [2, '恋愛'],
Severity: Minor
Found in lib/bcdice/game_system/AlterRaise.rb and 2 other locations - About 25 mins to fix
lib/bcdice/game_system/AlterRaise.rb on lines 114..124
lib/bcdice/game_system/AlterRaise.rb on lines 203..213

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

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

        4 => DiceTable::RangeTable.new(
          "ナンバーワンノーマルくじ(phase 4)",
          "1D6",
          [
            [1, "特性スタミナポーション"],
Severity: Major
Found in lib/bcdice/game_system/filled_with/lot_tables.rb and 5 other locations - About 25 mins to fix
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 34..44
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 60..70
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 101..111
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 114..124
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 127..137

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

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

      def get_personality_table(roc)
        name = "性格傾向表"
        table = [
          [1, '挑戦'],
          [2, '調和'],
Severity: Minor
Found in lib/bcdice/game_system/AlterRaise.rb and 2 other locations - About 25 mins to fix
lib/bcdice/game_system/AlterRaise.rb on lines 203..213
lib/bcdice/game_system/AlterRaise.rb on lines 216..226

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

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

        3 => DiceTable::RangeTable.new(
          "ナンバーワンプレミアムくじ(phase 3)",
          "1D6",
          [
            [1, "特性クイックHPポーション"],
Severity: Major
Found in lib/bcdice/game_system/filled_with/lot_tables.rb and 5 other locations - About 25 mins to fix
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 34..44
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 47..57
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 60..70
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 114..124
lib/bcdice/game_system/filled_with/lot_tables.rb on lines 127..137

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

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

              when RE_COUNT_SATZ_BATZ
                # サツバツ!カウント
                check_result = check_difficulty(roll_result.last_dice_list, s_to_i(Regexp.last_match[1], 6), ">=", "サツバツ!")
                output_text += ", #{check_result[0]}"
                success_num += check_result[1]
Severity: Minor
Found in lib/bcdice/game_system/NinjaSlayer2.rb and 1 other location - About 25 mins to fix
lib/bcdice/game_system/NinjaSlayer2.rb on lines 137..142

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

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

              when RE_COUNT_CRITICAL
                # クリティカル!カウント
                check_result = check_difficulty(roll_result.last_dice_list, s_to_i(Regexp.last_match[1], 6), ">=", "クリティカル!")
                output_text += ", #{check_result[0]}"
                success_num += check_result[1]
Severity: Minor
Found in lib/bcdice/game_system/NinjaSlayer2.rb and 1 other location - About 25 mins to fix
lib/bcdice/game_system/NinjaSlayer2.rb on lines 132..137

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

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 initialize(name, type, items)
        @name = name
        @items = items.freeze

        m = /(\d+)D(\d+)/i.match(type)
Severity: Minor
Found in lib/bcdice/dice_table/chain_table.rb and 3 other locations - About 20 mins to fix
lib/bcdice/dice_table/table.rb on lines 18..28
lib/bcdice/game_system/beginning_idol/chain_table.rb on lines 10..20
lib/bcdice/game_system/one_way_heroics/random_event_table.rb on lines 7..17

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

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

        if /(\w)DPT([+\-\d]*)/i =~ string
          ttype = 'ダメージペナルティー'
          head = Regexp.last_match(1)
          mod = ArithmeticEvaluator.eval(Regexp.last_match(2)) if Regexp.last_match(2)

Severity: Minor
Found in lib/bcdice/game_system/GundogRevised.rb and 3 other locations - About 20 mins to fix
lib/bcdice/game_system/GundogRevised.rb on lines 81..87
lib/bcdice/game_system/GundogZero.rb on lines 40..46
lib/bcdice/game_system/GundogZero.rb on lines 49..55

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

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 initialize(name, type, items)
          @name = name
          @items = items.freeze

          m = /(\d+)D(\d+)/i.match(type)
Severity: Minor
Found in lib/bcdice/game_system/one_way_heroics/random_event_table.rb and 3 other locations - About 20 mins to fix
lib/bcdice/dice_table/chain_table.rb on lines 9..19
lib/bcdice/dice_table/table.rb on lines 18..28
lib/bcdice/game_system/beginning_idol/chain_table.rb on lines 10..20

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

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

        if /(\w)DPT([+\-\d]*)/i =~ string
          ttype = 'ダメージペナルティー'
          head = Regexp.last_match(1)
          mod = ArithmeticEvaluator.eval(Regexp.last_match(2)) if Regexp.last_match(2)

Severity: Minor
Found in lib/bcdice/game_system/GundogZero.rb and 3 other locations - About 20 mins to fix
lib/bcdice/game_system/GundogRevised.rb on lines 72..78
lib/bcdice/game_system/GundogRevised.rb on lines 81..87
lib/bcdice/game_system/GundogZero.rb on lines 49..55

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

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

        if /(\w)FT([+\-\d]*)/i =~ string
          ttype = 'ファンブル'
          head = Regexp.last_match(1)
          mod = ArithmeticEvaluator.eval(Regexp.last_match(2)) if Regexp.last_match(2)

Severity: Minor
Found in lib/bcdice/game_system/GundogZero.rb and 3 other locations - About 20 mins to fix
lib/bcdice/game_system/GundogRevised.rb on lines 72..78
lib/bcdice/game_system/GundogRevised.rb on lines 81..87
lib/bcdice/game_system/GundogZero.rb on lines 40..46

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

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 initialize(name, type, items)
          @name = name
          @items = items.freeze

          m = /^(\d+)D(\d+)$/i.match(type)
Severity: Minor
Found in lib/bcdice/game_system/beginning_idol/chain_table.rb and 3 other locations - About 20 mins to fix
lib/bcdice/dice_table/chain_table.rb on lines 9..19
lib/bcdice/dice_table/table.rb on lines 18..28
lib/bcdice/game_system/one_way_heroics/random_event_table.rb on lines 7..17

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

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

        if dice_total <= 2
          Result.fumble(translate("BeginningIdol.fumble"))
        elsif dice_total >= 12
          Result.critical(translate("BeginningIdol.special"))
        elsif total >= target
Severity: Minor
Found in lib/bcdice/game_system/BeginningIdol.rb and 1 other location - About 20 mins to fix
lib/bcdice/game_system/MagicaLogia.rb on lines 68..76

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

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

          if dice_total <= 2
            Result.fumble(translate("fumble"))
          elsif dice_total >= 12
            Result.critical(translate("MagicaLogia.special"))
          elsif total >= target
Severity: Minor
Found in lib/bcdice/game_system/MagicaLogia.rb and 1 other location - About 20 mins to fix
lib/bcdice/game_system/BeginningIdol.rb on lines 81..89

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

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 initialize(name, type, items)
        @name = name
        @items = items.freeze

        m = /(\d+)D(\d+)/i.match(type)
Severity: Minor
Found in lib/bcdice/dice_table/table.rb and 3 other locations - About 20 mins to fix
lib/bcdice/dice_table/chain_table.rb on lines 9..19
lib/bcdice/game_system/beginning_idol/chain_table.rb on lines 10..20
lib/bcdice/game_system/one_way_heroics/random_event_table.rb on lines 7..17

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

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

        if /(\w)FT([+\-\d]*)/i =~ string
          ttype = 'ファンブル'
          head = Regexp.last_match(1)
          mod = ArithmeticEvaluator.eval(Regexp.last_match(2)) if Regexp.last_match(2)

Severity: Minor
Found in lib/bcdice/game_system/GundogRevised.rb and 3 other locations - About 20 mins to fix
lib/bcdice/game_system/GundogRevised.rb on lines 72..78
lib/bcdice/game_system/GundogZero.rb on lines 40..46
lib/bcdice/game_system/GundogZero.rb on lines 49..55

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

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

          "BL" => {
            name: "血脈の喪失表",
            type: '1D20',
            table: [
              '髪の色。一夜にしてあなたの髪は白くなった。',
Severity: Major
Found in lib/bcdice/game_system/Nuekagami.rb and 8 other locations - About 20 mins to fix
lib/bcdice/game_system/Nuekagami.rb on lines 45..69
lib/bcdice/game_system/Nuekagami.rb on lines 99..123
lib/bcdice/game_system/Nuekagami.rb on lines 126..150
lib/bcdice/game_system/Nuekagami.rb on lines 153..177
lib/bcdice/game_system/Nuekagami.rb on lines 180..204
lib/bcdice/game_system/Nuekagami.rb on lines 207..231
lib/bcdice/game_system/Nuekagami.rb on lines 234..258
lib/bcdice/game_system/Nuekagami.rb on lines 261..285

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

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

          "OG" => {
            name: "応天門通過描写表",
            type: '1D20',
            table: [
              '光捕らへど暗し。新たなる地獄の門に落つる己を知りたり。',
Severity: Major
Found in lib/bcdice/game_system/Nuekagami.rb and 8 other locations - About 20 mins to fix
lib/bcdice/game_system/Nuekagami.rb on lines 45..69
lib/bcdice/game_system/Nuekagami.rb on lines 72..96
lib/bcdice/game_system/Nuekagami.rb on lines 99..123
lib/bcdice/game_system/Nuekagami.rb on lines 126..150
lib/bcdice/game_system/Nuekagami.rb on lines 153..177
lib/bcdice/game_system/Nuekagami.rb on lines 180..204
lib/bcdice/game_system/Nuekagami.rb on lines 207..231
lib/bcdice/game_system/Nuekagami.rb on lines 234..258

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

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

Severity
Category
Status
Source
Language