bcdice/BCDice

View on GitHub

Showing 837 of 1,278 total issues

Method checkRoll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def checkRoll(hasCritical, modify, target)
        dice_list = @randomizer.roll_barabara(2, 6)
        dice = dice_list.sum()
        diceText = dice_list.join(",")
        successValue = dice + modify
Severity: Minor
Found in lib/bcdice/game_system/TherapieSein.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getSuccess has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def getSuccess(targetNumber, stepTotal)
        return '自動失敗' if @isFailed

        successTable = getSuccessTable
        successInfo = get_table_by_number(targetNumber, successTable)
Severity: Minor
Found in lib/bcdice/game_system/EarthDawn3.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method check_result has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def check_result(total, rand_results, cmp_op, target)
      ret = check_result_legacy(total, rand_results, cmp_op, target)
      return ret if ret

      sides_list = rand_results.map(&:sides)
Severity: Minor
Found in lib/bcdice/base.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method result_nechronica has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def result_nechronica(value_list, target)
        if value_list.max >= target
          if value_list.max >= 11
            Result.critical(translate("Nechronica.critical"))
          else
Severity: Minor
Found in lib/bcdice/game_system/Nechronica.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid too many return statements within this method.
Open

        return "실패"
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 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 if total == 100
        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 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 getCombineRoll(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 getHitResult(count, damageFunc, tail)
              Severity: Major
              Found in lib/bcdice/game_system/BattleTech.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

                  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 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 nil
                        Severity: Major
                        Found in lib/bcdice/game_system/BattleTech.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 nil
                            Severity: Major
                            Found in lib/bcdice/game_system/BattleTech.rb - About 30 mins to fix

                              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.critical("Colossal Success")
                                Severity: Major
                                Found in lib/bcdice/game_system/Chill3.rb - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language