bcdice/BCDice

View on GitHub

Showing 832 of 1,271 total issues

Method getDiceRollResult has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def getDiceRollResult(diceCount, targetNumber, criticalValue, specialValue)
        successCount = 0
        roundCount = 0
        rollResult = ""
        specialCount = 0
Severity: Minor
Found in lib/bcdice/game_system/RecordOfSteam.rb - About 1 hr to fix

    Method get_takeoff_table has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def get_takeoff_table
            dice = @randomizer.roll_once(20)
            case dice
            when 1
              text = "エンジンがぶっ壊れた!ただちに【機体コンディション】が「20」となり、このターン中は2つ目のアクションも含め「●移動」することができない。"
    Severity: Minor
    Found in lib/bcdice/game_system/Paradiso.rb - About 1 hr to fix

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

              def translate_tables(locale)
                {
                  "HST" => DiceTable::Table.from_i18n("KillDeathBusiness.table.HST", locale),
                  "DWT" => DiceTable::Table.from_i18n("KillDeathBusiness.table.DWT", locale),
                  "RWT" => DiceTable::Table.from_i18n("KillDeathBusiness.table.RWT", locale),
      Severity: Minor
      Found in lib/bcdice/game_system/KillDeathBusiness.rb - About 1 hr to fix

        Method roll_strike_rank_result has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def roll_strike_rank_result(string)
                debug('strike_rank begin string', string)
        
                wounds = 0
                sta_loss = 0
        Severity: Minor
        Found in lib/bcdice/game_system/Chill.rb - About 1 hr to fix

          Method getBig6Table has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def getBig6Table
                  table =
                    [
                      ["この世の地獄", "あれはまさに地獄。屍の山。嘆く者。呆然とする者。目の前で潰される者。あの日、人類は霊長ではなく……弱き獣の一種となった。", "15+2D6"],
                      ["悪の時代", "全ての崩壊、呆然の時。救援が望めぬとわかったなら、少なからぬ者が悪に走った。あの頃は、あなたもまた下劣なる略奪者だった。", "18+2D6"],
          Severity: Minor
          Found in lib/bcdice/game_system/ColossalHunter.rb - About 1 hr to fix

            Method get_roll_result has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def get_roll_result(result_text, success_dice, ten_dice, hunger_ten_dice, hunger_botch_dice, difficulty)
                    result_text = "#{result_text} 成功数=#{success_dice}"
                    is_critical = ten_dice >= 2
            
                    if difficulty > 0
            Severity: Minor
            Found in lib/bcdice/game_system/VampireTheMasquerade5th.rb - About 1 hr to fix

              Method getFullAutoResult has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def getFullAutoResult(command)
                        m = /^FAR\((-?\d+),(-?\d+),(-?\d+)(?:,(-?\d+)?)?(?:,(-?\w+)?)?(?:,(-?\d+)?)?\)$/i.match(command)
                        unless m
                          return nil
                        end
              Severity: Minor
              Found in lib/bcdice/game_system/cthulhu7th/full_auto.rb - About 1 hr to fix

                Method rokumon2_roll has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def rokumon2_roll(mod, target, abl)
                        suc = 0
                
                        dice = @randomizer.roll_barabara(3 + mod.abs, 6).sort
                        dicestr = dice.join(",")
                Severity: Minor
                Found in lib/bcdice/game_system/RokumonSekai2.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 checkRoll has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def checkRoll(string)
                        string = replace_text(string)
                
                        debug("checkRoll string", string)
                        unless (m = /(^|\s)S?((\d+)[rR]6([+\-\d]*)(([>=]+)(\d+))?)(\s|$)/i.match(string))
                Severity: Minor
                Found in lib/bcdice/game_system/MeikyuDays.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 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def check_roll(command, base, target, critical_target, diff, modifier)
                        if base <= 0 # クリティカルしない1D
                          critical_target = 0
                          base = 1
                        end
                Severity: Minor
                Found in lib/bcdice/game_system/CodeLayerd.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 action_roll has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def action_roll(command)
                        parser = Command::Parser.new(/\d*SG/, round_type: round_type)
                                                .restrict_cmp_op_to(:>=, nil)
                                                .enable_critical
                                                .enable_fumble
                Severity: Minor
                Found in lib/bcdice/game_system/ShinobiGami.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_ippan has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def roll_ippan(command)
                        m = /^(-?\d+)?AG((?:[-+]\d+)*)$/.match(command)
                        return nil unless m
                
                        level = m[1].to_i
                Severity: Minor
                Found in lib/bcdice/game_system/SajinsenkiAGuS.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 rollAct has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def rollAct(counts, judgment = 0, critical = 0, fumble = 0)
                        if critical < 1
                          critical = 1
                        end
                        if judgment <= 0
                Severity: Minor
                Found in lib/bcdice/game_system/BladeOfArcana.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 cf_roll has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                      def cf_roll(command)
                        parser = Command::Parser.new(/\d*CF/, round_type: round_type)
                                                .enable_critical
                                                .enable_fumble
                
                
                Severity: Minor
                Found in lib/bcdice/game_system/ChaosFlare.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 mk_rare_item_table has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def mk_rare_item_table(num)
                        table = [
                          [11, "ブルーリボン"],
                          [12, "聖痕"],
                          [13, "剥製"],
                Severity: Minor
                Found in lib/bcdice/game_system/meikyu_kingdom/item_table.rb - About 1 hr to fix

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

                        def checkRoll(diceCount, modify, critical, fumble, target, isStormy, optionalText)
                          isAnticipation = optionalText.include?('A')    # 先見の明
                          isHeavyAttack = optionalText.include?('H')     # 重撃
                  
                          dice_list = @randomizer.roll_barabara(diceCount, 20)
                  Severity: Minor
                  Found in lib/bcdice/game_system/BadLife.rb - About 1 hr to fix

                    Method mk_rare_weapon_item_table has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def mk_rare_weapon_item_table(num)
                            table = [
                              [11, "虚弾"],
                              [12, "怪物毒"],
                              [13, "小鬼の襟巻"],
                    Severity: Minor
                    Found in lib/bcdice/game_system/meikyu_kingdom/item_table.rb - About 1 hr to fix

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

                            def checkRoll(string)
                              string = replace_text(string)
                      
                              return nil unless /(^|\s)S?(2[rR]10([+\-\d]+)?([>=]+(\d+))(\[(\d+),(\d+)\]))(\s|$)/i =~ string
                      
                      
                      Severity: Minor
                      Found in lib/bcdice/game_system/EmbryoMachine.rb - About 1 hr to fix

                        Method get_mechanicAccident_table has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def get_mechanicAccident_table(locationType, roc, correction)
                                case locationType
                                when 'A'
                                  name = '空中メカニック事故表'
                                  table = [
                        Severity: Minor
                        Found in lib/bcdice/game_system/MetalHeadExtream.rb - About 1 hr to fix

                          Method get_supplementary has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def get_supplementary(command_type, result)
                                  title = ''
                                  supplementary = ''
                                  case command_type
                                  when 'EM'
                          Severity: Minor
                          Found in lib/bcdice/game_system/ScreamHighSchool.rb - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language