bcdice/BCDice

View on GitHub
lib/bcdice/game_system/Warhammer.rb

Summary

Maintainability
C
1 day
Test Coverage
A
96%

Method getCriticalResult has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def getCriticalResult(string)
        # クリティカル効果データ
        whh = [
          '01:打撃で状況が把握出来なくなる。次ターンは1回の半アクションしか行なえない。',
          '02:耳を強打された為、耳鳴りが酷く目眩がする。1Rに渡って一切のアクションを行なえない。',
Severity: Major
Found in lib/bcdice/game_system/Warhammer.rb - About 4 hrs to fix

    Method wh_atpos has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def wh_atpos(pos_num, pos_type) # WHFRP2命中部位表
            debug("wh_atpos begin pos_type", pos_type)
            pos_2l = [
              '二足',
              15, '頭部',
    Severity: Major
    Found in lib/bcdice/game_system/Warhammer.rb - About 3 hrs to fix

      File Warhammer.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module BCDice
        module GameSystem
          class Warhammer < Base
            # ゲームシステムの識別子
            ID = 'Warhammer'
      Severity: Minor
      Found in lib/bcdice/game_system/Warhammer.rb - About 3 hrs to fix

        Method wh_atpos has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

              def wh_atpos(pos_num, pos_type) # WHFRP2命中部位表
                debug("wh_atpos begin pos_type", pos_type)
                pos_2l = [
                  '二足',
                  15, '頭部',
        Severity: Minor
        Found in lib/bcdice/game_system/Warhammer.rb - About 55 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

        There are no issues that match your filters.

        Category
        Status