bcdice/BCDice

View on GitHub

Showing 1,176 of 1,233 total issues

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

          when /^KNT(\d+)/i
            type = '王国名決定'
            count = getCount(Regexp.last_match(1))
            total_n = @randomizer.roll_d66(D66SortType::ASC)

Severity: Minor
Found in lib/bcdice/game_system/MeikyuKingdomBasic.rb and 1 other location - About 35 mins to fix
lib/bcdice/game_system/MeikyuKingdom.rb on lines 399..410

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

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

        table = [
          [2, '大雨と強風。探索判定の難易度に+4。'],
          [3, '風が強い1日になりそう。探索判定の難易度に+2。'],
          [4, '晴れ。特になし。'],
          [5, '夜の間の雨でぬかるむ。探索判定の難易度に+2。'],
Severity: Minor
Found in lib/bcdice/game_system/Postman.rb and 2 other locations - About 35 mins to fix
lib/bcdice/game_system/Postman.rb on lines 163..175
lib/bcdice/game_system/meikyu_kingdom/item_table.rb on lines 284..296

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

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

        if mod
          if mod > 0
            output = "#{sk_bonus}[#{dice_str}]+#{mod}"
          else
            output = "#{sk_bonus}[#{dice_str}]#{mod}"
Severity: Minor
Found in lib/bcdice/game_system/TorgEternity.rb and 1 other location - About 35 mins to fix
lib/bcdice/game_system/Torg.rb on lines 64..71

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

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

        if advantage.empty?
          usedie = @randomizer.roll_once(20)
          roll_die = usedie
        else
          dice = @randomizer.roll_barabara(2, 20)
Severity: Minor
Found in lib/bcdice/game_system/DungeonsAndDragons5.rb and 1 other location - About 35 mins to fix
lib/bcdice/game_system/DungeonsAndDragons5.rb on lines 164..173

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

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

        if advantage.empty?
          usedie = @randomizer.roll_once(20)
          roll_die = usedie
        else
          dice = @randomizer.roll_barabara(2, 20)
Severity: Minor
Found in lib/bcdice/game_system/DungeonsAndDragons5.rb and 1 other location - About 35 mins to fix
lib/bcdice/game_system/DungeonsAndDragons5.rb on lines 88..97

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

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

        if mod
          if mod > 0
            output = "#{sk_bonus}[#{dice_str}]+#{mod}"
          else
            output = "#{sk_bonus}[#{dice_str}]#{mod}"
Severity: Minor
Found in lib/bcdice/game_system/Torg.rb and 1 other location - About 35 mins to fix
lib/bcdice/game_system/TorgEternity.rb on lines 83..90

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

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 <= cmd.fumble
            Result.fumble("ファンブル(判定失敗。改変度を1D6点増加してバタフライエフェクト発生)")
          elsif dice_total >= cmd.critical
            Result.critical("スペシャル(判定成功。疲労度を1D6点減少してバタフライエフェクト発生)")
          elsif cmd.cmp_op.nil?
Severity: Minor
Found in lib/bcdice/game_system/PastFutureParadox.rb and 1 other location - About 30 mins to fix
lib/bcdice/game_system/SRS.rb on lines 282..292

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

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 sum >= srs_roll.critical_value
          Result.critical("自動成功")
        elsif sum <= srs_roll.fumble_value
          Result.fumble("自動失敗")
        elsif srs_roll.target_value.nil?
Severity: Minor
Found in lib/bcdice/game_system/SRS.rb and 1 other location - About 30 mins to fix
lib/bcdice/game_system/PastFutureParadox.rb on lines 211..221

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

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 make_dice_roll(dice_pool)
        dice_list = @randomizer.roll_barabara(dice_pool, 10)

        dice_text = dice_list.join(',')
        success_dice = dice_list.count { |x| x >= 6 }
Severity: Minor
Found in lib/bcdice/game_system/HunterTheReckoning5th.rb and 1 other location - About 30 mins to fix
lib/bcdice/game_system/VampireTheMasquerade5th.rb on lines 175..183

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

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 make_dice_roll(dice_pool)
        dice_list = @randomizer.roll_barabara(dice_pool, 10)

        dice_text = dice_list.join(',')
        success_dice = dice_list.count { |x| x >= 6 }
Severity: Minor
Found in lib/bcdice/game_system/VampireTheMasquerade5th.rb and 1 other location - About 30 mins to fix
lib/bcdice/game_system/HunterTheReckoning5th.rb on lines 147..155

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

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

Avoid too many return statements within this method.
Open

        return output
Severity: Major
Found in lib/bcdice/game_system/Cthulhu7th_Korean.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return Result.success("Low Success")
    Severity: Major
    Found in lib/bcdice/game_system/Chill3.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return fumble_text if fumbleable
      Severity: Major
      Found in lib/bcdice/game_system/Cthulhu7th_Korean.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return Result.success("High Success")
        Severity: Major
        Found in lib/bcdice/game_system/Chill3.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                    return Result.failure("Failure")
          Severity: Major
          Found in lib/bcdice/game_system/Chill3.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return fumble_text
            Severity: Major
            Found in lib/bcdice/game_system/Cthulhu7th_Korean.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                        return getRegistResult(command)
              Severity: Major
              Found in lib/bcdice/game_system/Cthulhu.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return nil
                Severity: Major
                Found in lib/bcdice/game_system/Cthulhu.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return Result.critical("Colossal Success")
                  Severity: Major
                  Found in lib/bcdice/game_system/Chill3.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                              return nil
                    Severity: Major
                    Found in lib/bcdice/game_system/NeverCloud.rb - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language