bcdice/BCDice

View on GitHub

Showing 837 of 1,278 total issues

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

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

          def eval_game_system_specific_command(command)
            case command
            when /\d+VBS/
              resolute_action(command)
            when /\d+VF/
    Severity: Minor
    Found in lib/bcdice/game_system/Villaciel.rb - About 1 hr to fix

      Method eval_game_system_specific_command has 28 lines of code (exceeds 25 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

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

              def mk_nick_a_table(output, num)
                table = [
                  [11, "“災い転じて福となす”"],
                  [12, "“七転び八起きの”"],
                  [13, "“冗談にも程がある”"],
        Severity: Minor
        Found in lib/bcdice/game_system/meikyu_kingdom/name_tables.rb - About 1 hr to fix

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

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

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

                  def get_rg_roll_result(result_header_text, difficulty, feat_die_number, piercing_blows_number, total_dice_number, success_count, opts)
                    # 状態表示取得
                    condition_text = get_condition_text(opts)
            
                    success_count_text = "成功度 #{success_count}"
            Severity: Minor
            Found in lib/bcdice/game_system/TheOneRing2nd.rb - About 1 hr to fix

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

                    def roll_sq(command)
                      m = /(\d+)SQ([+\-\d]+)?(([>=]+)(\d+))?/i.match(command)
                      return nil unless m
              
                      dice_count = m[1].to_i
              Severity: Minor
              Found in lib/bcdice/game_system/NSSQ.rb - About 1 hr to fix

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

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

                        def resolute_investigation(command)
                          m = /^([-+]\d+)?AI<=(\d+),(\d)$/.match(command)
                          return nil unless m
                  
                          num_bonus = m[1].to_i
                  Severity: Minor
                  Found in lib/bcdice/game_system/AniMalus.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_ChineseTraditional.rb - About 1 hr to fix

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

                            def roll_mythos_madness_table(command)
                              m = /^MMT(\[?([1-8],[1-8])\]?)?/.match(command)
                              return nil unless m
                      
                              sequence = []
                      Severity: Minor
                      Found in lib/bcdice/game_system/TrailOfCthulhu.rb - About 1 hr to fix

                        Method text has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def text
                                  if critical && special
                                    translate("Cthulhu.critical_special")
                                  elsif critical
                                    translate("Cthulhu.critical")
                        Severity: Minor
                        Found in lib/bcdice/game_system/Cthulhu.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 next_token has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def next_token
                                return [false, "$"] if @scanner.eos?
                        
                                @notations.each do |n|
                                  token = @scanner.scan(n)
                        Severity: Minor
                        Found in lib/bcdice/command/lexer.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 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def result_1d100(total, _dice_total, cmp_op, target)
                                return nil unless cmp_op == :<=
                        
                                if total <= 1
                                  Result.critical("貫通") # 1は常に貫通
                        Severity: Minor
                        Found in lib/bcdice/game_system/Elric.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_1d20 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def result_1d20(total, _dice_total, cmp_op, target)
                                return Result.nothing if target == '?'
                                return nil unless cmp_op == :<=
                        
                                if total <= target
                        Severity: Minor
                        Found in lib/bcdice/game_system/Pendragon.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 successful_or_failed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def successful_or_failed(total, diff)
                                case total
                                when  2
                                  diff <=  1 ? '成功(大成功ではない)' : '大成功!'
                                when 12
                        Severity: Minor
                        Found in lib/bcdice/game_system/AFF2e.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 use_mohumohu_chart has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def use_mohumohu_chart(command)
                                case command
                                when 'MMI' then use_6x6_chart(MOHUMOHU_INSECT_CHART, 'もふもふ表・昆虫')
                                when 'MMA' then use_6x6_chart(MOHUMOHU_ANIMAL_CHART, 'もふもふ表・動物')
                                when /MMV[VA]?/
                        Severity: Minor
                        Found in lib/bcdice/game_system/Villaciel.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_ub has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def roll_ub(command)
                                parser = Command::Parser.new("UB", round_type: @round_type)
                                                        .has_prefix_number
                                                        .enable_critical
                                parsed = parser.parse(command)
                        Severity: Minor
                        Found in lib/bcdice/game_system/Karukami.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 resolute_action has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def resolute_action(command)
                                parser = Command::Parser.new("LM", round_type: @round_type)
                                                        .has_suffix_number
                                                        .restrict_cmp_op_to(:>=)
                                parsed = parser.parse(command)
                        Severity: Minor
                        Found in lib/bcdice/game_system/Liminal.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_action has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def roll_action(command)
                                parser = Command::Parser.new("DS", round_type: @round_type)
                                                        .enable_prefix_number
                                                        .restrict_cmp_op_to(nil)
                                parsed = parser.parse(command)
                        Severity: Minor
                        Found in lib/bcdice/game_system/DemonSpike.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