jcbantuelle/dominion-meteor

View on GitHub

Showing 1,158 of 1,158 total issues

Function discard_treasure has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static discard_treasure(game, player_cards, selected_cards) {
    if (!_.isEmpty(selected_cards)) {
      let card_discarder = new CardDiscarder(game, player_cards, 'hand', selected_cards)
      card_discarder.discard()

Severity: Minor
Found in app/cards/nocturne/boons/the_earths_gift.js - About 1 hr to fix

    Function find_start_cleanup_events has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      find_start_cleanup_events() {
        this.start_cleanup_events = []
    
        _.each(this.player_cards.aside, (card) => {
          if (_.includes(StartCleanupEventProcessor.aside_events(), card.name)) {
    Severity: Minor
    Found in app/game/server/services/start_cleanup_event_processor.js - About 1 hr to fix

      Function trash has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        trash(announce = true) {
          if (!_.isEmpty(this.cards)) {
            let events = this.has_events()
            if (_.size(this.cards) > 1 && events) {
              let turn_event_id = TurnEventModel.insert({
      Severity: Minor
      Found in app/game/server/services/card_trasher.js - About 1 hr to fix

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

          play(game, player_cards) {
            let coin_gainer = new CoinGainer(game, player_cards)
            coin_gainer.gain(3, false)
        
            let buy_gainer = new BuyGainer(game, player_cards)
        Severity: Minor
        Found in app/cards/prosperity/contraband.js - About 1 hr to fix

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

            static trash_card(game, player_cards, selected_cards) {
              if (!_.isEmpty(selected_cards)) {
                let card_trasher = new CardTrasher(game, player_cards, 'hand', selected_cards)
                let trashed_cards =card_trasher.trash()
          
          
          Severity: Minor
          Found in app/cards/empires/events/advance.js - About 1 hr to fix

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

              play(game, player_cards) {
                let action_gainer = new ActionGainer(game, player_cards)
                action_gainer.gain(1)
            
                if (_.size(player_cards.deck) === 0 && _.size(player_cards.discard) === 0) {
            Severity: Minor
            Found in app/cards/seaside/lookout.js - About 1 hr to fix

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

                play(game, player_cards, card_player) {
                  let buy_gainer = new BuyGainer(game, player_cards)
                  buy_gainer.gain(1)
              
                  let estate = _.find(player_cards.hand, function(card) {
              Severity: Minor
              Found in app/cards/intrigue/baron.js - About 1 hr to fix

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

                  buy(game, player_cards) {
                    _.times(2, function() {
                      let card_gainer = new CardGainer(game, player_cards, 'discard', 'Copper')
                      card_gainer.gain()
                    })
                Severity: Minor
                Found in app/cards/empires/events/banquet.js - About 1 hr to fix

                  Function process_choice has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    static process_choice(game, player_cards, choice) {
                      choice = choice[0]
                      if (choice === 'coin') {
                        let coin_gainer = new CoinGainer(game, player_cards)
                        coin_gainer.gain(1)
                  Severity: Minor
                  Found in app/cards/adventures/amulet.js - About 1 hr to fix

                    Function reveal_cards has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static reveal_cards(game, player_cards, selected_cards) {
                        let named_card
                        if (!_.isEmpty(selected_cards)) {
                          named_card = selected_cards[0].name
                          game.log.push(`&nbsp;&nbsp;<strong>${player_cards.username}</strong> names ${CardView.render(selected_cards)}`)
                    Severity: Minor
                    Found in app/cards/guilds/journeyman.js - About 1 hr to fix

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

                        play(game, player_cards, card_player) {
                          let eligible_cards = _.filter(player_cards.hand, function(card) {
                            return _.includes(_.words(card.types), 'treasure')
                          })
                          if (_.size(eligible_cards) > 0) {
                      Severity: Minor
                      Found in app/cards/menagerie/ways/way_of_the_rat.js - About 1 hr to fix

                        Function play has 28 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/seaside/haven.js - About 1 hr to fix

                          Function base2 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function seaside has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static seaside() {
                                return [
                                  'Embargo',
                                  'Haven',
                                  'Lighthouse',
                            Severity: Minor
                            Found in app/cards/lib/card_list.js - About 1 hr to fix

                              Function hinterlands has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                static hinterlands() {
                                  return [
                                    'Crossroads',
                                    'Duchess',
                                    'FoolsGold',
                              Severity: Minor
                              Found in app/cards/lib/card_list.js - About 1 hr to fix

                                Function intrigue2 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

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

                                    play(game, player_cards) {
                                      let card_gainer = new CardGainer(game, player_cards, 'discard', 'Spoils')
                                      card_gainer.gain()
                                  
                                      let player_attacker = new PlayerAttacker(game, this)
                                  Severity: Major
                                  Found in app/cards/dark_ages/marauder.js and 3 other locations - About 1 hr to fix
                                  app/cards/base/bandit.js on lines 11..17
                                  app/cards/base/bureaucrat.js on lines 11..17
                                  app/cards/guilds/soothsayer.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 57.

                                  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 coin_gainer = new CoinGainer(game, player_cards)
                                      coin_gainer.gain(1, false)
                                  
                                      let buy_gainer = new BuyGainer(game, player_cards)
                                  Severity: Major
                                  Found in app/cards/nocturne/pouch.js and 2 other locations - About 1 hr to fix
                                  app/cards/empires/plunder.js on lines 19..25
                                  app/cards/renaissance/spices.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 57.

                                  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

                                    play(game, player_cards) {
                                      let card_gainer = new CardGainer(game, player_cards, 'discard', 'Gold')
                                      card_gainer.gain()
                                  
                                      let player_attacker = new PlayerAttacker(game, this)
                                  Severity: Major
                                  Found in app/cards/base/bandit.js and 3 other locations - About 1 hr to fix
                                  app/cards/base/bureaucrat.js on lines 11..17
                                  app/cards/dark_ages/marauder.js on lines 11..17
                                  app/cards/guilds/soothsayer.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 57.

                                  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 coin_gainer = new CoinGainer(game, player_cards)
                                      coin_gainer.gain(2, false)
                                  
                                      let victory_token_gainer = new VictoryTokenGainer(game, player_cards)
                                  Severity: Major
                                  Found in app/cards/empires/plunder.js and 2 other locations - About 1 hr to fix
                                  app/cards/nocturne/pouch.js on lines 11..17
                                  app/cards/renaissance/spices.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 57.

                                  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