Showing 117 of 117 total issues
Function _load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_load(endpoint = null) {
this._endpoint = endpoint || this._endpoint;
if (this._enforceRoot && !/^http|\//i.test(this._endpoint)) {
this._endpoint = `/${this._endpoint}`;
- 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 boot
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
boot(kernel, callback) {
this._buildId = kernel.buildId;
if (kernel.isFrontend) {
let loadVector = [];
- 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 _transform
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static _transform(obj) {
let transObj = {};
for (let property in obj) {
if (!obj.hasOwnProperty(property)) {
- 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 proxy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
proxy() {
let proxy = {};
for (let property in this._originalInstance) {
if (typeof this._originalInstance[property] === 'function') {
- 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 _decodePayload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_decodePayload() {
let decodedPayload = null;
if (this._rawData) {
if (this._rawData.Payload) {
- 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 constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(...abstractMethods) {
let methods = abstractMethods.length === 1 && abstractMethods[0] instanceof Array
? abstractMethods[0]
: abstractMethods;
- 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 getSitePlatform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getSitePlatform(defaultValue = 'custom') {
const metaGenerator = this._findMetaContent('generator');
if (metaGenerator.length <= 0) {
return defaultValue;
- 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 _isEnabledForTable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_isEnabledForTable(tableName) {
for (let modelName in this._modelsToExtend) {
if (!this._modelsToExtend.hasOwnProperty(modelName)) {
continue;
}
- 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 deeply nested control flow statements. Open
if (this.kernel && this.kernel.isRumEnabled) {
s3Fs = new S3FsRumProxy(s3Fs, this.kernel.get('log')).proxy();
}
Function _rawModelsVector
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_rawModelsVector(rawModels) {
let modelsVector = [];
for (let modelKey in rawModels) {
if (!rawModels.hasOwnProperty(modelKey)) {
- 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 getAppropriateAwsRegion
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static getAppropriateAwsRegion(defaultRegion, availableRegions) {
if (availableRegions.indexOf(defaultRegion) !== -1) {
return defaultRegion;
}
- 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 extract
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
extract() {
let actions = this._action.count() > 0 ? this._action.extract() : Policy.ANY;
let resources = this._resource.count() > 0 ? this._resource.extract() : null;
let statement = {
- 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 find
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
find(thing, strict = false) {
for (let objectKey in this._vector) {
if (!this._vector.hasOwnProperty(objectKey)) {
continue;
}
- 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
Consider simplifying this complex logical expression. Open
if (this._error && typeof this._error === 'object'
&& this._error.crossDomain
&& typeof this._error.crossDomain.status === 'undefined') {
this._statusCode = 403;
Function findAllByPaginated
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
findAllByPaginated: function(fieldName, value, startKey, limit, cb) {
Function _findUntilLimit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_findUntilLimit(query, limit, _scannedCount = 0, _accumulator = [], _lastKey = null) {
Function getUser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getUser(callback) {
// @todo: backward compatibility hook, remove on next major release
let argsHandler = (error, user) => {
if (callback.length === 1) {
if (error) {
- 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 createErrorObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static createErrorObject(error) {
let errorObj = {};
let errorCode = Exception.DEFAULT_CODE;
if (error.name === 'ValidationError') { // we assume it's a joi validation error
- 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 getProviderDomain
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getProviderDomain(providerName, providers) {
let domainRegexp;
switch(providerName) {
case IdentityProvider.AMAZON_PROVIDER:
- 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 generate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static generate(ensureUnique = true) {
this._uuids = this._uuids || [];
let date = new Date().getTime();
- 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"