bcdice/BCDice

View on GitHub

Showing 837 of 1,278 total issues

Method get_exploration_table has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def get_exploration_table
        dice = @randomizer.roll_once(20)
        case dice
        when 1
          text = "クソっ!このマスに付与されていた\[手がかり\]を失う。"
Severity: Minor
Found in lib/bcdice/game_system/Paradiso.rb - About 1 hr to fix

    Method roll_gr has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def roll_gr(command)
            parser = Command::Parser.new("GR", round_type: round_type)
                                    .enable_fumble
                                    .restrict_cmp_op_to(nil, :>=)
            cmd = parser.parse(command)
    Severity: Minor
    Found in lib/bcdice/game_system/Garako.rb - About 1 hr to fix

      Method check_action has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def check_action(command)
              parser = Command::Parser.new("AB", round_type: RoundType::CEIL).has_prefix_number.enable_critical.enable_dollar.restrict_cmp_op_to(nil, :>=)
              parsed = parser.parse(command)
              return nil if parsed.nil?
      
      
      Severity: Minor
      Found in lib/bcdice/game_system/Ayabito.rb - About 1 hr to fix

        Method check_roll has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def check_roll(command)
                m = %r{^RB(-?\d+([+\-*/]\d+)*)(@(\d+))?(#(\d+))?$}.match(command)
                unless m
                  return nil
                end
        Severity: Minor
        Found in lib/bcdice/game_system/RuinBreakers.rb - About 1 hr to fix

          Method getCreateSatasupeResult has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def getCreateSatasupeResult(counts)
                  debug("getCreateSatasupeResult counts", counts)
          
                  name = "サタスペ作成"
          
          
          Severity: Minor
          Found in lib/bcdice/game_system/Satasupe.rb - About 1 hr to fix

            Method check_roll_loop has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def check_roll_loop(roll_times, min_suc, target, critical, fumble, is_critical_stop)
                    dice_str = ''
                    is_fumble = false
                    is_critical = false
                    total_suc = 0
            Severity: Minor
            Found in lib/bcdice/game_system/Satasupe.rb - About 1 hr to fix

              Method twohands_damage_roll has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def twohands_damage_roll(command)
                      m = /^2H(\d+)D(\d+)([+-]\d+)?/.match(command)
                      unless m
                        return nil
                      end
              Severity: Minor
              Found in lib/bcdice/game_system/DungeonsAndDragons5.rb - About 1 hr to fix

                Method checkDamage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def checkDamage(diceCount, armor)
                        if diceCount <= 0
                          correction = 1 + diceCount * -1
                          rollCount = 1
                        else
                Severity: Minor
                Found in lib/bcdice/game_system/Raisondetre.rb - About 1 hr to fix

                  Method roll_burst has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def roll_burst(command)
                          m = /^(\d{2})C$/.match(command)
                          unless m
                            return nil
                          end
                  Severity: Minor
                  Found in lib/bcdice/game_system/BeginningIdol.rb - About 1 hr to fix

                    Method resolute_action has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def resolute_action(command)
                            m = /^TC([+\d]*)(>=(\d+))?/.match(command)
                            return nil unless m
                    
                            bonus =
                    Severity: Minor
                    Found in lib/bcdice/game_system/TrailOfCthulhu.rb - About 1 hr to fix

                      Method getDamageResult has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def getDamageResult(command)
                              biggun = [0, 0, 0]
                      
                              case command
                              when /^DC(\d+)(\[(\d+)(,(\d+))?(,(\d+))?(,(\d+))?(,(\d+))?(,(\d+))?\])?$/i
                      Severity: Minor
                      Found in lib/bcdice/game_system/Paradiso.rb - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def check_action(command)
                              parser = Command::Parser.new("BK", round_type: RoundType::FLOOR).enable_critical.enable_prefix_number.has_suffix_number
                              parsed = parser.parse(command)
                              return nil if parsed.nil?
                      
                      
                      Severity: Minor
                      Found in lib/bcdice/game_system/Bakenokawa.rb - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def check_roll(command)
                              m = /^(\d+)D6([+\-\d]*)>=(\?|\d+)(\[(\d+)?(,(\d+))?\])?$/i.match(command)
                              unless m
                                return nil
                              end
                      Severity: Minor
                      Found in lib/bcdice/game_system/MonotoneMuseum.rb - About 1 hr 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_gr has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def roll_gr(command)
                              parser = Command::Parser.new("GR", round_type: round_type)
                                                      .enable_fumble
                                                      .restrict_cmp_op_to(nil, :>=)
                              cmd = parser.parse(command)
                      Severity: Minor
                      Found in lib/bcdice/game_system/Garako.rb - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def eval_game_system_specific_command(string)
                              string = replace_text(string)
                      
                              return nil unless /(^|\s)S?((\d+)[rR]6(\[([,\d]+)\])?)(\s|$)/i =~ string
                      
                      
                      Severity: Minor
                      Found in lib/bcdice/game_system/BarnaKronika.rb - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def eval_game_system_specific_command(command)
                              command = command.upcase
                      
                              if (table = self.class::TABLES[command])
                                table.roll(@randomizer)
                      Severity: Minor
                      Found in lib/bcdice/game_system/StellarKnights.rb - About 1 hr 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_AlterRaise_d66_table_result has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def get_AlterRaise_d66_table_result(name, table, roc)
                              if roc > 10
                                diceText = roc.to_s
                                dice1 = diceText[0, 1].to_i
                                dice1 = 6 if dice1 > 6
                      Severity: Minor
                      Found in lib/bcdice/game_system/AlterRaise.rb - About 1 hr 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_1d100 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def result_1d100(total, _dice_total, cmp_op, target)
                              return Result.nothing if target == '?'
                              return nil unless cmp_op == :<=
                      
                              t10 = total / 10
                      Severity: Minor
                      Found in lib/bcdice/game_system/Warhammer4.rb - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def eval_game_system_specific_command(command)
                              parser = Command::Parser.new("LWD", "LW", round_type: round_type)
                                                      .restrict_cmp_op_to(nil, :<=)
                              cmd = parser.parse(command)
                      
                      
                      Severity: Minor
                      Found in lib/bcdice/game_system/RecordOfLodossWar.rb - About 1 hr 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_torg_eternity_damage_bonus_dice has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def get_torg_eternity_damage_bonus_dice(number)
                              debug("bonus dice roll : #{number}")
                              value_roll = 0
                              output_roll = ""
                              if number > 0
                      Severity: Minor
                      Found in lib/bcdice/game_system/TorgEternity.rb - About 1 hr 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