bcdice/BCDice

View on GitHub

Showing 388 of 1,274 total issues

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

      def origin_protection(order)
        natural_result = @randomizer.roll_barabara(4, 6)
        case order[1]
        when "R"
          message = fate_reversal(natural_result)
Severity: Minor
Found in lib/bcdice/game_system/HeroScale.rb and 1 other location - About 55 mins to fix
lib/bcdice/game_system/HeroScale.rb on lines 313..326

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

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 fate_ordeal(natural_result)
        modified_result = []
        natural_result.each do |result|
          if result < 9
            result = 9
Severity: Minor
Found in lib/bcdice/game_system/HeroScale.rb and 1 other location - About 55 mins to fix
lib/bcdice/game_system/HeroScale.rb on lines 760..771

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

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

        gsuc = [2, 4, 6, 7, 9, 10, 12, 13, 14, 15, 17, 18, 20, 21, 22, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 50, 51, 52, 53, 54,]
Severity: Major
Found in lib/bcdice/game_system/EarthDawn.rb and 4 other locations - About 55 mins to fix
lib/bcdice/game_system/EarthDawn.rb on lines 164..164
lib/bcdice/game_system/EarthDawn.rb on lines 165..165
lib/bcdice/game_system/EarthDawn.rb on lines 167..167
lib/bcdice/game_system/EarthDawn.rb on lines 168..168

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

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 fate_anguish(natural_result)
        modified_result = []
        natural_result.each do |result|
          if result < 7
            result = 7
Severity: Minor
Found in lib/bcdice/game_system/HeroScale.rb and 1 other location - About 55 mins to fix
lib/bcdice/game_system/HeroScale.rb on lines 774..785

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

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

        nsuc = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,]
Severity: Major
Found in lib/bcdice/game_system/EarthDawn.rb and 4 other locations - About 55 mins to fix
lib/bcdice/game_system/EarthDawn.rb on lines 164..164
lib/bcdice/game_system/EarthDawn.rb on lines 165..165
lib/bcdice/game_system/EarthDawn.rb on lines 166..166
lib/bcdice/game_system/EarthDawn.rb on lines 168..168

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

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

        ssuc = [4, 6, 8, 10, 11, 13, 15, 16, 18, 19, 21, 22, 24, 26, 27, 29, 30, 32, 33, 34, 35, 37, 38, 40, 41, 42, 43, 45, 46, 47, 48, 49, 51, 52, 53, 55, 56, 58, 59, 60, 61, 62,]
Severity: Major
Found in lib/bcdice/game_system/EarthDawn.rb and 4 other locations - About 55 mins to fix
lib/bcdice/game_system/EarthDawn.rb on lines 164..164
lib/bcdice/game_system/EarthDawn.rb on lines 166..166
lib/bcdice/game_system/EarthDawn.rb on lines 167..167
lib/bcdice/game_system/EarthDawn.rb on lines 168..168

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

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

        fsuc = [0, 1, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 18, 18, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 30,]
Severity: Major
Found in lib/bcdice/game_system/EarthDawn.rb and 4 other locations - About 55 mins to fix
lib/bcdice/game_system/EarthDawn.rb on lines 164..164
lib/bcdice/game_system/EarthDawn.rb on lines 165..165
lib/bcdice/game_system/EarthDawn.rb on lines 166..166
lib/bcdice/game_system/EarthDawn.rb on lines 167..167

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

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

        exsuc = [6, 8, 10, 12, 14, 17, 19, 20, 22, 24, 25, 27, 29, 32, 33, 35, 37, 38, 39, 41, 42, 44, 45, 47, 48, 49, 51, 52, 54, 55, 56, 58, 59, 60, 62, 64, 65, 67, 68, 70, 71, 72,]
