Showing 31 of 31 total issues
Function replaceAddressWithCoordinates
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
replaceAddressWithCoordinates(params, addressField, latField, lngField, callback) {
Function getPayments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PartnerPayments.prototype.getPayments = function getPayments(off, lim, from, to, callback) {
Function getTrips
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PartnerTrips.prototype.getTrips = function getTrips(off, lim, from, to, callback) {
Function updateByID
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Requests.prototype.updateByID = function updateByID(id, parameters, callback) {
if (!id) {
return callback(new Error('Invalid request_id'));
}
- 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;
Function setDriversAvailabilityByID
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Products.prototype.setDriversAvailabilityByID = function setDriversAvailabilityByID(id, availability, callback) {
if (!id) {
return callback(new Error('Invalid product_id'));
}
- 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 getPriceForRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Estimates.prototype.getPriceForRoute = function getPriceForRoute(startLat,
startLon, endLat, endLon, seats, callback) {
// seats is optional
if (typeof seats === 'function') {
callback = seats;
- 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 replaceAddressWithCoordinates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Uber.prototype.replaceAddressWithCoordinates = function
replaceAddressWithCoordinates(params, addressField, latField, lngField, callback) {
if (this.hasOwnNestedProperty(params, addressField) && !this.getNestedProperty(params, latField) && !this.getNestedProperty(params, lngField)) {
// get coordinates from address
this.getCoordinatesForAddress(this.getNestedProperty(params, addressField), function (err, data) {
- 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 getCoordinatesForAddress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Uber.prototype.getCoordinatesForAddress = function getCoordinatesForAddress(address, callback) {
this.geocoder.geocode(address, function (err, data) {
if (err || data.length === 0) {
return callback((err
? err
- 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 setSurgeMultiplierByID
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Products.prototype.setSurgeMultiplierByID = function setSurgeMultiplierByID(id, multiplier, callback) {
if (!id) {
return callback(new Error('Invalid product_id'));
}
- 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 getEstimates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Requests.prototype.getEstimates = function getEstimates(parameters, callback) {
if (!parameters) {
return callback(new Error('Invalid parameters'));
}
- 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"