bcdice/BCDice

View on GitHub

Showing 829 of 1,274 total issues

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

      def damageBonus(command)
        m = /^DB(\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 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 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 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 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 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/MeikyuDays.rb - About 35 mins to fix

        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/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/WARPS.rb - About 35 mins to fix

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

                    def result_nd6(total, _dice_total, dice_list, cmp_op, target)
              Severity: Minor
              Found in lib/bcdice/game_system/Arianrhod.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

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

                          def getReactionText(name, typeText1, typeText2, infos1, infos2)
                    Severity: Minor
                    Found in lib/bcdice/game_system/Dracurouge.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/ShinobiGami.rb - About 35 mins to fix

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

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

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

                                def result_nd6(total, dice_total, dice_list, cmp_op, target)
                          Severity: Minor
                          Found in lib/bcdice/game_system/GurpsFW.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 roll_attack has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                    def roll_attack(power_expression, dice_count_expression, border_expression, modification_operator, modification_expression)
                              Severity: Minor
                              Found in lib/bcdice/game_system/Irisbane.rb - About 35 mins to fix

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

                                      def getRollResultTextAndSuccesValue(dice, advancedRoll, rollTarget, accidentValue, isMuse)
                                Severity: Minor
                                Found in lib/bcdice/game_system/MetalHeadExtream.rb - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language