bcdice/BCDice

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

Summary

Maintainability
C
1 day
Test Coverage
A
97%

File DeadlineHeroes.rb has 519 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'bcdice/dice_table/range_table'

module BCDice
  module GameSystem
    class DeadlineHeroes < Base
Severity: Major
Found in lib/bcdice/game_system/DeadlineHeroes.rb - About 1 day to fix

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

          def action_result(total, tens, ones, success_rate)
            if total == 100 || success_rate <= 0
              Result.fumble(FUMBLE_STR)
            elsif total <= success_rate - 100
              Result.critical(CRITICAL_STR)
    Severity: Minor
    Found in lib/bcdice/game_system/DeadlineHeroes.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

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

            'RNCJ' => RealNameChart.new(
              'リアルネームチャート(日本)',
              ['姓', '名(男)', '名(女)'],
              [
                [1..6, ['アイカワ/相川、愛川', 'アキラ/晶、章', 'アン/杏']],
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 1 other location - About 3 hrs to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 258..279

    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 108.

    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 2 locations. Consider refactoring.
    Wontfix

            'RNCO' => RealNameChart.new(
              'リアルネームチャート(海外)',
              ['名(男)', '名(女)', '姓'],
              [
                [1..6, ['アルバス', 'アイリス', 'アレン']],
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 1 other location - About 3 hrs to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 235..256

    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 108.

    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.
    Wontfix

            "部位" => HeroNameElementChart.new(
              "部位",
              [
                {element: "ハート", mean: "心臓"},
                {element: "フェイス", mean: "顔"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "攻撃" => HeroNameElementChart.new(
              "攻撃",
              [
                {element: "ストローク", mean: "一撃"},
                {element: "クラッシュ", mean: "壊す"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "鳥" => HeroNameElementChart.new(
              "鳥",
              [
                {element: "ホーク", mean: "鷹"},
                {element: "ファルコン", mean: "隼"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "光" => HeroNameElementChart.new(
              "光",
              [
                {element: "ライト", mean: "光"},
                {element: "シャドウ", mean: "影"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "武器" => HeroNameElementChart.new(
              "武器",
              [
                {element: "ナイヴス", mean: "短剣"},
                {element: "ソード", mean: "剣"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "神話/夢" => HeroNameElementChart.new(
              "神話/夢",
              [
                {element: "アポカリプス", mean: "黙示録"},
                {element: "ウォー", mean: "戦争"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "動物" => HeroNameElementChart.new(
              "動物",
              [
                {element: "バニー", mean: "ウサギ"},
                {element: "タイガー", mean: "虎"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "虫/爬虫類" => HeroNameElementChart.new(
              "虫/爬虫類",
              [
                {element: "ビートル", mean: "甲虫"},
                {element: "バタフライ/モス", mean: "蝶/蛾"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "色" => HeroNameElementChart.new(
              "色",
              [
                {element: "ブラック", mean: "黒"},
                {element: "グリーン", mean: "緑"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "その他" => HeroNameElementChart.new(
              "その他",
              [
                {element: "ヒューマン", mean: "人間"},
                {element: "エージェント", mean: "代理人"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 566..579

    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 54.

    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.
    Wontfix

            "強さ" => HeroNameElementChart.new(
              "強さ",
              [
                {element: "スーパー/ウルトラ", mean: "超"},
                {element: "ワンダー", mean: "驚異的"},
    Severity: Major
    Found in lib/bcdice/game_system/DeadlineHeroes.rb and 10 other locations - About 1 hr to fix
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 416..429
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 431..444
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 446..459
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 461..474
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 476..489
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 491..504
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 506..519
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 521..534
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 536..549
    lib/bcdice/game_system/DeadlineHeroes.rb on lines 551..564

    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 54.

    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