jcbantuelle/dominion-meteor

View on GitHub

Showing 1,158 of 1,158 total issues

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

  play(free_play = false, move_card = true, source = 'hand', number_of_times = 1, announce = true) {
    let duration = false
    _.times(number_of_times, (play_count) => {
      if (this.can_play(free_play)) {
        this.update_phase(free_play)
Severity: Minor
Found in app/game/server/services/card_player.js - About 1 hr to fix

    Function play has 31 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 victory_cards = _.filter(player_cards.hand, function(card) {
    Severity: Minor
    Found in app/cards/nocturne/shepherd.js - About 1 hr to fix

      Function play has 31 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 card_mover = new CardMover(game, player_cards)
      Severity: Minor
      Found in app/cards/nocturne/wish.js - About 1 hr to fix

        Function play has 31 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 buy_gainer = new BuyGainer(game, player_cards)
        Severity: Minor
        Found in app/cards/dark_ages/forager.js - About 1 hr to fix

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

            play(game, player_cards, card_player) {
              let card_drawer = new CardDrawer(game, player_cards, card_player)
              card_drawer.draw(1)
          
              let action_gainer = new ActionGainer(game, player_cards)
          Severity: Minor
          Found in app/cards/base/poacher.js - About 1 hr to fix

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

              play(game, player_cards, card_player) {
                let card_drawer = new CardDrawer(game, player_cards, card_player)
                card_drawer.draw(1)
            
                let action_gainer = new ActionGainer(game, player_cards)
            Severity: Minor
            Found in app/cards/dark_ages/rats.js - About 1 hr to fix

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

                attack(game, player_cards) {
                  if (game.turn.pirate_ship_attack) {
                    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 {
              Severity: Minor
              Found in app/cards/seaside/pirate_ship.js - About 1 hr to fix

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

                  static trash_card(game, player_cards, selected_cards) {
                    if (!_.isEmpty(selected_cards)) {
                      let is_active_player = game.turn.player._id === player_cards.player_id
                      let remodel_amount = is_active_player ? 2 : 1
                
                
                Severity: Minor
                Found in app/cards/promo/governor.js - About 1 hr to fix

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

                    buy(game, player_cards) {
                      if (!player_cards.tokens.minus_coin) {
                        game.log.push(`&nbsp;&nbsp;<strong>${player_cards.username}</strong> takes their -$1 token`)
                        player_cards.tokens.minus_coin = true
                      } else {
                  Severity: Minor
                  Found in app/cards/adventures/events/ball.js - About 1 hr to fix

                    Function buy has 31 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)
                    
                        if (_.size(player_cards.deck) === 0 && _.size(player_cards.discard) === 0) {
                    Severity: Minor
                    Found in app/cards/menagerie/events/gamble.js - About 1 hr to fix

                      Function player has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        player() {
                          let player = PlayerRankings.findOne({username: FlowRouter.getParam('id')}, {
                            transform: function(player) {
                              let total_games = player.wins + player.losses
                              player.win_ratio = total_games === 0 ? 0 : ((player.wins / total_games) * 100).toFixed(2)
                      Severity: Minor
                      Found in app/players/client/players_show.js - About 1 hr to fix

                        Function process has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          process() {
                            if (!_.isEmpty(this.trash_events)) {
                              let mandatory_trash_events = _.filter(this.trash_events, function(event) {
                                return _.includes(TrashEventProcessor.event_cards().concat(TrashEventProcessor.landmark_cards().concat(['Priest'])), event.name)
                              })
                        Severity: Minor
                        Found in app/game/server/services/trash_event_processor.js - About 1 hr to fix

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

                            play(game, player_cards) {
                              if (_.size(game.turn.gained_cards) > 1) {
                                let card_gainer = new CardGainer(game, player_cards, 'discard', 'Imp')
                                card_gainer.gain()
                              } else if (_.size(game.turn.gained_cards) == 1) {
                          Severity: Minor
                          Found in app/cards/nocturne/devils_workshop.js - About 1 hr to fix

                            Function lobby has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              lobby() {
                                let proposals = Proposals.find({}, {
                                  transform: function(proposal) {
                                    proposal.is_proposer = proposal.proposer.id == Meteor.userId()
                                    _.each(proposal.players, function(player) {
                            Severity: Minor
                            Found in app/lobby/client/lobby.js - About 1 hr to fix

                              Function gain_event has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                gain_event(gainer, blessed_village) {
                                  if (_.size(gainer.game.boons_deck) === 0) {
                                    gainer.game.boons_deck = _.shuffle(gainer.game.boons_discard)
                                    gainer.game.boons_discard = []
                                  }
                              Severity: Minor
                              Found in app/cards/nocturne/blessed_village.js - About 1 hr to fix

                                Function draw_cards has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  static draw_cards(game, player_cards) {
                                    if (_.size(player_cards.hand) >= 7 || (_.size(player_cards.deck) === 0 && _.size(player_cards.discard) === 0)) {
                                      if (_.size(player_cards.aside) > 0) {
                                        let card_discarder = new CardDiscarder(game, player_cards, 'aside')
                                        card_discarder.discard()
                                Severity: Minor
                                Found in app/cards/base/library.js - About 1 hr to fix

                                  Function set_aside_prince has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    static set_aside_prince(game, player_cards, response, prince) {
                                      if (response === 'yes') {
                                        let card_mover = new CardMover(game, player_cards)
                                        if (card_mover.move(player_cards.in_play, player_cards.aside, prince)) {
                                          game.log.push(`&nbsp;&nbsp;<strong>${player_cards.username}</strong> sets aside ${CardView.render(prince)}`)
                                  Severity: Minor
                                  Found in app/cards/promo/prince.js - About 1 hr to fix

                                    Function attack has 30 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/bandit.js - About 1 hr to fix

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

                                        buy(game, player_cards) {
                                          game.turn.forbidden_events.push(this.name())
                                          let treasures = _.filter(player_cards.in_play, function(card) {
                                            return _.includes(_.words(card.types), 'treasure')
                                          })
                                      Severity: Minor
                                      Found in app/cards/adventures/events/alms.js - About 1 hr to fix

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

                                          play(game, player_cards, card_player) {
                                            let victory_token_gainer = new VictoryTokenGainer(game, player_cards)
                                            victory_token_gainer.gain(1)
                                        
                                            let unique_cards = _.uniqBy(player_cards.hand, 'name')
                                        Severity: Minor
                                        Found in app/cards/empires/temple.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language