bcdice/BCDice

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

Summary

Maintainability
D
2 days
Test Coverage
A
100%

File YankeeYogSothoth.rb has 412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "bcdice/dice_table/table"
require "bcdice/dice_table/d66_table"

module BCDice
  module GameSystem
Severity: Minor
Found in lib/bcdice/game_system/YankeeYogSothoth.rb - About 5 hrs to fix

    Method result_2d6 has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def result_2d6(_total, dice_total, _dice_list, cmp_op, _target)
    Severity: Minor
    Found in lib/bcdice/game_system/YankeeYogSothoth.rb - About 35 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            RTT = DiceTable::SaiFicSkillTable.new(
              [
                ['苦手', ['大人', '勉強', '敗北', '昆虫', '親', '異性', '孤独', '高所', '暗がり', 'ホラー', '子供']],
                ['部活', ['柔道', 'プロレス', 'テコンドー', '空手', 'ボクシング', '帰宅', '剣道', '野球', '応援団', '科学', '文系']],
                ['中学時代', ['悪ガキ', '統一', 'バイト', '習い事', '喧嘩', 'サボり', 'マジメくん', '遊び歩き', '真似ごと', '部活', '何もしない']],
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 1 other location - About 2 hrs to fix
      lib/bcdice/game_system/DarkDaysDrive.rb on lines 85..95

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 92.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 11 locations. Consider refactoring.
      Open

            NICKNAME_TABLE4 = DiceTable::D66Table.new(
              '二つ名表4',
              D66SortType::ASC,
              {
                11 => '「国産」',
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 10 other locations - About 1 hr to fix
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 33..57
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 61..85
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 89..113
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 66..90
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 94..118
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 122..146
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 6..30
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 34..58
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 62..86
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 90..114

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 11 locations. Consider refactoring.
      Open

            NICKNAME_TABLE1 = DiceTable::D66Table.new(
              '二つ名表1',
              D66SortType::ASC,
              {
                11 => '「愛死天流(あいしてる)」',
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 10 other locations - About 1 hr to fix
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 33..57
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 61..85
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 89..113
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 94..118
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 122..146
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 150..174
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 6..30
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 34..58
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 62..86
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 90..114

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 11 locations. Consider refactoring.
      Open

            NICKNAME_TABLE3 = DiceTable::D66Table.new(
              '二つ名表3',
              D66SortType::ASC,
              {
                11 => '「ファッションヤンキー」',
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 10 other locations - About 1 hr to fix
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 33..57
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 61..85
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 89..113
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 66..90
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 94..118
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 150..174
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 6..30
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 34..58
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 62..86
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 90..114

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 11 locations. Consider refactoring.
      Open

            NICKNAME_TABLE2 = DiceTable::D66Table.new(
              '二つ名表2',
              D66SortType::ASC,
              {
                11 => '「みんなの」',
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 10 other locations - About 1 hr to fix
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 33..57
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 61..85
      lib/bcdice/game_system/ShuumatsuBargainWars.rb on lines 89..113
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 66..90
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 122..146
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 150..174
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 6..30
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 34..58
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 62..86
      lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb on lines 90..114

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              "HPST" => DiceTable::D66Table.new(
                "病院生活表",
                :asc,
                {
                  11 => "治療に専念した",
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 6 other locations - About 1 hr to fix
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 231..255
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 258..282
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 285..309
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 312..336
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 349..373
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 376..400

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              "GYST" => DiceTable::D66Table.new(
                "ガイヤンキー生活表",
                :asc,
                {
                  11 => "ツレと生活をした",
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 6 other locations - About 1 hr to fix
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 231..255
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 258..282
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 285..309
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 312..336
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 349..373
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 403..427

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              "GSST" => DiceTable::D66Table.new(
                "現実世界生活表",
                :asc,
                {
                  11 => "喧嘩に明け暮れた",
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 6 other locations - About 1 hr to fix
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 231..255
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 258..282
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 285..309
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 312..336
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 376..400
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 403..427

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              "BUDT" => DiceTable::D66Table.new(
                "武勇伝表",
                :asc,
                {
                  11 => "バッドヤンキーのチームに自分が所属する学校を破壊されたが、最後まで戦った。/テンションが1段階上昇",
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 6 other locations - About 1 hr to fix
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 231..255
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 258..282
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 312..336
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 349..373
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 376..400
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 403..427

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              "DBRT" => DiceTable::D66Table.new(
                "他愛のない会話表",
                :asc,
                {
                  11 => "「政治の話」",
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 6 other locations - About 1 hr to fix
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 258..282
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 285..309
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 312..336
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 349..373
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 376..400
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 403..427

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              "TKT" => DiceTable::D66Table.new(
                "戦う理由表",
                :asc,
                {
                  11 => "「なんとなく」",
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 6 other locations - About 1 hr to fix
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 231..255
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 285..309
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 312..336
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 349..373
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 376..400
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 403..427

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              "GUDT" => DiceTable::D66Table.new(
                "ガイヤンキー武勇伝表",
                :asc,
                {
                  11 => "アザトースが突然接触してきたので、殴って追い返した。/テンションが1段階上昇",
      Severity: Major
      Found in lib/bcdice/game_system/YankeeYogSothoth.rb and 6 other locations - About 1 hr to fix
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 231..255
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 258..282
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 285..309
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 349..373
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 376..400
      lib/bcdice/game_system/YankeeYogSothoth.rb on lines 403..427

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status