bcdice/BCDice

View on GitHub

Showing 837 of 1,278 total issues

Method check_roll has a Cognitive Complexity of 10 (exceeds 5 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

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 mh_crc_table has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def mh_crc_table(suv, num)
        header_parts = ['戦闘結果チャート', num]
        separator = ' > '

        suv = suv.to_s.upcase
Severity: Minor
Found in lib/bcdice/game_system/MetalHead.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 eval_game_system_specific_command has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def eval_game_system_specific_command(command)
        m = /\A(\d+)?(YZE|MYZ)(\d+)((\+|-)(\d+))?(\+(\d+))?/.match(command)
        unless m
          return ''
        end
Severity: Minor
Found in lib/bcdice/game_system/YearZeroEngine.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 10 (exceeds 5 allowed). Consider refactoring.
Open

      def check_roll(command)
        m = %r{^RB(-?\d+([+\-*/]\d+)*)(@(\d+))?(#(\d+))?$}.match(command)
        unless m
          return nil
        end
Severity: Minor
Found in lib/bcdice/game_system/RuinBreakers.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 get_roll_params has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def get_roll_params(params)
        min_suc = 0
        fumble = 1
        critical = 13
        isCriticalStop = false
Severity: Minor
Found in lib/bcdice/game_system/Satasupe.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 getRollDiceCommandResult has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def getRollDiceCommandResult(command)
        return nil unless command =~ /^(\d*)JD(\d*)(\+(\d*))?(,(\d+))?$/

        diceCount = Regexp.last_match(1)
        diceCount = 2 if diceCount.empty?
Severity: Minor
Found in lib/bcdice/game_system/OneWayHeroics.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 Result.nothing if target == '?'
        return nil unless cmp_op == :<=

        # RuneQuest QUICK-START RULESを元に修正
Severity: Minor
Found in lib/bcdice/game_system/RuneQuest.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 eval_game_system_specific_command has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def eval_game_system_specific_command(command)
        debug("eval_game_system_specific_command Begin")

        parser = Command::Parser.new('VT', round_type: round_type)
                                .enable_critical
Severity: Minor
Found in lib/bcdice/game_system/Ventangle.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_status has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        def result_status(total_sum, n_value_groups, fumble, critical)
          return :no_target unless @target
          return :fumble if fumble
          return :critical if critical

Severity: Minor
Found in lib/bcdice/game_system/sword_world/transcendent_test.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_sq has a Cognitive Complexity of 10 (exceeds 5 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

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 10 (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/MeikyuKingdomBasic.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_guarding has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def resolute_guarding(command)
        m = /^([-+]\d+)?AG=(\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

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 10 (exceeds 5 allowed). Consider refactoring.
Open

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

        sequence = []
        result = Result.new
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 resultStr has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def resultStr(achievement, target, cmp_op, fumble, critical)
        return '大失敗' if fumble
        return '大成功' if critical
        if cmp_op == ">="
          return achievement >= target ? "成功" : "失敗"
Severity: Minor
Found in lib/bcdice/game_system/GoblinSlayer.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)
        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

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 rollStep has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def rollStep(diceType, diceCount)
        debug('rollStep diceType, diceCount, @string', diceType, diceCount, @string)

        stepTotal = 0
        return stepTotal unless diceCount > 0
Severity: Minor
Found in lib/bcdice/game_system/EarthDawn.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 rollStep has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def rollStep(diceType, diceCount)
        debug('rollStep diceType, diceCount, @calcText', diceType, diceCount, @calcText)

        stepTotal = 0
        return stepTotal unless diceCount > 0
Severity: Minor
Found in lib/bcdice/game_system/EarthDawn4.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_investigation has a Cognitive Complexity of 10 (exceeds 5 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

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 rollStep has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def rollStep(diceType, diceCount)
        debug('rollStep diceType, diceCount, @string', diceType, diceCount, @string)

        stepTotal = 0
        return stepTotal unless diceCount > 0
Severity: Minor
Found in lib/bcdice/game_system/EarthDawn3.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_attack has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def roll_attack(dice_count_expression, border_expression, additional_damage_rules)
        dice_count = Arithmetic.eval(dice_count_expression, RoundType::FLOOR)
        border = Arithmetic.eval(border_expression, RoundType::FLOOR).clamp(1, 6) if border_expression

        command = make_command_text(dice_count, border, additional_damage_rules)
Severity: Minor
Found in lib/bcdice/game_system/Revulture.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