jcbantuelle/dominion-meteor

View on GitHub

Showing 1,158 of 1,158 total issues

Function buy has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  buy(game, player_cards) {
    game.turn.forbidden_events.push(this.name())

    let curse = _.find(game.cards, (card) => {
      return card.name === 'Curse' && card.count > 0
Severity: Minor
Found in app/cards/menagerie/events/desperation.js - About 1 hr to fix

    Function process_response has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static process_response(game, player_cards, response, card_player) {
        let wild_hunt_index = _.findIndex(game.cards, (card) => {
          return card.name === 'Wild Hunt'
        })
    
    
    Severity: Minor
    Found in app/cards/empires/wild_hunt.js - About 1 hr to fix

      Function attack has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        attack(game, player_cards, attacker_player_cards, card_player, trashed_card) {
          if (trashed_card) {
      
            if (CardCostComparer.coin_greater_than(game, trashed_card, 2)) {
              let card_gainer = new CardGainer(game, player_cards, 'discard', 'Curse')
      Severity: Minor
      Found in app/cards/empires/catapult.js - About 1 hr to fix

        Function trash_card has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static trash_card(game, player_cards, selected_cards) {
            let selected_card = selected_cards[0]
        
            let card_trasher = new CardTrasher(game, player_cards, 'hand', selected_cards)
            card_trasher.trash()
        Severity: Minor
        Found in app/cards/promo/dismantle.js - About 1 hr to fix

          Function attack has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            attack(game, player_cards) {
              if (_.size(player_cards.deck) === 0 && _.size(player_cards.discard) === 0) {
                game.log.push(`&nbsp;&nbsp;<strong>${player_cards.username}</strong> has no cards in deck`)
              } else {
                let card_revealer = new CardRevealer(game, player_cards)
          Severity: Minor
          Found in app/cards/base/thief.js - About 1 hr to fix

            Function buy has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              buy(game, player_cards) {
                let buy_gainer = new BuyGainer(game, player_cards)
                buy_gainer.gain(1)
            
                let eligible_cards = _.filter(player_cards.hand, (card) => {
            Severity: Minor
            Found in app/cards/menagerie/events/toil.js - About 1 hr to fix

              Function buy has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                buy(game, player_cards) {
                  let eligible_cards = _.filter(player_cards.hand, function(card) {
                    return _.includes(_.words(card.types), 'action')
                  })
              
              
              Severity: Minor
              Found in app/cards/menagerie/events/delay.js - About 1 hr to fix

                Function buy has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  buy(game, player_cards) {
                    let eligible_cards = _.filter(game.cards, (card) => {
                      return card.count > 0 && card.supply && !_.includes(_.words(card.top_card.types), 'victory') && CardCostComparer.coin_less_than(game, card.top_card, 6)
                    })
                
                
                Severity: Minor
                Found in app/cards/menagerie/events/bargain.js - About 1 hr to fix

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

                    play(game, player_cards, card_player) {
                      let card_drawer = new CardDrawer(game, player_cards, card_player)
                      card_drawer.draw(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/seaside/ghost_ship.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21

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

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

                    play(game, player_cards, card_player) {
                      let coin_gainer = new CoinGainer(game, player_cards, card_player)
                      coin_gainer.gain(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/intrigue/swindler.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let card_drawer = new CardDrawer(game, player_cards, card_player)
                      card_drawer.draw(3)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/prosperity/rabble.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let coin_gainer = new CoinGainer(game, player_cards, card_player)
                      coin_gainer.gain(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/seaside/cutpurse.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let coin_gainer = new CoinGainer(game, player_cards, card_player)
                      coin_gainer.gain(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/cornucopia/fortune_teller.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let coin_gainer = new CoinGainer(game, player_cards, card_player)
                      coin_gainer.gain(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/cornucopia/jester.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let card_drawer = new CardDrawer(game, player_cards, card_player)
                      card_drawer.draw(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/base/witch.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let coin_gainer = new CoinGainer(game, player_cards, card_player)
                      coin_gainer.gain(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/prosperity/mountebank.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let coin_gainer = new CoinGainer(game, player_cards, card_player)
                      coin_gainer.gain(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/menagerie/cardinal.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let card_drawer = new CardDrawer(game, player_cards, card_player)
                      card_drawer.draw(3)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/intrigue/torturer.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let coin_gainer = new CoinGainer(game, player_cards, card_player)
                      coin_gainer.gain(2)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/base/militia.js and 11 other locations - About 1 hr to fix
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/renaissance/old_witch.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

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

                    play(game, player_cards, card_player) {
                      let card_drawer = new CardDrawer(game, player_cards, card_player)
                      card_drawer.draw(3)
                  
                      let player_attacker = new PlayerAttacker(game, this)
                  Severity: Major
                  Found in app/cards/renaissance/old_witch.js and 11 other locations - About 1 hr to fix
                  app/cards/base/militia.js on lines 15..21
                  app/cards/base/witch.js on lines 11..17
                  app/cards/cornucopia/fortune_teller.js on lines 15..21
                  app/cards/cornucopia/jester.js on lines 15..21
                  app/cards/intrigue/swindler.js on lines 15..21
                  app/cards/intrigue/torturer.js on lines 11..17
                  app/cards/menagerie/cardinal.js on lines 15..21
                  app/cards/prosperity/mountebank.js on lines 15..21
                  app/cards/prosperity/rabble.js on lines 11..17
                  app/cards/seaside/cutpurse.js on lines 15..21
                  app/cards/seaside/ghost_ship.js on lines 11..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 58.

                  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