Function getId
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
getId(config, consentData, cacheIdObj) {
cookieDomain = lotamePanoramaIdSubmodule.findRootDomain();
const configParams = (config && config.params) || {};
const clientId = configParams.clientId;
const hasCustomClientId = !isEmpty(clientId);
Function getId
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
getId(config, consentData, cacheIdObj) {
cookieDomain = lotamePanoramaIdSubmodule.findRootDomain();
const configParams = (config && config.params) || {};
const clientId = configParams.clientId;
const hasCustomClientId = !isEmpty(clientId);
- 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 resolveIdFunction
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
const resolveIdFunction = function (callback) {
let queryParams = {};
if (storedUserId) {
queryParams.fp = storedUserId;
}
File lotamePanoramaIdSystem.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* This module adds LotamePanoramaId to the User ID module
* The {@link module:modules/userId} module is required
* @module modules/lotamePanoramaId
* @requires module:modules/userId
Function getFromStorage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getFromStorage(key) {
let value = null;
if (storage.cookiesAreEnabled()) {
value = storage.getCookie(key, undefined);
}
- 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 saveLotameCache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function saveLotameCache(
key,
value,
expirationTimestamp = timestamp() + DAYS_TO_CACHE * DAY_MS
) {
- 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"