hhff/spree-ember

View on GitHub

Showing 82 of 82 total issues

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

    var shipAddress = spreeStore.createRecord('address', {
      firstname: 'Hugh',
      lastname: 'Francis',
      address1: '123 Street st',
      address2: 'Suite 2',
Severity: Major
Found in packages/checkouts/tests/unit/serializers/order-test.js and 1 other location - About 1 hr to fix
packages/checkouts/tests/unit/serializers/order-test.js on lines 62..72

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

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

Function adapterDidInvalidate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  adapterDidInvalidate: function(errors) {
    var recordErrors = Ember.get(this, 'errors');
    var nestedRecordErrors = {};

    for (var key in errors) {
Severity: Minor
Found in packages/core/addon/mixins/handles-nested-server-errors.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  included: function(app) {
    this._super.included(app);
    
    /* Here we call included on any nested Spree Ember Dependencies */
    this.addons.forEach(function(addon){
Severity: Minor
Found in packages/auth/index.js - About 1 hr to fix

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

    module.exports = function(environment) {
      var ENV = {
        modulePrefix: 'dummy',
        environment: environment,
        baseURL: '/',
    Severity: Minor
    Found in packages/auth/tests/dummy/config/environment.js - About 1 hr to fix

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

        andThen(function() {
          assert.equal(currentPath(), 'spree.signup');
          fillIn('input[placeholder="Email"]', email);
          fillIn('input[placeholder="Password"]', 'password123');
          fillIn('input[placeholder="Password Confirmation"]', 'password123');
      Severity: Major
      Found in packages/auth/tests/acceptance/account-test.js and 1 other location - About 1 hr to fix
      packages/auth/tests/acceptance/signup-test.js on lines 32..38

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

      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

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

        andThen(function() {
          assert.equal(currentPath(), 'spree.signup');
          fillIn('input[placeholder="Email"]', email);
          fillIn('input[placeholder="Password"]', 'password123');
          fillIn('input[placeholder="Password Confirmation"]', 'password123');
      Severity: Major
      Found in packages/auth/tests/acceptance/signup-test.js and 1 other location - About 1 hr to fix
      packages/auth/tests/acceptance/account-test.js on lines 34..40

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

      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

      test('it works', function(assert) {
        var UserRouteActionsObject = Ember.Object.extend(UserRouteActionsMixin);
        var subject = UserRouteActionsObject.create();
        assert.ok(subject);
      });
      Severity: Major
      Found in packages/auth/tests/unit/mixins/user-route-actions-test.js and 1 other location - About 1 hr to fix
      packages/core/tests/unit/mixins/can-checkout-test.js on lines 7..11

      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 2 locations. Consider refactoring.
      Open

      export default Ember.Component.extend({
        layout: layout,
        action: 'transitionCheckoutState',
      
        actions: {
      Severity: Major
      Found in packages/storefront/addon/components/spree-checkout.js and 1 other location - About 1 hr to fix
      packages/storefront/addon/components/spree-order.js on lines 21..30

      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 2 locations. Consider refactoring.
      Open

      test('it works', function(assert) {
        var CanCheckoutObject = Ember.Object.extend(CanCheckoutMixin);
        var subject = CanCheckoutObject.create();
        assert.ok(subject);
      });
      Severity: Major
      Found in packages/core/tests/unit/mixins/can-checkout-test.js and 1 other location - About 1 hr to fix
      packages/auth/tests/unit/mixins/user-route-actions-test.js on lines 8..12

      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 2 locations. Consider refactoring.
      Open

      export default Ember.Component.extend({
        layout: layout,
        action: 'transitionCheckoutState',
      
        actions: {
      Severity: Major
      Found in packages/storefront/addon/components/spree-order.js and 1 other location - About 1 hr to fix
      packages/storefront/addon/components/spree-checkout.js on lines 21..30

      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

      Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(environment) {
        var ENV = {
          modulePrefix: 'dummy',
          environment: environment,
          baseURL: '/',
      Severity: Minor
      Found in packages/checkouts/tests/dummy/config/environment.js - About 1 hr to fix

        Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(environment) {
          var ENV = {
            modulePrefix: 'dummy',
            environment: environment,
            baseURL: '/',
        Severity: Minor
        Found in packages/storefront/tests/dummy/config/environment.js - About 1 hr to fix

          Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function(environment) {
            var ENV = {
              modulePrefix: 'dummy',
              environment: environment,
              baseURL: '/',
          Severity: Minor
          Found in packages/core/tests/dummy/config/environment.js - About 1 hr to fix

            Function transition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              transition: function(stateName) {
                var nextStateName;
                var checkoutState = this.get('currentState');
            
                if (this.get('currentOrder')) {
            Severity: Minor
            Found in packages/checkouts/app/services/checkouts.js - About 55 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

              andThen(function() {
                assert.equal(currentPath(), 'spree.signin');
                fillIn('input[placeholder="Email"]', 'spree-ember@example.com');
                fillIn('input[placeholder="Password"]', 'spree123');
                click('button[type="submit"]');
            Severity: Minor
            Found in packages/auth/tests/acceptance/signin-test.js and 1 other location - About 45 mins to fix
            packages/auth/tests/acceptance/signin-test.js on lines 24..29

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

            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

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

              andThen(function() {
                assert.equal(currentPath(), 'spree.signin');
                fillIn('input[placeholder="Email"]', 'spree-ember@example.com');
                fillIn('input[placeholder="Password"]', 'spree123');
                click('button[type="submit"]');
            Severity: Minor
            Found in packages/auth/tests/acceptance/signin-test.js and 1 other location - About 45 mins to fix
            packages/auth/tests/acceptance/signin-test.js on lines 40..45

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

            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

            test('taxons show', function(assert) {
              visit('/t/categories/bags');
              
              andThen(function() {
                assert.equal(currentPath(), 'spree.taxons.index');
            Severity: Major
            Found in packages/storefront/tests/acceptance/router-test.js and 3 other locations - About 40 mins to fix
            packages/storefront/tests/acceptance/router-test.js on lines 20..26
            packages/storefront/tests/acceptance/router-test.js on lines 28..34
            packages/storefront/tests/acceptance/router-test.js on lines 36..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 48.

            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

            test('products index', function(assert) {
              visit('/products');
              
              andThen(function() {
                assert.equal(currentPath(), 'spree.products.index');
            Severity: Major
            Found in packages/storefront/tests/acceptance/router-test.js and 3 other locations - About 40 mins to fix
            packages/storefront/tests/acceptance/router-test.js on lines 20..26
            packages/storefront/tests/acceptance/router-test.js on lines 36..42
            packages/storefront/tests/acceptance/router-test.js on lines 44..50

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

            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

            test('products show', function(assert) {
              visit('/products/ruby-on-rails-baseball-jersey');
              
              andThen(function() {
                assert.equal(currentPath(), 'spree.products.show');
            Severity: Major
            Found in packages/storefront/tests/acceptance/router-test.js and 3 other locations - About 40 mins to fix
            packages/storefront/tests/acceptance/router-test.js on lines 20..26
            packages/storefront/tests/acceptance/router-test.js on lines 28..34
            packages/storefront/tests/acceptance/router-test.js on lines 44..50

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

            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

            test('sanity check', function(assert) {
              visit('/');
              
              andThen(function() {
                assert.equal(currentPath(), 'spree.index');
            Severity: Major
            Found in packages/storefront/tests/acceptance/router-test.js and 3 other locations - About 40 mins to fix
            packages/storefront/tests/acceptance/router-test.js on lines 28..34
            packages/storefront/tests/acceptance/router-test.js on lines 36..42
            packages/storefront/tests/acceptance/router-test.js on lines 44..50

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

            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