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) {
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
create: function(type, uri, data, success, error, settings) {
Function update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
update: function(type, uri, data, success, error, settings) {
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;
- 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 create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
create: function(type, uri, data, success, error) {
Function delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
delete: function(type, uri, success, error, settings) {
Function update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
update: function(type, uri, data, success, error) {
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) :
- 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 _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;
- 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 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) {
- 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 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) {
- 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
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return "unverified";
Avoid too many return
statements within this function. Open
return "created";
Avoid too many return
statements within this function. Open
return error.errors.every(function(err) {
return ErrorsLogger.isExpectedStatusCode(err.status_code);
});
Avoid too many return
statements within this function. Open
return "The transaction failed. No failure reason was given.";
Avoid too many return
statements within this function. Open
return "pending";
Avoid too many return
statements within this function. Open
return undefined;
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 {
- 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"