bcdice/BCDice

View on GitHub

Showing 837 of 1,278 total issues

Method get_urge has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def get_urge(string) # パラサイトブラッドの衝動表
        unless /(\w*)URGE\s*(\d+)/i =~ string
          return '1'
        end

Severity: Minor
Found in lib/bcdice/game_system/ParasiteBlood.rb - About 1 hr to fix

    Method roll_d has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def roll_d(command, times, sides, target)
            dice_list = @randomizer.roll_barabara(times, sides).sort
            total = dice_list.sum
            success = total <= target
    
    
    Severity: Minor
    Found in lib/bcdice/game_system/ArknightsFan.rb - About 1 hr to fix

      Method getStepInfo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def getStepInfo(step)
              baseStepTable = getBaseStepTable
              baseMaxStep = baseStepTable.last.first
      
              if step <= baseMaxStep
      Severity: Minor
      Found in lib/bcdice/game_system/EarthDawn4.rb - About 1 hr to fix

        Method check_action has 29 lines of code (exceeds 25 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 1 hr to fix

          Method translate_tables has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def translate_tables(locale)
                    {
                      "TT" => DiceTable::D66GridTable.from_i18n("StellarKnights.tables.TT", locale),
                      "STA" => DiceTable::Table.from_i18n("StellarKnights.tables.STA", locale),
                      "STB" => DiceTable::D66OneThirdTable.from_i18n("StellarKnights.tables.STB", locale),
          Severity: Minor
          Found in lib/bcdice/game_system/StellarKnights.rb - About 1 hr to fix

            Method roll_ability has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def roll_ability(command)
                    parser = Command::Parser.new("MS", round_type: @round_type)
                                            .has_prefix_number
                                            .disable_modifier
                                            .restrict_cmp_op_to(:<=)
            Severity: Minor
            Found in lib/bcdice/game_system/MamonoScramble.rb - About 1 hr to fix

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

                    def check_roll(command)
                      m = /^2D6([+\-\d]*)>=(\d+)(\[(\d+)?(,(\d+))?\])?$/i.match(command)
                      unless m
                        return nil
                      end
              Severity: Minor
              Found in lib/bcdice/game_system/TwilightGunsmoke.rb - About 1 hr to fix

                Method command_sn has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def command_sn(command)
                        debug("SN", command)
                        cmd = Command::Parser.new(/[1-9]?SN(\d{0,2})/, round_type: round_type)
                                             .restrict_cmp_op_to(nil)
                                             .enable_fumble.parse(command)
                Severity: Minor
                Found in lib/bcdice/game_system/SkynautsBouken.rb - About 1 hr to fix

                  Method roll_skill_check has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def roll_skill_check(command)
                          parser = Command::Parser.new("BI", round_type: @round_type)
                                                  .enable_suffix_number
                                                  .enable_critical
                                                  .enable_fumble
                  Severity: Minor
                  Found in lib/bcdice/game_system/BeginningIdol2022.rb - About 1 hr to fix

                    Method checkRoll has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def checkRoll(string)
                            debug("checkRoll begin string", string)
                    
                            m = %r{^(\d+)DS(\d+)?(([+-/])(\d+))?(?:>=(\d+))?$}i.match(string)
                            unless m
                    Severity: Minor
                    Found in lib/bcdice/game_system/DetatokoSaga.rb - About 1 hr to fix

                      Method eval_game_system_specific_command has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            def eval_game_system_specific_command(command)
                              parser = Command::Parser.new(/\d+D6/, round_type: round_type)
                              cmd = parser.parse(command)
                              unless cmd
                                return nil
                      Severity: Minor
                      Found in lib/bcdice/game_system/TokumeiTenkousei.rb - About 1 hr to fix

                        Method get_table_minus_index has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def get_table_minus_index(table, operator, value)
                                index = 7
                                modify = 0
                                dice_list = nil
                                result = []
                        Severity: Minor
                        Found in lib/bcdice/game_system/PastFutureParadox.rb - About 1 hr to fix

                          Method roll_symphony_check has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def roll_symphony_check(command)
                                  m = /^([1-6]+)PD([1-6])([+-]\d+)?$/.match(command)
                                  unless m
                                    return nil
                                  end
                          Severity: Minor
                          Found in lib/bcdice/game_system/BeginningIdol2022.rb - About 1 hr to fix

                            Method getCrashWorldRoll has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def getCrashWorldRoll(target)
                                    debug("target", target)
                            
                                    output = "("
                                    isEnd = false
                            Severity: Minor
                            Found in lib/bcdice/game_system/CrashWorld.rb - About 1 hr to fix

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

                                    def resolute_action(command)
                                      m = /^(\d+)([-+]\d+)?AM<=(\d+),(\d)$/.match(command)
                                      return nil unless m
                              
                                      num_dice = m[1].to_i
                              Severity: Minor
                              Found in lib/bcdice/game_system/AniMalus.rb - About 1 hr to fix

                                Method get_table_index has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      def get_table_index(table, operator, value, dice_count, dice_type)
                                        index = 0
                                        modify = 0
                                        dice_list = nil
                                        result = []
                                Severity: Minor
                                Found in lib/bcdice/game_system/PastFutureParadox.rb - About 1 hr to fix

                                  Method eval_game_system_specific_command has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        def eval_game_system_specific_command(command)
                                          # 命中判定・回避判定
                                          parser = Command::Parser.new('SGS', round_type: @round_type).restrict_cmp_op_to(nil)
                                          command = parser.parse(command)
                                  
                                  
                                  Severity: Minor
                                  Found in lib/bcdice/game_system/Sengensyou.rb - About 1 hr to fix

                                    Method roll_treat has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          def roll_treat(command)
                                            m = /^TREAT(-?\d+)?$/.match(command)
                                            return nil unless m
                                    
                                            unless m[1]
                                    Severity: Minor
                                    Found in lib/bcdice/game_system/Yggdrasill.rb - About 1 hr to fix

                                      Method rollFullAuto has 28 lines of code (exceeds 25 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_Korean.rb - About 1 hr to fix

                                        Method getTotalDamage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                              def getTotalDamage(damages)
                                                parts = ['頭',
                                                         '胴中央',
                                                         '右胴',
                                                         '左胴',
                                        Severity: Minor
                                        Found in lib/bcdice/game_system/BattleTech.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language