Severity: Major
Found in lib/bcdice/game_system/EarthDawn.rb and 4 other locations - About 55 mins to fix
lib/bcdice/game_system/EarthDawn.rb on lines 165..165
lib/bcdice/game_system/EarthDawn.rb on lines 166..166
lib/bcdice/game_system/EarthDawn.rb on lines 167..167
lib/bcdice/game_system/EarthDawn.rb on lines 168..168

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

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

          'CST' => {
            name: "現状表",
            type: 'D66',
            table: [
              '逃れえぬ恐怖:かつての悪夢は心を握りしめ、離してはくれない。平時は暗がりの隅で一人震え、ぶつぶつと呟くばかり。友らは、立ち直らせようとしてくれているが……。 リーダー度:2',
Severity: Major
Found in lib/bcdice/game_system/ColossalHunter.rb and 5 other locations - About 50 mins to fix
lib/bcdice/game_system/ColossalHunter.rb on lines 279..319
lib/bcdice/game_system/ColossalHunter.rb on lines 365..405
lib/bcdice/game_system/ColossalHunter.rb on lines 408..448
lib/bcdice/game_system/ColossalHunter.rb on lines 451..491
lib/bcdice/game_system/ColossalHunter.rb on lines 494..534

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

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

          'EXT' => {
            name: "専門能力表",
            type: 'D66',
            table: [
              'メンタル 分類:準備',
Severity: Major
Found in lib/bcdice/game_system/ColossalHunter.rb and 5 other locations - About 50 mins to fix
lib/bcdice/game_system/ColossalHunter.rb on lines 279..319
lib/bcdice/game_system/ColossalHunter.rb on lines 322..362
lib/bcdice/game_system/ColossalHunter.rb on lines 365..405
lib/bcdice/game_system/ColossalHunter.rb on lines 408..448
lib/bcdice/game_system/ColossalHunter.rb on lines 451..491

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

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

          'SPT' => {
            name: "特徴表",
            type: 'D66',
            table: [
              '死んだ魚の目',
Severity: Major
Found in lib/bcdice/game_system/ColossalHunter.rb and 5 other locations - About 50 mins to fix
lib/bcdice/game_system/ColossalHunter.rb on lines 279..319
lib/bcdice/game_system/ColossalHunter.rb on lines 322..362
lib/bcdice/game_system/ColossalHunter.rb on lines 365..405
lib/bcdice/game_system/ColossalHunter.rb on lines 451..491
lib/bcdice/game_system/ColossalHunter.rb on lines 494..534

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

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

          'HMT' => {
            name: "ハンターマーク表",
            type: 'D66',
            table: [
              '顔',
Severity: Major
Found in lib/bcdice/game_system/ColossalHunter.rb and 5 other locations - About 50 mins to fix
lib/bcdice/game_system/ColossalHunter.rb on lines 279..319
lib/bcdice/game_system/ColossalHunter.rb on lines 322..362
lib/bcdice/game_system/ColossalHunter.rb on lines 408..448
lib/bcdice/game_system/ColossalHunter.rb on lines 451..491
lib/bcdice/game_system/ColossalHunter.rb on lines 494..534

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

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

          {
            "PTAG" => DiceTable::D66Table.from_i18n("LogHorizon.table.PTAG", locale),
            "KOYU" => DiceTable::D66Table.from_i18n("LogHorizon.table.KOYU", locale),
            "MGR1" => DiceTable::D66Table.from_i18n("LogHorizon.table.MGR1", locale),
            "MGR2" => DiceTable::D66Table.from_i18n("LogHorizon.table.MGR2", locale),
Severity: Minor
Found in lib/bcdice/game_system/LogHorizon.rb and 1 other location - About 50 mins to fix
lib/bcdice/game_system/SkynautsBouken.rb on lines 65..72

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

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

          {
            'FT' => DiceTable::Table.from_i18n('SkynautsBouken.FumbleTable', locale),
            'NV' => DiceTable::Table.from_i18n('SkynautsBouken.VoyageTable', locale),
            "NEN" => DiceTable::Table.from_i18n('SkynautsBouken.NavigationEventNavigationTable', locale),
            "NEE" => DiceTable::Table.from_i18n('SkynautsBouken.NavigationEventEncounterTable', locale),
Severity: Minor
Found in lib/bcdice/game_system/SkynautsBouken.rb and 1 other location - About 50 mins to fix
lib/bcdice/game_system/LogHorizon.rb on lines 524..531

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

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

          'AWT' => {
            name: "覚醒表",
            type: 'D66',
            table: [
              '実験体:当時ハンターを人工的に作り出すべく、倫理を無視した研究が多数行われていた。あなたこそ、無数の犠牲の上に生まれた……数少ない成功作なのだ。',
Severity: Major
Found in lib/bcdice/game_system/ColossalHunter.rb and 5 other locations - About 50 mins to fix
lib/bcdice/game_system/ColossalHunter.rb on lines 322..362
lib/bcdice/game_system/ColossalHunter.rb on lines 365..405
lib/bcdice/game_system/ColossalHunter.rb on lines 408..448
lib/bcdice/game_system/ColossalHunter.rb on lines 451..491
lib/bcdice/game_system/ColossalHunter.rb on lines 494..534

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

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

          'PRT' => {
            name: "プレシャス表",
            type: 'D66',
            table: [
              '壊れたスマートフォン',
Severity: Major
Found in lib/bcdice/game_system/ColossalHunter.rb and 5 other locations - About 50 mins to fix
lib/bcdice/game_system/ColossalHunter.rb on lines 279..319
lib/bcdice/game_system/ColossalHunter.rb on lines 322..362
lib/bcdice/game_system/ColossalHunter.rb on lines 365..405
lib/bcdice/game_system/ColossalHunter.rb on lines 408..448
lib/bcdice/game_system/ColossalHunter.rb on lines 494..534

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

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 get_shoot_fumble_table(num) # 射撃攻撃ファンブル表
        output = '1'
        table = [
          '暴発した。使用した射撃武器が搭載されている部位に命中レベルAで命中する。',
          'あまりに無様な誤射をした。パイロットの精神的負傷が2段階上昇する。',
Severity: Minor
Found in lib/bcdice/game_system/EmbryoMachine.rb and 1 other location - About 45 mins to fix
lib/bcdice/game_system/EmbryoMachine.rb on lines 189..214

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

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 get_melee_fumble_table(num) # 白兵攻撃ファンブル表
        output = '1'
        table = [
          '大振りしすぎた。使用した白兵武器が搭載されている部位の反対の部位(右腕に搭載されているなら左側)に命中レベルAで命中する。',
          '激しく頭を打った。パイロットの肉体的負傷が2段階上昇する。',
Severity: Minor
Found in lib/bcdice/game_system/EmbryoMachine.rb and 1 other location - About 45 mins to fix
lib/bcdice/game_system/EmbryoMachine.rb on lines 161..186

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

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 interim_expr(cmd, dice_total)
        if @dice_list.flatten.size == 1 && cmd.modify_number == 0
          return nil
        end

Severity: Minor
Found in lib/bcdice/game_system/TokumeiTenkousei.rb and 1 other location - About 45 mins to fix
lib/bcdice/game_system/TunnelsAndTrolls.rb on lines 230..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 41.

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 interim_expr(cmd, dice_total)
        if @dice_list.flatten.size == 1 && cmd.modify_number == 0
          return nil
        end

Severity: Minor
Found in lib/bcdice/game_system/TunnelsAndTrolls.rb and 1 other location - About 45 mins to fix
lib/bcdice/game_system/TokumeiTenkousei.rb on lines 75..83

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

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