jcbantuelle/dominion-meteor

View on GitHub

Showing 1,158 of 1,158 total issues

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

    let coppers = _.take(_.filter(player_cards.discard, function(card) {
      return card.name === 'Copper'
    }), 2)
Severity: Minor
Found in app/cards/nocturne/hexes/bad_omens.js and 1 other location - About 35 mins to fix
app/cards/adventures/events/quest.js on lines 52..54

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

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

  point_variable(player_cards) {
    return _.size(_.filter(player_cards, function(card) {
      return card.name === 'Silver'
    }))
  }
Severity: Major
Found in app/cards/dark_ages/feodum.js and 3 other locations - About 35 mins to fix
app/cards/empires/landmarks/fountain.js on lines 7..11
app/cards/intrigue/duke.js on lines 15..19
app/cards/nocturne/pasture.js on lines 20..24

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

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

function playCard(event) {
  Meteor.call('playCard', $(event.target).attr('data-id'), FlowRouter.getParam('id'))
}
Severity: Major
Found in app/game/client/game.js and 3 other locations - About 35 mins to fix
app/game/client/game.js on lines 195..197
app/game/client/game.js on lines 199..201
app/game/client/game.js on lines 203..205

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

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

  static gain_copper(game, player_cards, response) {
    if (response === 'yes') {
      let card_gainer = new CardGainer(game, player_cards, 'hand', 'Copper')
      card_gainer.gain()
    }
Severity: Minor
Found in app/cards/hinterlands/ill_gotten_gains.js and 1 other location - About 35 mins to fix
app/cards/common/duchy.js on lines 37..42

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

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

        if (_.size(this.player_cards.deck) === 0 && _.size(this.player_cards.discard) === 0) {
          return false
        } else {
          if (_.size(this.player_cards.deck) === 0) {
            let deck_shuffler = new DeckShuffler(this.game, this.player_cards, revealed_cards)
Severity: Minor
Found in app/game/server/services/card_revealer.js and 1 other location - About 35 mins to fix
app/game/server/services/card_revealer.js on lines 52..64

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

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

    if (!_.isEmpty(this.player_cards.inheritance)) {
      Inheritance.convert_estates(this.game, this.player_cards, false)
    }
Severity: Minor
Found in app/game/server/services/turn_ender.js and 1 other location - About 35 mins to fix
app/game/server/services/turn_ender.js on lines 46..48

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

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

Avoid too many return statements within this function.
Open

      return 16
Severity: Major
Found in app/lobby/server/game_creator.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return 10
    Severity: Major
    Found in app/lobby/server/game_creator.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return 13
      Severity: Major
      Found in app/lobby/server/game_creator.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return 6
        Severity: Major
        Found in app/lobby/server/game_creator.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return 20
          Severity: Major
          Found in app/lobby/server/game_creator.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return this.selection
            Severity: Major
            Found in app/game/client/value_objects/turn_event_submission.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return 15
              Severity: Major
              Found in app/lobby/server/game_creator.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return 12
                Severity: Major
                Found in app/lobby/server/game_creator.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return 5
                  Severity: Major
                  Found in app/lobby/server/game_creator.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return 30
                    Severity: Major
                    Found in app/lobby/server/game_creator.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return '-2'
                      Severity: Major
                      Found in app/game/server/services/token_placer.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return 'T'
                        Severity: Major
                        Found in app/game/server/services/token_placer.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return 12
                          Severity: Major
                          Found in app/lobby/server/game_creator.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return 12
                            Severity: Major
                            Found in app/lobby/server/game_creator.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language