balanced/balanced-dashboard

View on GitHub

Showing 63 of 243 total issues

Function _populateObject has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _populateObject: function(modelObj, objType, rootJson) {
        var linksValues = {};
        linksValues[objType + '.id'] = modelObj.id;
        linksValues[objType + '.self'] = modelObj.id;

Severity: Minor
Found in app/serializers/rev1.js - About 1 hr to fix

    Function addFiles has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        addFiles: function(files) {
            var documentsToUpload = this.get('documentsToUpload');
            var errorCount = 0;
    
            _.each(files, function(file) {
    Severity: Minor
    Found in app/views/modals/evidence-portal-modal.js - About 1 hr to fix

      Function signInRequest has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          signInRequest: function(options) {
              var self = this;
              var attributes = _.extend({}, {
                  url: ENV.BALANCED.AUTH + '/logins',
                  type: 'POST'
      Severity: Minor
      Found in app/auth.js - About 1 hr to fix

        Function save has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            save: function() {
                var deferred = Ember.RSVP.defer();
        
                var baseDebitAttributes = this.getDebitAttributes();
                var self = this;
        Severity: Minor
        Found in app/models/factories/debit-card-transaction-factory.js - About 1 hr to fix

          Function ajax has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              ajax: function(url, type, settings) {
                  settings = settings || {};
                  settings.url = url;
                  settings.type = type;
                  settings.context = this;
          Severity: Minor
          Found in app/adapters/ajax.js - About 1 hr to fix

            Function validateAndSave has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                validateAndSave: function(settings) {
                    this.get("validationErrors").clear();
                    this.validate();
                    if (this.get("isValid")) {
                        var Adapter = this.constructor.getAdapter();
            Severity: Minor
            Found in app/models/core/model.js - About 1 hr to fix

              Function belongsTo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  belongsTo: function(propertyName, defaultType) {
                      defaultType = defaultType || 'model';
              
                      var embeddedProperty = JSON_PROPERTY_KEY + '.' + propertyName;
                      var uriProperty = propertyName + URI_POSTFIX;
              Severity: Minor
              Found in app/models/core/model.js - About 1 hr to fix

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

                        save: function() {
                            this.get('model').validate();
                            if (this.get('model').get("isValid")) {
                                var formData = new FormData();
                                formData.append('note', this.get('model.note'));
                Severity: Minor
                Found in app/views/modals/evidence-portal-modal.js - About 1 hr to fix

                  Function resetPassword has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          resetPassword: function() {
                              var model = this.get('model');
                              var self = this;
                              var baseUri = location.hash.indexOf('invite') > 0 ? '/invite/' : '/password/';
                  
                  
                  Severity: Minor
                  Found in app/controllers/reset-password.js - About 1 hr to fix

                    Function validator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                                    validator: function(object, attribute, value) {
                                        var message = function(message) {
                                            object.get("validationErrors").add(attribute, "format", null, message);
                                        };
                    
                    
                    Severity: Minor
                    Found in app/models/factories/reverse-credit-transaction-factory.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 validator has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                                    validator: function(object, attribute, value) {
                                        var message = function(message) {
                                            object.get("validationErrors").add(attribute, "format", null, message);
                                        };
                    
                    
                    Severity: Minor
                    Found in app/models/factories/refund-debit-transaction-factory.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 status_description has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        status_description: function() {
                            if (this.get('is_pending')) {
                                if (this.get('funding_instrument_type') === 'Debit card') {
                                    return "Funds will be available within 2-3 business days";
                                } else {
                    Severity: Minor
                    Found in app/models/credit.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 formatError has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        formatError: function(error) {
                            if (error !== null && error !== undefined) {
                                if (error.message) {
                                    // amount validation
                                    return error.message;
                    Severity: Minor
                    Found in app/lib/utils.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 forgotPass has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            forgotPass: function() {
                                var model = this.get("model");
                                var controller = this.get("controllers.notification_center");
                                var self = this;
                    
                    
                    Severity: Minor
                    Found in app/controllers/forgot-password.js - About 1 hr to fix

                      Function save has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          save: function() {
                              var Debit = BalancedApp.__container__.lookupFactory("model:debit");
                              var self = this;
                              this.validate();
                              if (this.get("isValid")) {

                        Consider simplifying this complex logical expression.
                        Open

                                    if (record.hasOwnProperty(prop) &&
                                        $.inArray(prop, computedProps) === -1 &&
                                        $.inArray(prop, lifecycleProperties) === -1 &&
                                        $.inArray(prop, this.privateProperties) === -1 &&
                                        prop.indexOf('__ember') < 0 &&
                        Severity: Major
                        Found in app/serializers/rev1.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if (record.hasOwnProperty(prop) &&
                                          $.inArray(prop, computedProps) === -1 &&
                                          $.inArray(prop, lifecycleProperties) === -1 &&
                                          $.inArray(prop, this.privateProperties) === -1 &&
                                          prop.indexOf('__ember') < 0 &&
                          Severity: Major
                          Found in app/serializers/rev0.js - About 1 hr to fix

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

                                validateAndSave: function(settings) {
                                    this.get("validationErrors").clear();
                                    this.validate();
                                    if (this.get("isValid")) {
                                        var Adapter = this.constructor.getAdapter();
                            Severity: Minor
                            Found in app/models/core/model.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 applyUriFilters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                applyUriFilters: function(uri, params) {
                                    if (!uri) {
                                        return uri;
                                    }
                            
                            
                            Severity: Minor
                            Found in app/lib/utils.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 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

                            Severity
                            Category
                            Status
                            Source
                            Language