jcbantuelle/dominion-meteor

View on GitHub

Showing 1,158 of 1,158 total issues

Function play has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  play(game, player_cards, card_player) {
    let coin_gainer = new CoinGainer(game, player_cards, card_player)
    coin_gainer.gain(2)

    let eligible_cards = _.filter(game.trash, function(card) {
Severity: Minor
Found in app/cards/dark_ages/rogue.js - About 1 hr to fix

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

      static trash_card(game, player_cards, selected_cards, card_player) {
        let number_of_options = CostCalculator.calculate(game, selected_cards[0])
        number_of_options = Math.min(6, number_of_options)
    
        let card_trasher = new CardTrasher(game, player_cards, 'hand', selected_cards[0])
    Severity: Minor
    Found in app/cards/menagerie/scrap.js - About 1 hr to fix

      Function exile_card has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        static exile_card(game, player_cards, selected_cards) {
          let eligible_cards = _.filter(game.cards, function(card) {
            return card.name !== selected_cards[0].name && card.count > 0 && card.supply && CardCostComparer.card_less_than(game, selected_cards[0], card.top_card, 3)
          })
      
      
      Severity: Minor
      Found in app/cards/menagerie/displace.js - About 1 hr to fix

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

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

          Function play has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            play(game, player_cards, card_player) {
              let action_gainer = new ActionGainer(game, player_cards)
              action_gainer.gain(1)
          
              let current_player_card_revealer = new CardRevealer(game, player_cards)
          Severity: Minor
          Found in app/cards/empires/chariot_race.js - About 1 hr to fix

            Function trash_card has 27 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/guilds/stonemason.js - About 1 hr to fix

              Function base1 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                static base1() {
                  return [
                    'Cellar',
                    'Chapel',
                    'Moat',
              Severity: Minor
              Found in app/cards/lib/card_list.js - About 1 hr to fix

                Function prosperity has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  static prosperity() {
                    return [
                      'Loan',
                      'TradeRoute',
                      'Watchtower',
                Severity: Minor
                Found in app/cards/lib/card_list.js - About 1 hr to fix

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

                    attack(game, player_cards) {
                      if (_.size(player_cards.hand) > 4) {
                        let eligible_cards = _.filter(player_cards.hand, function (card) {
                          return CardCostComparer.coin_greater_than(game, card, 1)
                        })
                  Severity: Minor
                  Found in app/cards/renaissance/villain.js - About 1 hr to fix

                    Function intrigue1 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static intrigue1() {
                        return [
                          'Courtyard',
                          'Pawn',
                          'SecretChamber',
                    Severity: Minor
                    Found in app/cards/lib/card_list.js - About 1 hr to fix

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

                        static trash_card(game, player_cards, selected_cards, improve) {
                          if (_.size(selected_cards) > 0) {
                            game.log.push(`<strong>${player_cards.username}</strong> resolves ${CardView.render(improve)}`)
                            let eligible_cards = _.filter(game.cards, (card) => {
                              return card.count > 0 && card.supply  && CardCostComparer.card_equal_to(game, selected_cards[0], card.top_card, 1)
                      Severity: Minor
                      Found in app/cards/renaissance/improve.js - About 1 hr to fix

                        Function renaissance has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          static renaissance() {
                            return [
                              'BorderGuard',
                              'Ducat',
                              'Lackeys',
                        Severity: Minor
                        Found in app/cards/lib/card_list.js - About 1 hr to fix

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

                            play(game, player_cards) {
                              let coin_gainer = new CoinGainer(game, player_cards)
                              coin_gainer.gain(6)
                          
                              let buy_gainer = new BuyGainer(game, player_cards)
                          Severity: Major
                          Found in app/cards/empires/capital.js and 2 other locations - About 1 hr to fix
                          app/cards/nocturne/cursed_village.js on lines 11..17
                          app/cards/renaissance/ducat.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 56.

                          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

                            play(game, player_cards) {
                              let coffer_gainer = new CofferGainer(game, player_cards)
                              coffer_gainer.gain(1)
                          
                              let buy_gainer = new BuyGainer(game, player_cards)
                          Severity: Major
                          Found in app/cards/renaissance/ducat.js and 2 other locations - About 1 hr to fix
                          app/cards/empires/capital.js on lines 11..17
                          app/cards/nocturne/cursed_village.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 56.

                          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

                                } else if (this.destination === 'aside') {
                                  this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> sets aside ${CardView.render(this.gained_card)}`)
                                }
                          Severity: Major
                          Found in app/game/server/services/card_gainer.js and 3 other locations - About 1 hr to fix
                          app/game/server/services/card_gainer.js on lines 110..120
                          app/game/server/services/card_gainer.js on lines 113..119
                          app/game/server/services/card_gainer.js on lines 115..119

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

                          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

                                if (this.destination === 'hand') {
                                  this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> places ${CardView.render(this.gained_card)} in their hand`)
                                } else if (this.destination === 'deck') {
                                  this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> places ${CardView.render(this.gained_card)} on their deck`)
                                } else if (this.destination === 'aside') {
                          Severity: Major
                          Found in app/game/server/services/card_gainer.js and 3 other locations - About 1 hr to fix
                          app/game/server/services/card_gainer.js on lines 110..120
                          app/game/server/services/card_gainer.js on lines 115..119
                          app/game/server/services/card_gainer.js on lines 117..119

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

                          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

                                } else if (this.destination === 'deck') {
                                  this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> places ${CardView.render(this.gained_card)} on their deck`)
                                } else if (this.destination === 'aside') {
                                  this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> sets aside ${CardView.render(this.gained_card)}`)
                                }
                          Severity: Major
                          Found in app/game/server/services/card_gainer.js and 3 other locations - About 1 hr to fix
                          app/game/server/services/card_gainer.js on lines 110..120
                          app/game/server/services/card_gainer.js on lines 113..119
                          app/game/server/services/card_gainer.js on lines 117..119

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

                          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

                            play(game, player_cards) {
                              let action_gainer = new ActionGainer(game, player_cards)
                              action_gainer.gain(2)
                          
                              let card_drawer = new CardDrawer(game, player_cards)
                          Severity: Major
                          Found in app/cards/nocturne/cursed_village.js and 2 other locations - About 1 hr to fix
                          app/cards/empires/capital.js on lines 11..17
                          app/cards/renaissance/ducat.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 56.

                          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

                              if (this.game.turn.possessed) {
                                this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> gains ${CardView.render(this.gained_card)} instead`)
                              } else {
                                if (this.destination === 'hand') {
                                  this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> places ${CardView.render(this.gained_card)} in their hand`)
                          Severity: Major
                          Found in app/game/server/services/card_gainer.js and 3 other locations - About 1 hr to fix
                          app/game/server/services/card_gainer.js on lines 113..119
                          app/game/server/services/card_gainer.js on lines 115..119
                          app/game/server/services/card_gainer.js on lines 117..119

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

                          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

                                this.game.log.push(`&nbsp;&nbsp;<strong>${this.player_cards.username}</strong> exiles ${CardView.render(this.exile_stack.top_card)} from the supply`)
                          Severity: Major
                          Found in app/game/server/services/supply_card_exiler.js and 1 other location - About 1 hr to fix
                          app/game/server/services/turn_ender.js on lines 113..113

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

                          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