Showing 347 of 1,158 total issues
Function play
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function play
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Consider simplifying this complex logical expression. Open
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
}
Function event_cards
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static event_cards() {
return [
'Blessed Village',
'Border Village',
'Cache',
Function stack_size
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function update_turn
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update_turn() {
if (!this.black_market) {
this.game.turn.buys -= 1
}
Function play_twice
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function attack
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attack(game, player_cards) {
let card_revealer = new CardRevealer(game, player_cards)
card_revealer.reveal_from_deck(2)
GameModel.update(game._id, game)
Function process_response
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function put_card_in_discard
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
put_card_in_discard(card) {
if (!card.destination) {
card.destination = 'discard'
}
Function play
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
play(game, player_cards) {
if (_.size(player_cards.deck) === 0 && _.size(player_cards.discard) === 0) {
game.log.push(` <strong>${player_cards.username}</strong> has no cards in deck`)
} else {
if (_.size(player_cards.deck) === 0) {
Function find_trash_events
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
find_trash_events() {
this.trash_events = []
if (_.includes(TrashEventProcessor.event_cards(), this.card.name)) {
this.trash_events.push(this.card)
}
Function play
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
play(game, player_cards, card_player) {
let eligible_cards = _.filter(player_cards.in_play, function(card) {
return _.includes(_.words(card.types), 'treasure')
})
Function reveal_card
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function play
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function attack
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attack(game, player_cards) {
if (_.size(player_cards.deck) === 0 && _.size(player_cards.discard) === 0) {
game.log.push(` <strong>${player_cards.username}</strong> has no cards in deck`)
} else {
if (_.size(player_cards.deck) === 0) {
Function play
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function trash_card
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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()
Function attack
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attack(game, player_cards) {
if (game.turn.rogue_attack) {
if (_.size(player_cards.deck) === 0 && _.size(player_cards.discard) === 0) {
game.log.push(` <strong>${player_cards.username}</strong> has no cards in deck`)
} else {
Function reveal_card
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
})