Showing 63 of 243 total issues
Function applyUriFilters
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
applyUriFilters: function(uri, params) {
if (!uri) {
return uri;
}
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) {
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;
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'
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;
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();
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;
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'));
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/';
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);
};
- Read upRead up
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 {
- Read upRead up
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);
};
- Read upRead up
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;
- Read upRead up
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;
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 &&
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 &&
Function applyUriFilters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
applyUriFilters: function(uri, params) {
if (!uri) {
return uri;
}
- Read upRead up
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 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();
- Read upRead up
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 dateFormatValidation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var dateFormatValidation = function(value, attribute, validationErrors) {
var match = value.match(DATE_FORMAT);
var year;
var month;
if (match) {
- Read upRead up
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"