jcbantuelle/dominion-meteor

View on GitHub

Showing 347 of 1,158 total issues

Function play has 34 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)

    if (_.size(player_cards.deck) > 0) {
Severity: Minor
Found in app/cards/dark_ages/scavenger.js - About 1 hr to fix

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

      play(game, player_cards, card_player) {
        let castles = _.filter(player_cards.hand, function(card) {
          return _.includes(_.words(card.types), 'castle')
        })
        let trashable_cards = _.map(castles, function(card) {
    Severity: Minor
    Found in app/cards/empires/small_castle.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          if (_.includes(types, 'boon') || _.includes(types, 'state') || _.includes(types, 'hex') || _.includes(types, 'artifact') || _.includes(types, 'event') || _.includes(types, 'landmark') || _.includes(types, 'project') || _.includes(types, 'way')) {
            width = 341
            height = 220
          }
      Severity: Critical
      Found in app/game/server/view_objects/card_view.js - About 1 hr to fix

        Function event_cards has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          static event_cards() {
            return [
              'Blessed Village',
              'Border Village',
              'Cache',
        Severity: Minor
        Found in app/game/server/services/gain_event_processor.js - About 1 hr to fix

          Function stack_size has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            stack_size(card) {
              if (_.includes(_.words(card.types), 'victory')) {
                return _.size(this.players) < 3 ? 8 : 12
              } else if (_.includes(['Curse', 'Ruins'], card.name)) {
                return _.size(this.players) === 1 ? 10 : _.size(this.players) * 10 - 10
          Severity: Minor
          Found in app/lobby/server/game_creator.js - About 1 hr to fix

            Function update_turn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              update_turn() {
                if (!this.black_market) {
                  this.game.turn.buys -= 1
                }
            
            
            Severity: Minor
            Found in app/game/server/services/lib/card_buyer.js - About 1 hr to fix

              Function play_twice has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                static play_twice(game, player_cards, selected_cards, procession) {
                  if (!_.isEmpty(selected_cards)) {
                    let selected_card = selected_cards[0]
              
                    let card_player = new CardPlayer(game, player_cards, selected_card, procession)
              Severity: Minor
              Found in app/cards/dark_ages/procession.js - About 1 hr to fix

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

                  attack(game, player_cards) {
                    let card_revealer = new CardRevealer(game, player_cards)
                    card_revealer.reveal_from_deck(2)
                
                    GameModel.update(game._id, game)
                Severity: Minor
                Found in app/cards/hinterlands/noble_brigand.js - About 1 hr to fix

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

                    static process_response(game, player_cards, response, card_player) {
                      let ordered_player_cards = TurnOrderedPlayerCardsQuery.turn_ordered_player_cards(game, player_cards)
                  
                      _.each(ordered_player_cards, function(current_player_cards) {
                        let is_active_player = current_player_cards.player_id === player_cards.player_id
                  Severity: Minor
                  Found in app/cards/promo/governor.js - About 1 hr to fix

                    Function put_card_in_discard has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      put_card_in_discard(card) {
                        if (!card.destination) {
                          card.destination = 'discard'
                        }
                    
                    
                    Severity: Minor
                    Found in app/game/server/services/card_discarder.js - About 1 hr to fix

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

                        play(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 {
                            if (_.size(player_cards.deck) === 0) {
                      Severity: Minor
                      Found in app/cards/nocturne/zombie_mason.js - About 1 hr to fix

                        Function find_trash_events has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          find_trash_events() {
                            this.trash_events = []
                            if (_.includes(TrashEventProcessor.event_cards(), this.card.name)) {
                              this.trash_events.push(this.card)
                            }
                        Severity: Minor
                        Found in app/game/server/services/trash_event_processor.js - About 1 hr to fix

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

                            play(game, player_cards, card_player) {
                              let eligible_cards = _.filter(player_cards.in_play, function(card) {
                                return _.includes(_.words(card.types), 'treasure')
                              })
                          
                          
                          Severity: Minor
                          Found in app/cards/nocturne/crypt.js - About 1 hr to fix

                            Function reveal_card has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static reveal_card(game, player_cards, selected_cards, card_player) {
                                let card_revealer = new CardRevealer(game, player_cards)
                                card_revealer.reveal('hand', selected_cards[0])
                            
                                let next_player_query = new NextPlayerQuery(game, player_cards.player_id)
                            Severity: Minor
                            Found in app/cards/empires/gladiator.js - About 1 hr to fix

                              Function play has 32 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/intrigue/mining_village.js - About 1 hr to fix

                                Function attack has 32 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 {
                                      if (_.size(player_cards.deck) === 0) {
                                Severity: Minor
                                Found in app/cards/intrigue/swindler.js - About 1 hr to fix

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

                                    play(game, player_cards, card_player) {
                                      let eligible_cards = _.chain(player_cards.hand).filter((card) => {
                                        return _.includes(_.words(card.types), 'action')
                                      }).map((card) => {
                                        let trashable_card = _.clone(card)
                                  Severity: Minor
                                  Found in app/cards/dark_ages/death_cart.js - About 1 hr to fix

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

                                      static trash_card(game, player_cards, selected_cards) {
                                        let trashed_card = selected_cards[0]
                                        let source = trashed_card.source === 'H' ? 'hand' : 'in_play'
                                        let card_trasher = new CardTrasher(game, player_cards, source, trashed_card)
                                        card_trasher.trash()
                                    Severity: Minor
                                    Found in app/cards/adventures/raze.js - About 1 hr to fix

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

                                        attack(game, player_cards) {
                                          if (game.turn.rogue_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/dark_ages/rogue.js - About 1 hr to fix

                                        Function reveal_card has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          static reveal_card(game, player_cards, selected_cards) {
                                            game.turn.ambassador_selected_card = selected_cards[0]
                                            game.turn.ambassador_game_stack = _.find(game.cards, function(card) {
                                              return card.name === game.turn.ambassador_selected_card.stack_name && card.supply
                                            })
                                        Severity: Minor
                                        Found in app/cards/seaside/ambassador.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language