bcdice/BCDice

View on GitHub

Showing 1,176 of 1,233 total issues

Avoid too many return statements within this method.
Open

          return Result.fumble('決定的失敗')
Severity: Major
Found in lib/bcdice/game_system/EclipsePhase.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/LostRoyal.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return 'Pathetic(惨め)' if stepTotal >= pathetic
      Severity: Major
      Found in lib/bcdice/game_system/EarthDawn3.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

              return result_ndx(total, cmp_op, target)
        Severity: Major
        Found in lib/bcdice/base.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                    return roll_hope(Regexp.last_match(1).to_i)
          Severity: Major
          Found in lib/bcdice/game_system/LostRoyal.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return 'Average(そこそこ)' if stepTotal >= average
            Severity: Major
            Found in lib/bcdice/game_system/EarthDawn3.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

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

                Avoid too many return statements within this method.
                Open

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

                  Avoid too many return statements within this method.
                  Open

                        return ret if ret
                  Severity: Major
                  Found in lib/bcdice/base.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return 'Poor(お粗末)' if stepTotal >= poor
                    Severity: Major
                    Found in lib/bcdice/game_system/EarthDawn3.rb - About 30 mins to fix

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

                            ret =
                              case sides_list
                              when [100]
                                result_1d100(total, dice_total, cmp_op, target)
                              when [20]
                      Severity: Minor
                      Found in lib/bcdice/base.rb and 1 other location - About 30 mins to fix
                      lib/bcdice/deprecated/checker.rb on lines 20..27

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

                      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 getReactionDiceCommandResult(command)
                              return nil unless command =~ /^RT((\w\d*)(\w\d*))?/
                      
                              typeText1 = Regexp.last_match(2)
                              typeText2 = Regexp.last_match(3)
                      Severity: Minor
                      Found in lib/bcdice/game_system/Dracurouge.rb and 1 other location - About 30 mins to fix
                      lib/bcdice/game_system/Dracurouge.rb on lines 136..146

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

                      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

                              ret =
                                case sides_list
                                when [100]
                                  check_1D100(total, dice_total, cmp_op, target)
                                when [20]
                      Severity: Minor
                      Found in lib/bcdice/deprecated/checker.rb and 1 other location - About 30 mins to fix
                      lib/bcdice/base.rb on lines 200..207

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

                      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 getHeresyReactionDiceCommandResult(command)
                              return nil unless command =~ /^HRT((\w\d*)(\w\d*))?/
                      
                              typeText1 = Regexp.last_match(2)
                              typeText2 = Regexp.last_match(3)
                      Severity: Minor
                      Found in lib/bcdice/game_system/Dracurouge.rb and 1 other location - About 30 mins to fix
                      lib/bcdice/game_system/Dracurouge.rb on lines 123..133

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

                      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

                              when "FMB"
                                tableName = "ファンブル表"
                                table = [
                                  '武器が壊れる。ただし、メイスなど固い"叩き"武器は壊れない(ふりなおし)。',
                                  '武器が壊れる。ただし、フレイルなど固い"叩き"武器は壊れない(ふりなおし)。',
                      Severity: Major
                      Found in lib/bcdice/game_system/GurpsFW.rb and 5 other locations - About 25 mins to fix
                      lib/bcdice/game_system/GurpsFW.rb on lines 121..143
                      lib/bcdice/game_system/GurpsFW.rb on lines 143..165
                      lib/bcdice/game_system/GurpsFW.rb on lines 187..209
                      lib/bcdice/game_system/GurpsFW.rb on lines 209..231
                      lib/bcdice/game_system/GurpsFW.rb on lines 475..497

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

                      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

                              when "HIT"
                                tableName = "命中部位表"
                                table = [
                                  '脳',
                                  '脳',
                      Severity: Major
                      Found in lib/bcdice/game_system/GurpsFW.rb and 5 other locations - About 25 mins to fix
                      lib/bcdice/game_system/GurpsFW.rb on lines 121..143
                      lib/bcdice/game_system/GurpsFW.rb on lines 143..165
                      lib/bcdice/game_system/GurpsFW.rb on lines 165..187
                      lib/bcdice/game_system/GurpsFW.rb on lines 187..209
                      lib/bcdice/game_system/GurpsFW.rb on lines 475..497

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

                      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

                              when "HCRT"
                                tableName = "頭部打撃クリティカル表"
                                table = [
                                  '敵は即死する',
                                  '敵は意識を失う。30分ごとに生命力判定をして、成功すると意識を回復する。',
                      Severity: Major
                      Found in lib/bcdice/game_system/GurpsFW.rb and 5 other locations - About 25 mins to fix
                      lib/bcdice/game_system/GurpsFW.rb on lines 121..143
                      lib/bcdice/game_system/GurpsFW.rb on lines 165..187
                      lib/bcdice/game_system/GurpsFW.rb on lines 187..209
                      lib/bcdice/game_system/GurpsFW.rb on lines 209..231
                      lib/bcdice/game_system/GurpsFW.rb on lines 475..497

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

                      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

                              when "CRT"
                                tableName = "クリティカル表"
                                table = [
                                  '体を狙っていたら、相手は気絶(回復は30分後に生命力判定)。他はダメージ3倍。',
                                  '相手の防御点を無視。',
                      Severity: Major
                      Found in lib/bcdice/game_system/GurpsFW.rb and 5 other locations - About 25 mins to fix
                      lib/bcdice/game_system/GurpsFW.rb on lines 143..165
                      lib/bcdice/game_system/GurpsFW.rb on lines 165..187
                      lib/bcdice/game_system/GurpsFW.rb on lines 187..209
                      lib/bcdice/game_system/GurpsFW.rb on lines 209..231
                      lib/bcdice/game_system/GurpsFW.rb on lines 475..497

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

                      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

                              when "MFMB"
                                tableName = "呪文ファンブル表"
                                table = [
                                  '呪文が完全に失敗する。術者は1D点のダメージを受ける。',
                                  '呪文が術者にかかる。',
                      Severity: Major
                      Found in lib/bcdice/game_system/GurpsFW.rb and 5 other locations - About 25 mins to fix
                      lib/bcdice/game_system/GurpsFW.rb on lines 121..143
                      lib/bcdice/game_system/GurpsFW.rb on lines 143..165
                      lib/bcdice/game_system/GurpsFW.rb on lines 165..187
                      lib/bcdice/game_system/GurpsFW.rb on lines 209..231
                      lib/bcdice/game_system/GurpsFW.rb on lines 475..497

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

                      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

                              when "KHST"
                                tableName = "驚異的必殺技表"
                                table = [
                                  '命中判定に[1,1,1]でクリティカル。クリティカル表は参照せず、相手は即死。「分類:ネームド」「分類:魔将」に対しては最大HPの半分のダメージを与える。',
                                  '命中判定に[1,1,1]でクリティカル。クリティカル表は参照せず、致傷力3倍。',
                      Severity: Major
                      Found in lib/bcdice/game_system/GurpsFW.rb and 5 other locations - About 25 mins to fix
                      lib/bcdice/game_system/GurpsFW.rb on lines 121..143
                      lib/bcdice/game_system/GurpsFW.rb on lines 143..165
                      lib/bcdice/game_system/GurpsFW.rb on lines 165..187
                      lib/bcdice/game_system/GurpsFW.rb on lines 187..209
                      lib/bcdice/game_system/GurpsFW.rb on lines 209..231

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

                      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