Showing 114 of 117 total issues
Function _applyRumDecorator
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_applyRumDecorator(method, eventName) {
return (...args) => {
if (!this.model.logService) {
return method(...args);
}
Function saveToken
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
saveToken(token) {
return new Promise(
(resolve, reject) => {
this._createOrGetDataset((error, dataset) => {
if (error) {
Function list
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
static list() {
return [
Service.ANY,
Service.LAMBDA,
Service.SIMPLE_STORAGE_SERVICE,
Function getPayloadError
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static getPayloadError(payload) {
if (payload.hasOwnProperty('errorMessage')) {
let error = null;
if (LambdaResponse.isValidationError(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 _registerQueryWrappers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_registerQueryWrappers() {
this._model.setPartition = function(partition) {
this[ExtendModel.PARTITION_KEY] = partition;
};
- 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 _createAws4SignedRequest
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_createAws4SignedRequest(url, httpMethod, payload, headers, callback) {
let parsedUrl = urlParse(url, qs);
let apiHost = parsedUrl.hostname;
let apiPath = parsedUrl.pathname ? parsedUrl.pathname : '/';
- 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 getPayloadError
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getPayloadError(payload) {
if (payload.hasOwnProperty('errorMessage')) {
let error = null;
if (LambdaResponse.isValidationError(payload)) {
Function _createClient
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createClient(domainName, callback) {
if (!this._domains.hasOwnProperty(domainName)) {
callback(new UnknownSearchDomainException(domainName, Object.keys(this._domains)));
return;
}
Function loadAsyncConfig
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadAsyncConfig(cb) {
if (this._asyncConfigCache) {
cb(this._asyncConfigCache);
return this;
Function log
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
log(msg, level, context) {
let nativeMethod = 'log';
switch (level) {
case Log.EMERGENCY:
Function _saveResponseToCache
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_saveResponseToCache(response, callback = () => {}) {
if (!this.isCached || this.async || (this.cacheTtl === Request.TTL_INVALIDATE) || response.isError) {
callback(null, response);
return;
}
Function _push
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_push(events) {
if (events.length <= 0) {
return Promise.resolve();
} else if (events.length > KinesisDriver.MAX_PUT_LENGTH) {
return Promise.all(
Function _readS3Object
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_readS3Object(key, cb, lastModified = null) {
let payload = {
Bucket: this._bucket,
Key: key,
};
Function createErrorObject
has 26 lines of code (exceeds 25 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
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(type, ...args) {
var driver;
switch (type.toLowerCase()) {
case 'console':
Function login
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
login(providerName, identityMetadata, callback) {
let TokenImplementation = LocalToken;
let IdentityProviderImplementation = LocalIdentityProvider;
if (!this._localBackend) {
Consider simplifying this complex logical expression. Open
if (this._kernel.isBackend) {
let runtimeContext = this._kernel.runtimeContext;
event.depthLevel = runtimeContext.getDeepFrameworkOption('lambdaDepthLevel') || 0;
event.mainRequestId = runtimeContext.getDeepFrameworkOption('mainRequestId') || runtimeContext.awsRequestId;
Function log
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
log(message, callback) {
if (!this.enabled) {
callback(null, null);
return;
}
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
create(type, ...args) {
var driver;
switch (type.toLowerCase()) {
case 'console':
- 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 _decodeToken
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_decodeToken(rawToken) {
if (rawToken && typeof rawToken === 'string') {
try {
let tokenObj = JSON.parse(rawToken);
- 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"