Showing 4,826 of 4,826 total issues
Function getMediafuseViewabilityScriptFromJsTrackers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getMediafuseViewabilityScriptFromJsTrackers(jsTrackerArray) {
let viewJsPayload;
if (isStr(jsTrackerArray) && strIsMediafuseViewabilityScript(jsTrackerArray)) {
viewJsPayload = jsTrackerArray;
} else if (isArray(jsTrackerArray)) {
- 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 getUserSyncs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getUserSyncs: function(syncOptions, serverResponses, gdprConsent, usPrivacy) {
const syncs = [];
let gdprParams = getGdprQueryParams(gdprConsent);
let iframePrivacyParams = '';
- 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 interpretResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
interpretResponse: function (serverResponse, { bidderRequest }) {
serverResponse = serverResponse.body;
const bids = [];
if (!serverResponse || serverResponse.error) {
let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`;
- 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 getCids
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getCids(site) {
if (site.content && Array.isArray(site.content.data)) {
for (const dataItem of site.content.data) {
if (dataItem.name.includes('iris.com') || dataItem.name.includes('iris.tv')) {
return dataItem.ext.cids.join(',');
- 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 buildRequests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
buildRequests: function(validBidRequests = [], bidderRequest = {}) {
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
const chtnwId = (storage.getCookie(COOKIE_NAME) != undefined) ? storage.getCookie(COOKIE_NAME) : generateUUID();
if (storage.cookiesAreEnabled()) {
storage.setCookie(COOKIE_NAME, chtnwId);
- 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 handleLegacyParams
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function handleLegacyParams(params, sizes) {
const data = {};
if (params.inScreenPubID) {
data.pubId = params.inScreenPubID;
data.pi = 2;
- 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 mapObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function mapObject({
bidder,
adUnitCode,
auctionId,
transactionId,
- 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 buildNativeRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function buildNativeRequest(bidRequest, bidderRequest) {
let counter = 0;
let assets = [];
let bidFloor = getBidFloor(bidRequest);
- 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 interpretResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
interpretResponse(serverResponse, bidRequest) {
const bidResponses = [];
try {
if (serverResponse.body && serverResponse.body.seatbid && isArray(serverResponse.body.seatbid)) {
- 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 generateNativeImgObj
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function generateNativeImgObj(obj, type, id) {
let adW = 0;
let adH = 0;
let bidSizes = obj.sizes;
- 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 isBidRequestValid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
isBidRequestValid: function(bid) {
if (_isVideoBid(bid)) {
if (!_isValidVideoBid(bid, true)) {
// in case if video bid configuration invalid will try to send bid request for banner
if (!_isBannerBid(bid)) {
- 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 buildBannerRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function buildBannerRequest(bidRequest, bidderRequest) {
let bidFloor = getBidFloor(bidRequest);
let adW = 0;
let adH = 0;
- 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 buildRegs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function buildRegs(bidderRequest) {
let regs = {
ext: {},
};
if (bidderRequest.gdprConsent) {
- 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 getAssetImageType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getAssetImageType(id, assets) {
for (var i = 0; i < assets.length; i++) {
if (assets[i].id == id) {
if (assets[i].img.type == 1) { return 'icon'; } else if (assets[i].img.type == 3) { return 'image'; }
}
- 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 getRealTimeData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getRealTimeData(reqBidsConfigObj, onDone, rtdConfig, userConsent) {
if (rtdConfig && isPlainObject(rtdConfig.params)) {
const jsonData = storage.getDataFromLocalStorage(RTD_LOCAL_NAME);
if (jsonData) {
const parsedData = parseJson(jsonData);
- 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 _setReferrer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _setReferrer(refs, s) {
if (s) {
// store the longest one for the same URI
const url = s.split('?')[0];
// OR store the longest one for the same domain
- 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 _isValidVideoBid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _isValidVideoBid(bid, logErrors = false) {
let result = true;
const videoMediaType = deepAccess(bid, 'mediaTypes.video');
if (!_isVideoInstreamBid(bid)) {
if (logErrors) {
- 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 buildRequests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
buildRequests: function (bidRequests, bidderRequest) {
const gdprApplies = deepAccess(bidderRequest, 'gdprConsent.gdprApplies');
return {
method: 'POST',
url: getEndpoint(),
- 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 getTargetBidderOfDgKeywords
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getTargetBidderOfDgKeywords(adUnits) {
let setKeywordTargetBidders = [];
for (let adUnit of adUnits) {
for (let bid of adUnit.bids) {
if (bid.params && bid.params['dgkeyword'] === true) {
- 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 validateAppendObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function validateAppendObject(validationFunction, allowedKeys, inputObject, appendToObject) {
const outputObject = {
...appendToObject
};
if (allowedKeys.length > 0 && typeof validationFunction === '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"