bcdice/BCDice

View on GitHub

Showing 809 of 1,233 total issues

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

      def getWeaponSkillText(weaponTable, dice)
        debug('getWeaponSkillText', dice)

        return '' if weaponTable.nil?

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

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

        def roll(randomizer)
          if @parse_error
            return nil
          end

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

      def eval_game_system_specific_command(command)
        parser = Command::Parser.new(/\d+D6/, round_type: round_type)
        cmd = parser.parse(command)
        unless cmd
          return nil
Severity: Minor
Found in lib/bcdice/game_system/TokumeiTenkousei.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_nd6 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

        if dice_total <= 2
Severity: Minor
Found in lib/bcdice/game_system/BeginningIdol.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_critical has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def parse_critical(humanity, atmark)
          humanity = humanity ? humanity.to_i : 99
          atmark_value = atmark ? ArithmeticEvaluator.eval(atmark) : 0

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

      def result_nd10(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/EmbryoMachine.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("ファンブル(【余裕】が 0 に)")
Severity: Minor
Found in lib/bcdice/game_system/BloodMoon.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 translate_tables has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def translate_tables(locale)
          costume_challenge_girls = CostumeTable.from_i18n("BeginningIdol.tables.DT", locale)
          costume_road_to_prince = CostumeTable.from_i18n("BeginningIdol.tables.RC", locale)
          costume_fortune_stars = CostumeTable.from_i18n("BeginningIdol.tables.FC", locale)

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

      def combine_roll(command)
        m = /^CBR\((\d+),(\d+)\)$/.match(command)
        return nil unless m

        difficulty_1 = m[1].to_i
Severity: Minor
Found in lib/bcdice/game_system/Cthulhu7th.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(translate("Insane.fumble"))
Severity: Minor
Found in lib/bcdice/game_system/Insane.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)
        text =
          case command.upcase

          when /(\d+)?PO(\d+)?(([+-]\d+)*)?((>|>=|@)(\d+)(([+-]\d+)*)?)?/i
Severity: Minor
Found in lib/bcdice/game_system/Postman.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 get_table_index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def get_table_index(table, operator, value, dice_count, dice_type)
        index = 0
        modify = 0
        dice_list = nil
        result = []
Severity: Minor
Found in lib/bcdice/game_system/PastFutureParadox.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_fate_table has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def roll_fate_table(command)
        m = /^FT(\d+)?/.match(command)
        if m[1]
          num = m[1].to_i
          if [0, 7].include?(num)
Severity: Minor
Found in lib/bcdice/game_system/ChaosFlare.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)
        # ALCコマンド:命中判定
        # ALCコマンド:成功判定
        if command =~ /(\d+)AL(C|G)?(\d+)?((x|\*)(\d+))?$/i
          rapid = Regexp.last_match(1).to_i
Severity: Minor
Found in lib/bcdice/game_system/Alsetto.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 get_table_minus_index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def get_table_minus_index(table, operator, value)
        index = 7
        modify = 0
        dice_list = nil
        result = []
Severity: Minor
Found in lib/bcdice/game_system/PastFutureParadox.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 get_supplementary has a Cognitive Complexity of 7 (exceeds 5 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 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 checkRoll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def checkRoll(hasCritical, modify, target)
        dice_list = @randomizer.roll_barabara(2, 6)
        dice = dice_list.sum()
        diceText = dice_list.join(",")
        successValue = dice + modify
Severity: Minor
Found in lib/bcdice/game_system/TherapieSein.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 getCombineRoll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def getCombineRoll(command)
        return nil unless /CBR\((\d+),(\d+)\)/i =~ command

        diff_1 = Regexp.last_match(1).to_i
        diff_2 = Regexp.last_match(2).to_i
Severity: Minor
Found in lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.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_nechronica has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def result_nechronica(value_list, target)
        if value_list.max >= target
          if value_list.max >= 11
            Result.critical(translate("Nechronica.critical"))
          else
Severity: Minor
Found in lib/bcdice/game_system/Nechronica.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