bcdice/BCDice

View on GitHub

Showing 837 of 1,278 total issues

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)
        output = ""
        type = ""
        total_n = ""

Severity: Minor
Found in lib/bcdice/game_system/MeikyuKingdom.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 resolute_action has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def resolute_action(num_dice, skill_value, modify, command)
        dice = @randomizer.roll_barabara(num_dice, 6).sort
        dice_text = dice.join(",")
        modify_n = 0
        success = 0
Severity: Minor
Found in lib/bcdice/game_system/AngelGear.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 getDiceType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def getDiceType(dice1, dice2)
        debug('getDiceType begin')

        if dice2 != 0
          if isValidDiceOne(dice1)
Severity: Minor
Found in lib/bcdice/game_system/Ryutama.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 getResultText has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def getResultText(value1, value2, dice1, dice2, difficulty, total)
Severity: Minor
Found in lib/bcdice/game_system/Ryutama.rb - About 45 mins to fix

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

          def condition_change(sides, value)
            if critical?(sides, value)
              "コンディション:2段階上昇(クリティカル)"
            elsif fumble?(sides, value)
              "コンディション:2段階下降(ファンブル)"
    Severity: Minor
    Found in lib/bcdice/game_system/Agnostos.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 get_roll_result has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def get_roll_result(result_text, success_dice, ten_dice, _rage_ten_dice, brutal_outcome, difficulty)
    Severity: Minor
    Found in lib/bcdice/game_system/WerewolfTheApocalypse5th.rb - About 45 mins to fix

      Method check_roll_loop has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def check_roll_loop(roll_times, min_suc, target, critical, fumble, is_critical_stop)
      Severity: Minor
      Found in lib/bcdice/game_system/Satasupe.rb - About 45 mins to fix

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

              def abirity_roll(command)
                parser = Command::Parser.new("AB", 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 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 compare has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def compare(dice_total, total, cmd)
                special = cmd.critical || DEFAULT_SPECIAL_VALUE
                fumble = cmd.fumble || DEFAULT_FUMBLE_VALUE
        
                if dice_total <= fumble
        Severity: Minor
        Found in lib/bcdice/game_system/Ventangle.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)
                m = /\A(\d+)?(((WAF)(\d+)(\+(\d+))?)|((WAI)(\d+)(R(\d+))?))$/.match(command)
                unless m
                  return ''
                end
        Severity: Minor
        Found in lib/bcdice/game_system/WerewolfTheApocalypse5th.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)
                m = /\A(\d+)?(((VMF)(\d+)(\+(\d+))?)|((VMI)(\d+)(H(\d+))?))$/.match(command)
                unless m
                  return ''
                end
        Severity: Minor
        Found in lib/bcdice/game_system/VampireTheMasquerade5th.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 make_featdice_roll has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def make_featdice_roll(favoured_state_value)
                feat_dice_count = favoured_state_value == FavouredState::NORMAL ? 1 : 2
                dice_list = @randomizer.roll_barabara(feat_dice_count, 12)
        
                choice_die_number = die_choice(dice_list, favoured_state_value)
        Severity: Minor
        Found in lib/bcdice/game_system/TheOneRing2nd.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 rollFullAuto has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def rollFullAuto(bullet_count, diff, broken_number, dice_num, stop_count, bullet_set_count_cap)
        Severity: Minor
        Found in lib/bcdice/game_system/cthulhu7th/full_auto.rb - About 45 mins to fix

          Method roll_skill_check has a Cognitive Complexity of 8 (exceeds 5 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 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 get_roll_result has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def get_roll_result(result_text, success_dice, ten_dice, hunger_ten_dice, hunger_botch_dice, difficulty)
          Severity: Minor
          Found in lib/bcdice/game_system/VampireTheMasquerade5th.rb - About 45 mins to fix

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

                  def roll_attack(command)
                    m = /^(\d+)(S?)A([1-6]*)([+-]\d+)?$/.match(command)
                    unless m
                      return nil
                    end
            Severity: Minor
            Found in lib/bcdice/game_system/BeginningIdol.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 check_1D12 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                  def check_1D12(command, is_action_judge)
                    debug('獸ノ森の1d12判定')
                    m = /K[AC](\d[-+\d]*)/.match(command)
                    return nil unless m
            
            
            Severity: Minor
            Found in lib/bcdice/game_system/KemonoNoMori.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)
                    m = /\A(\d+)?(HRF)(\d+)(\+(\d+))?$/.match(command)
                    unless m
                      return ''
                    end
            Severity: Minor
            Found in lib/bcdice/game_system/HunterTheReckoning5th.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 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 getRollResult has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def getRollResult(rerollCounts, judgeNumberText, judgeNumber, targetNumber, isReRoll, isStop)
            Severity: Minor
            Found in lib/bcdice/game_system/BlindMythos.rb - About 45 mins to fix
              Severity
              Category
              Status
              Source
              Language