bcdice/BCDice

View on GitHub

Showing 809 of 1,233 total issues

Method result_nd10 has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def result_nd10(total, _dice_total, value_list, cmp_op, target)
Severity: Minor
Found in lib/bcdice/game_system/Nechronica.rb - About 35 mins to fix

    Method check_nD10 has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def check_nD10(total, dice_total, dice_list, cmp_op, target); end
    Severity: Minor
    Found in lib/bcdice/deprecated/checker.rb - About 35 mins to fix

      Method result_nd10 has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def result_nd10(total, dice_total, value_list, cmp_op, target); end
      Severity: Minor
      Found in lib/bcdice/base.rb - About 35 mins to fix

        Method result_2d6 has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def result_2d6(total, dice_total, value_list, cmp_op, target); end
        Severity: Minor
        Found in lib/bcdice/base.rb - About 35 mins to fix

          Method check_nD6 has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def check_nD6(total, dice_total, dice_list, cmp_op, target); end
          Severity: Minor
          Found in lib/bcdice/deprecated/checker.rb - About 35 mins to fix

            Method check_2D6 has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def check_2D6(total, dice_total, dice_list, cmp_op, target); end
            Severity: Minor
            Found in lib/bcdice/deprecated/checker.rb - About 35 mins to fix

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

                    def getCombineRoll(command)
                      return nil unless /CBR\((\d+),(\d+)\)/i =~ command
              
                      diff_1 = Regexp.last_match(1).to_i
                      diff_2 = Regexp.last_match(2).to_i
              Severity: Minor
              Found in lib/bcdice/game_system/Cthulhu7th_Korean.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_action has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def check_action(command)
                      m = /^(\d+)(?:NC|D6?)((?:[-+]\d+)*)(>=(\d+))?$/i.match(command)
                      dice_count = m[1].to_i
                      modify_str = m[2]
                      modify_number = ArithmeticEvaluator.eval(modify_str)
              Severity: Minor
              Found in lib/bcdice/game_system/NeverCloud.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 eval_game_system_specific_command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def eval_game_system_specific_command(string)
                      cmd = parse_nw(string) || parse_2r6(string)
                      unless cmd
                        return nil
                      end
              Severity: Minor
              Found in lib/bcdice/game_system/NightWizard.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 roll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      def roll(randomizer)
                        dice = randomizer.roll_once(6)
                        chosen = TABLE[dice - 1]
              
                        Result.new.tap do |r|
              Severity: Minor
              Found in lib/bcdice/game_system/KamitsubakiCityUnderConstructionNarrative.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 proc_dice_2nd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def proc_dice_2nd(match)
                      output_text = ''
                      total_success_num = 0
              
                      difficulty = DIFFICULTY_SYMBOL_TO_INTEGER.fetch(match[1])
              Severity: Minor
              Found in lib/bcdice/game_system/NinjaSlayer2.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_2d6 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def result_2d6(total, dice_total, _dice_list, cmp_op, target)
                      return nil unless cmp_op == :<=
              
                      if dice_total <= 2
                        Result.critical("クリティカル")
              Severity: Minor
              Found in lib/bcdice/game_system/WARPS.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_roll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def check_roll(dice_count, count_no)
                      dice_array = @randomizer.roll_barabara(dice_count, 10).sort
                      dice_text = dice_array.join(',')
              
                      result_array = []
              Severity: Minor
              Found in lib/bcdice/game_system/OrgaRain.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 consciousness_roll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def consciousness_roll(damage)
                      unless (1..6).include?(damage)
                        return nil
                      end
              
              
              Severity: Minor
              Found in lib/bcdice/game_system/BattleTech.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 compare_result has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def compare_result(success)
                      if success < 0
                        Result.fumble(translate("fumble"))
                      elsif success == 0
                        Result.failure(translate("failure"))
              Severity: Minor
              Found in lib/bcdice/game_system/Emoklore.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_roll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def check_roll(string)
                      parser = Command::Parser.new(/RC\d+/, round_type: round_type)
                                              .restrict_cmp_op_to(nil)
                      cmd = parser.parse(string)
                      return nil unless cmd
              Severity: Minor
              Found in lib/bcdice/game_system/DesperateRun.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 eval_game_system_specific_command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def eval_game_system_specific_command(command) # ダイスロールコマンド
                      # 通常判定部分をgetJudgeResultコマンドに切り分け
                      result = getJudgeResult(command)
                      return result unless result.nil?
              
              
              Severity: Minor
              Found in lib/bcdice/game_system/Paradiso.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_2d6 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def result_2d6(total, dice_total, _dice_list, cmp_op, target)
                      return nil unless cmp_op == :>=
              
                      if dice_total <= 2
                        Result.fumble("絶対失敗")
              Severity: Minor
              Found in lib/bcdice/game_system/MeikyuDays.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 checkRoll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def checkRoll(diceCount, target, damage)
                      target = 1 if target < 1
                      target = 10 if target > 10
              
                      diceArray = @randomizer.roll_barabara(diceCount, 10).sort
              Severity: Minor
              Found in lib/bcdice/game_system/Strave.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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      def result(total)
                        if total <= @critical
                          Result.critical("クリティカル!")
                        elsif total >= @fumble
                          Result.fumble("ファンブル!")
              Severity: Minor
              Found in lib/bcdice/game_system/FilledWith.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

              Severity
              Category
              Status
              Source
              Language