src/deep-security/lib/Token.js
File Token.js
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by mgoria on 6/23/15.
*/
'use strict';
Token
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class Token {
/**
* @returns {number}
*/
static get MAX_RETRIES() {
Function loadCredentials
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadCredentials(callback = () => {}, authScope = null) {
let scopeKey = authScope ? authScope.toString() : 'default';
let event = {
service: 'deep-security',
Function loadLambdaCredentials
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadLambdaCredentials() {
return new Promise(
(resolve, reject) => {
this._cacheService.get('credentialsCache', (error, credentialsCache) => {
if (error && error.name !== 'MissingCacheException') {
Function getUser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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 identityId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
get identityId() {
let identityId = null;
let credentials = this.credentialsManager.systemCredentials;
if (this.lambdaContext) {
- 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"