balanced/balanced-dashboard

View on GitHub

Showing 63 of 243 total issues

Function setAuthProperties has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    setAuthProperties: function(signedIn, user, userId, authToken, isGuest, isAdmin) {
Severity: Minor
Found in app/auth.js - About 45 mins to fix

    Function create has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        create: function(type, uri, data, success, error, settings) {
    Severity: Minor
    Found in app/adapters/ajax.js - About 45 mins to fix

      Function update has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          update: function(type, uri, data, success, error, settings) {
      Severity: Minor
      Found in app/adapters/ajax.js - About 45 mins to fix

        Function isExpectedError has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            isExpectedError: function(error) {
                if (error === undefined || error === null) {
                    return true;
                } else if (error.message === "TransitionAborted") {
                    return true;
        Severity: Minor
        Found in app/lib/errors-logger.js - About 45 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 create has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            create: function(type, uri, data, success, error) {
        Severity: Minor
        Found in app/adapters/fixture.js - About 35 mins to fix

          Function delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              delete: function(type, uri, success, error, settings) {
          Severity: Minor
          Found in app/adapters/ajax.js - About 35 mins to fix

            Function update has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                update: function(type, uri, data, success, error) {
            Severity: Minor
            Found in app/adapters/fixture.js - About 35 mins to fix

              Function generateTransactionAppearsOnStatementAsValidation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              var generateTransactionAppearsOnStatementAsValidation = function(maxLength) {
                  return formatValidator(function(object, attribute, value, cb) {
                      var messages = [];
                      maxLength = _.isString(maxLength) ?
                          object.get(maxLength) :
              Severity: Minor
              Found in app/utils/validation-helpers.js - About 35 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 _materializeLoadedObjectFromAPIResult has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  _materializeLoadedObjectFromAPIResult: function(json) {
                      var UserMarketplace = require("balanced-dashboard/models/user-marketplace")['default'];
                      var UserInvite = require("balanced-dashboard/models/user-invite")['default'];
              
                      var objClass = this;
              Severity: Minor
              Found in app/models/core/model.js - About 35 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 open has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  open: function(model) {
                      var self = this;
                      if (model) {
                          var eventName = this.get('defaultModelAction');
                          if (eventName) {
              Severity: Minor
              Found in app/views/modals/modal.js - About 35 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 extractCollection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  extractCollection: function(rootJson) {
                      var collection = [];
                      var self = this;
              
                      var populateFunc = function(val) {
              Severity: Minor
              Found in app/serializers/rev1.js - About 35 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

              Avoid too many return statements within this function.
              Open

                          return false;
              Severity: Major
              Found in app/lib/errors-logger.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return false;
                Severity: Major
                Found in app/lib/errors-logger.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return "unverified";
                  Severity: Major
                  Found in app/models/bank-account.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return "created";
                    Severity: Major
                    Found in app/models/hold.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return error.errors.every(function(err) {
                                      return ErrorsLogger.isExpectedStatusCode(err.status_code);
                                  });
                      Severity: Major
                      Found in app/lib/errors-logger.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return "The transaction failed. No failure reason was given.";
                        Severity: Major
                        Found in app/models/credit.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return "pending";
                          Severity: Major
                          Found in app/models/bank-account.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return undefined;
                            Severity: Major
                            Found in app/models/credit.js - About 30 mins to fix

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

                                  displayName: function() {
                                      var name;
                                      if (this.get('is_business')) {
                                          name = this.get('business_name');
                                      } else {
                              Severity: Minor
                              Found in app/models/customer.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