bcdice/BCDice

View on GitHub

Showing 837 of 1,278 total issues

Method getSuccessInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def getSuccessInfo(diceList, crit)
        debug("checkSuccess diceList, crit", diceList, crit)

        diceCountHash = getDiceCountHash(diceList, crit)
        debug("diceCountHash", diceCountHash)
Severity: Minor
Found in lib/bcdice/game_system/Utakaze.rb - About 45 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 reRoll has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def reRoll(command, isStop)
        debug("ReRoll Begin", command)

        return nil unless /^ReRoll([\d,]+)(@(\d+))?>=(\d+)$/i =~ command

Severity: Minor
Found in lib/bcdice/game_system/BlindMythos.rb - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
Open

      def eval_game_system_specific_command(command)
        debug("eval_game_system_specific_command Begin")

        result = judgeRoll(command)
        return result unless result.nil?
Severity: Minor
Found in lib/bcdice/game_system/BlindMythos.rb - About 45 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 getCheckResult has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def getCheckResult(command)
        m = /^GS([-+]?\d+)?(?:(?:([@#])([-+]?\d+))(?:([@#])([-+]?\d+))?)?(?:(>=?)(\d+))?$/i.match(command)
        unless m
          return nil
        end
Severity: Minor
Found in lib/bcdice/game_system/GoblinSlayer.rb - About 45 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 rollFullAuto has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def rollFullAuto(bullet_count, diff, broken_number, dice_num)
        output = ""
        loopCount = 0

        counts = {
Severity: Minor
Found in lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb - About 45 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 get_roll_result has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def get_roll_result(result_text, success_dice, ten_dice, _desperaton_ten_dice, desperaton_botch_dice, difficulty)
Severity: Minor
Found in lib/bcdice/game_system/HunterTheReckoning5th.rb - About 45 mins to fix

    Method eval_game_system_specific_command has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def eval_game_system_specific_command(command)
            case command.upcase
            when /^(\d+)A(\d*)([CF]?)(\d*)([CF]?)(\d*)$/
              counts = Regexp.last_match(1).to_i
              judgment = Regexp.last_match(2).to_i
    Severity: Minor
    Found in lib/bcdice/game_system/BladeOfArcana.rb - About 45 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_nd6 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def result_nd6(total, _dice_total, dice_list, cmp_op, target)
            return nil unless cmp_op == :>=
    
            result = Result.new
            sequence = []
    Severity: Minor
    Found in lib/bcdice/game_system/GranCrest.rb - About 45 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 getTotalResult has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def getTotalResult(bitList, successList, countOneList, targetNumber, isStop, canReRoll)
    Severity: Minor
    Found in lib/bcdice/game_system/BlindMythos.rb - About 45 mins to fix

      Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def initialize(name, item1, item2, item3, item4, item5)
      Severity: Minor
      Found in lib/bcdice/game_system/ShuumatsuKikou.rb - About 45 mins to fix

        Method dice_command has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def dice_command(command)
              command = command.upcase if @enabled_upcase_input
        
              m = self.class.prefixes_pattern.match(command)
              unless m
        Severity: Minor
        Found in lib/bcdice/base.rb - About 45 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_legacy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def check_result_legacy(total, rand_results, cmp_op, target)
                sides_list = rand_results.map(&:sides)
                value_list = rand_results.map(&:value)
                dice_total = value_list.sum()
        
        
        Severity: Minor
        Found in lib/bcdice/deprecated/checker.rb - About 45 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 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber)
        Severity: Minor
        Found in lib/bcdice/game_system/Airgetlamh.rb - About 35 mins to fix

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

                def result_2d6(total, dice_total, _dice_list, cmp_op, target)
          Severity: Minor
          Found in lib/bcdice/game_system/MeikyuDays.rb - About 35 mins to fix

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

                  def result_2d6(total, dice_total, _dice_list, cmp_op, target)
            Severity: Minor
            Found in lib/bcdice/game_system/WARPS.rb - About 35 mins to fix

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

                    def result_2d6(total, dice_total, _dice_list, cmp_op, target)
              Severity: Minor
              Found in lib/bcdice/game_system/SharedFantasia.rb - About 35 mins to fix

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

                      def result_2d6(_total, dice_total, _dice_list, cmp_op, _target)
                Severity: Minor
                Found in lib/bcdice/game_system/KillDeathBusiness.rb - About 35 mins to fix

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

                        def result_2d6(total, dice_total, dice_list, cmp_op, target)
                  Severity: Minor
                  Found in lib/bcdice/game_system/MagicaLogia.rb - About 35 mins to fix

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

                          def result_2d6(_total, dice_total, _dice_list, cmp_op, _target)
                    Severity: Minor
                    Found in lib/bcdice/game_system/MetalHead.rb - About 35 mins to fix

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

                            def result_2d6(_total, _dice_total, dice_list, _cmp_op, _target)
                      Severity: Minor
                      Found in lib/bcdice/game_system/Gorilla.rb - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language