Showing 114 of 117 total issues
Function _parseExternal
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_parseExternal() {
let data = this._rawData;
let error = this._rawError;
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 loadLambdaCredentials
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadLambdaCredentials() {
return new Promise(
(resolve, reject) => {
this._cacheService.get('credentialsCache', (error, credentialsCache) => {
if (error && error.name !== 'MissingCacheException') {
Function _normalizeIdentityMetadata
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
_normalizeIdentityMetadata(providerName, identityMetadata) {
let token = null;
let expiresIn = null;
let expireTime = null;
let userId = null;
Function listContents
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
listContents: (pathStr, marker, callback = null) => {
let absPath = path.join(this.cwd, pathStr);
let globResponseObj = {
Marker: marker,
Function _parseLambda
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_parseLambda() {
this._parseExternal();
// check if any Lambda response available
if (this._data) {
Function getFolder
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFolder(name, msIdentifier = null) {
if (FS.FOLDERS.indexOf(name) === -1) {
throw new UnknownFolderException(name, FS.FOLDERS);
}
Function _registerQueryWrappers
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_registerQueryWrappers() {
this._model.setPartition = function(partition) {
this[ExtendModel.PARTITION_KEY] = partition;
};
Function proxyOverride
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
proxyOverride(handler, ...explMethods) {
let methods = Object.keys(handler).concat(explMethods);
for (let i in methods) {
if (!methods.hasOwnProperty(i)) {
- 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 _rawModelsToSchemas
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_rawModelsToSchemas(rawModels) {
let modelsSchema = {};
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 run
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
run(event, context, lambdaCallback = null) {
this._context = new Context(context);
this._request = new Request(event);
if (lambdaCallback) {
Function boot
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
boot(kernel, callback) {
this._nonPartitionedModels = kernel.config.nonPartitionedModels || [];
this._schemas = this._rawModelsToSchemas(kernel.config.models);
let universalRequire = new Core.Generic.UniversalRequire();
Function bootstrap
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
bootstrap(callback) {
let rumEvent = {
service: 'deep-kernel',
resourceType: 'Lambda',
eventName: 'KernelLoad',
Function onload
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
request.onload = function (deps, count) {
if (request.status == 200 || module.t) {
// Should really use an object and then Object.keys to avoid
// duplicate dependencies. But that costs bytes.
deps = [];
Function getProviderDomain
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
getProviderDomain(providerName, providers) {
let domainRegexp;
switch(providerName) {
case IdentityProvider.AMAZON_PROVIDER:
Function proxy
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
proxy() {
let proxy = {};
for (let property in this._originalInstance) {
if (typeof this._originalInstance[property] === 'function') {
Function _findUntilLimit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_findUntilLimit(query, limit, _scannedCount = 0, _accumulator = [], _lastKey = null) {
return new Promise((resolve, reject) => {
if (_lastKey) {
query.startKey(_lastKey);
}
Function _sendThroughApi
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sendThroughApi(callback = () => {}) {
let endpoint = this.action.source.api;
let headers = {};
let sendRequestFunc = (request) => {
Function _start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_start(cb) {
let cbTriggered = false;
// avoid local-dynamo package issues...
fse.ensureDirSync(this.path);
Function _loadResponseFromCache
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadResponseFromCache(driver, key, callback) {
driver.has(key, (err, has) => {
if(err) {
callback(new CachedRequestException(`Error to check if has in cache key ${key}`));
return;
Function boot
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
boot(kernel, callback) {
let resourcesVector = [];
for (let microserviceKey in kernel.microservices) {
if (!kernel.microservices.hasOwnProperty(microserviceKey)) {