hhff/spree-ember

View on GitHub

Showing 12 of 82 total issues

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

module.exports = function(grunt) {
  var packageNames = [];
  var guides = [];

  // Grunt Tasks
Severity: Major
Found in Gruntfile.js - About 7 hrs to fix

    Function _serializeForCheckouts has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _serializeForCheckouts: function(snapshot, orderJSON) {
        var order         = snapshot.record;
        var checkoutState = this.get('checkouts.currentState');
    
        var data = {
    Severity: Minor
    Found in packages/checkouts/addon/serializers/order.js - About 1 hr to fix

      Function _serializeForCheckouts has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        _serializeForCheckouts: function(snapshot, orderJSON) {
          var order         = snapshot.record;
          var checkoutState = this.get('checkouts.currentState');
      
          var data = {
      Severity: Minor
      Found in packages/checkouts/addon/serializers/order.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 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

          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

                Function selectedVariant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  selectedVariant: Ember.computed('product.variants', function() {
                    var selection = this.get('variantSelection');
                    var variants  = this.get('product.variants');
                
                    if (selection) {
                Severity: Minor
                Found in packages/storefront/addon/components/spree-pdp.js - About 25 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

                Function steps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  steps: Ember.computed('checkoutSteps', 'checkoutState', function() {
                    var checkoutSteps = this.get('checkoutSteps') || Ember.A();
                    var checkoutState = this.get('checkoutState');
                    var stepObjects   = Ember.A();
                
                
                Severity: Minor
                Found in packages/storefront/addon/components/spree-breadcrumbs.js - About 25 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

                Severity
                Category
                Status
                Source
                Language