jcbantuelle/dominion-meteor

View on GitHub

Showing 1,158 of 1,158 total issues

Avoid too many return statements within this function.
Open

      return 12
Severity: Major
Found in app/lobby/server/game_creator.js - About 30 mins to fix

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/seaside/pearl_diver.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

            if (_.size(player_cards.deck) === 0) {
              let deck_shuffler = new DeckShuffler(game, player_cards)
              deck_shuffler.shuffle()
            }
    Severity: Major
    Found in app/cards/adventures/warrior.js and 11 other locations - About 30 mins to fix
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/seaside/sea_hag.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/base/library.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/intrigue/swindler.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/base/vassal.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/hinterlands/jack_of_all_trades.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/nocturne/hexes/locusts.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/cornucopia/jester.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/nocturne/zombie_mason.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/hinterlands/duchess.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/native_village.js on lines 45..48
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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

    Identical blocks of code found in 12 locations. Consider refactoring.
    Open

          if (_.size(player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(game, player_cards)
            deck_shuffler.shuffle()
          }
    Severity: Major
    Found in app/cards/seaside/native_village.js and 11 other locations - About 30 mins to fix
    app/cards/adventures/warrior.js on lines 26..29
    app/cards/base/library.js on lines 38..41
    app/cards/base/vassal.js on lines 22..25
    app/cards/cornucopia/jester.js on lines 27..30
    app/cards/hinterlands/duchess.js on lines 31..34
    app/cards/hinterlands/jack_of_all_trades.js on lines 20..23
    app/cards/intrigue/swindler.js on lines 27..30
    app/cards/nocturne/hexes/locusts.js on lines 7..10
    app/cards/nocturne/zombie_mason.js on lines 15..18
    app/cards/seaside/pearl_diver.js on lines 23..26
    app/cards/seaside/sea_hag.js on lines 20..23

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

    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 4 locations. Consider refactoring.
    Open

        let returned_card_index = _.findIndex(player_cards.hand, function(card) {
          return card.id === selected_cards[0].id
        })
    Severity: Major
    Found in app/cards/nocturne/hexes/haunting.js and 3 other locations - About 30 mins to fix
    app/cards/empires/gladiator.js on lines 51..53
    app/cards/empires/landmarks/tower.js on lines 12..14
    app/cards/nocturne/necromancer.js on lines 38..40

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

    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 3 locations. Consider refactoring.
    Open

        let mining_village = _.find(player_cards.in_play, function(card) {
          return card.id === card_player.card.id
        })
    Severity: Minor
    Found in app/cards/intrigue/mining_village.js and 2 other locations - About 30 mins to fix
    app/cards/adventures/raze.js on lines 20..22
    app/cards/empires/small_castle.js on lines 24..26

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

    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 3 locations. Consider refactoring.
    Open

        let bridge_trolls = _.size(_.filter(current_player_cards.in_play, function(player_card) {
          return player_card.name === 'Bridge Troll'
        }))
    Severity: Minor
    Found in app/game/lib/services/cost_calculator.js and 2 other locations - About 30 mins to fix
    app/cards/adventures/miser.js on lines 46..48
    app/cards/nocturne/idol.js on lines 15..17

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

    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 4 locations. Consider refactoring.
    Open

        let revealed_copy = _.find(next_player_cards.hand, function(card) {
          return card.name === selected_cards[0].name
        })
    Severity: Major
    Found in app/cards/empires/gladiator.js and 3 other locations - About 30 mins to fix
    app/cards/empires/landmarks/tower.js on lines 12..14
    app/cards/nocturne/hexes/haunting.js on lines 24..26
    app/cards/nocturne/necromancer.js on lines 38..40

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

    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 3 locations. Consider refactoring.
    Open

          let copper_count = _.size(_.filter(player_cards.tavern, function(card) {
            return card.name === 'Copper'
          }))
    Severity: Minor
    Found in app/cards/adventures/miser.js and 2 other locations - About 30 mins to fix
    app/cards/nocturne/idol.js on lines 15..17
    app/game/lib/services/cost_calculator.js on lines 42..44

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

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

        let taxed_pile = _.find(game.cards, (card) => {
          return card.name === selected_cards[0].name
        })
    Severity: Minor
    Found in app/cards/empires/events/tax.js and 1 other location - About 30 mins to fix
    app/cards/seaside/embargo.js on lines 57..59

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

    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 3 locations. Consider refactoring.
    Open

        let small_castle_in_play = _.find(player_cards.in_play, function(card) {
          return card.id === card_player.card.id
        })
    Severity: Minor
    Found in app/cards/empires/small_castle.js and 2 other locations - About 30 mins to fix
    app/cards/adventures/raze.js on lines 20..22
    app/cards/intrigue/mining_village.js on lines 22..24

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

    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

    Severity
    Category
    Status
    Source
    Language