bcdice/BCDice

View on GitHub

Showing 809 of 1,233 total issues

Method check_action has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def check_action(command)
        case command
        when "ID"
          eval_common_command("3TY6")
        when "IE"
Severity: Minor
Found in lib/bcdice/game_system/IfIfIf.rb - About 35 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 sum_of_largest_straight has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def sum_of_largest_straight(sorted_dice_values)
          # 出目が3個未満ならば、ストレートは存在しない
          return 0 if sorted_dice_values.length < 3

          # ストレートの和の最大値
Severity: Minor
Found in lib/bcdice/game_system/CthulhuTech.rb - About 35 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 roll_ability has a Cognitive Complexity of 7 (exceeds 5 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 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

      def eval_game_system_specific_command(command)
        case command
        when /^Gr(\d+)?/i
          if command =~ /^Gr(\d+)/i
            growth(Regexp.last_match(1).to_i)
Severity: Minor
Found in lib/bcdice/game_system/SwordWorld2_0.rb - About 35 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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def self.parse(command)
          if (m = /^(\d[+\-\d]*)-(\d+)FW(?:@(\d+))?(?:\#(\d+))?$/.match(command))
            new.tap do |fw|
              fw.dice_count = m[2].to_i
              fw.target = Arithmetic.eval(m[1], RoundType::FLOOR)
Severity: Minor
Found in lib/bcdice/game_system/FilledWith.rb - About 35 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 getCriticalResult has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def getCriticalResult(string)
        # クリティカル効果データ
        whh = [
          '01:打撃で状況が把握出来なくなる。次ターンは1回の半アクションしか行なえない。',
          '02:耳を強打された為、耳鳴りが酷く目眩がする。1Rに渡って一切のアクションを行なえない。',
Severity: Minor
Found in lib/bcdice/game_system/Warhammer.rb - About 35 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 result_2d6 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def result_2d6(total, dice_total, dice_list, cmp_op, target)
        return nil if target == '?'
        return nil unless cmp_op == :>=

        result =
Severity: Minor
Found in lib/bcdice/game_system/MagicaLogia.rb - About 35 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_strike_rank has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def check_strike_rank(strikeRank)
        strikeRank = strikeRank.to_i

        dice = ''
        dice_add = ''
Severity: Minor
Found in lib/bcdice/game_system/Chill.rb - About 35 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 result_r has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def result_r(dice_total, total)
        if dice_total <= @fumble
          "ファンブル!"
        elsif dice_total >= @critical
          "クリティカル!"
Severity: Minor
Found in lib/bcdice/game_system/OracleEngine.rb - About 35 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 result has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def result(total)
          if total <= @critical
            Result.critical("クリティカル!")
          elsif total >= @fumble
            Result.fumble("ファンブル!")
Severity: Minor
Found in lib/bcdice/game_system/FilledWith.rb - About 35 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 roll_shusoku has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def roll_shusoku(command)
        m = /^KRS(?:\((\d),([-+\d]+)\))$/.match(command)
        return nil unless m

        dice_size = m[1].to_i
Severity: Minor
Found in lib/bcdice/game_system/KyokoShinshoku.rb - About 35 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_seigou has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def check_seigou(string)
        debug("check_seigou begin string", string)

        sr_parser = Command::Parser.new("SR", round_type: round_type)
                                   .has_suffix_number
Severity: Minor
Found in lib/bcdice/game_system/Satasupe.rb - About 35 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 result_2d6 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def result_2d6(total, dice_total, _dice_list, cmp_op, target)
        return nil unless cmp_op == :>=

        if dice_total <= 2
          Result.fumble("ファンブル(判定失敗。失敗表(FT)を追加で1回振る)")
Severity: Minor
Found in lib/bcdice/game_system/DarkDaysDrive.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

      def resolute_action(command)
        m = /(\d)KU/.match(command)
        return nil unless m

        num_dices = m[1].to_i
Severity: Minor
Found in lib/bcdice/game_system/Kutulu.rb - About 35 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 additional_result has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def additional_result(total, target_number)
        tens, ones = split_d100(total)
        if (total > target_number) || (total > 95) # 自動失敗時のファンブル処理も
          if ones == tens
            "ファンブル"
Severity: Minor
Found in lib/bcdice/game_system/Warhammer4.rb - About 35 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 twohands_damage_roll has a Cognitive Complexity of 7 (exceeds 5 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 35 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 getRolld20DiceCommandResult has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def getRolld20DiceCommandResult(command)
        debug("Torg Eternity Dice Roll Command ? ", command)
        unless command == "TE"
          return nil
        end
Severity: Minor
Found in lib/bcdice/game_system/TorgEternity.rb - About 35 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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def parse()
          m = /^(\d+)(?:R6|BB6?)((?:[+-]\d+)+)?(?:%(-?\d+))?(?:@([+\-\d]+))?(?:#(A)?([+\-\d]+))?(?:\$([1-6]+))?(?:&([1-6]))?(?:([>=]+)(\d+))?$/.match(@command)
          unless m
            @parse_error = true
            return
Severity: Minor
Found in lib/bcdice/game_system/BeastBindTrinity.rb - About 35 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 calc_status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def calc_status(st)
        if st <= 4
          return -3
        elsif st <= 6
          return -2
Severity: Minor
Found in lib/bcdice/game_system/NobunagasBlackCastle.rb - About 35 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 result_2d6 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def result_2d6(total, dice_total, _dice_list, cmp_op, target)
        return nil unless cmp_op == :>=

        if dice_total <= 2
          Result.fumble("ファンブル")
Severity: Minor
Found in lib/bcdice/game_system/CardRanker.rb - About 35 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

Severity
Category
Status
Source
Language