Showing 4,826 of 4,826 total issues
Function interpretResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function interpretResponse(serverResponse, bidRequest) {
const bidResponses = [];
const response = serverResponse.body;
const cpm = response.cpm || 0;
if (cpm !== 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 populateVideoParams
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function populateVideoParams(params, bid) {
const linearity = deepAccess(bid, `mediaTypes.video.linearity`);
const maxDuration = deepAccess(bid, `mediaTypes.video.maxduration`);
const minDuration = deepAccess(bid, `mediaTypes.video.minduration`);
const placement = deepAccess(bid, `mediaTypes.video.placement`);
- 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 extractCPM
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function extractCPM(htmlContent, ct, cpm) {
const cpmMapDiv = htmlContent.querySelectorAll('[cpmMap]')[0];
if (cpmMapDiv) {
let cpmMapJSON = JSON.parse(cpmMapDiv.getAttribute('cpmMap'));
if ((cpmMapJSON)) {
- 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 raiGetFloor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function raiGetFloor(bid, config) {
try {
let raiFloor;
if (bid.params.bidfloor != null) {
raiFloor = bid.params.bidfloor;
- 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 renderAd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function renderAd(bid) {
let raOutstreamHBPassback = `${bid.vastXml}`;
let raPlayerHB = {
config: bid.params[0].player != undefined ? {
end: bid.params[0].player.end != null ? bid.params[0].player.end : 'close',
- 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 setupPage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function setupPage(config) {
const propertyId = config?.params?.propertyId;
if (!propertyId) {
logError('Confiant pbjs module: no propertyId provided');
return false;
- 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, bidRequest) {
const bidResponses = [];
let bidObj = bidRequest.bidRequest;
if (!serverResponse || !serverResponse.body || !bidObj) {
- 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 _getFloor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _getFloor (bid, sizes, currency) {
let floor = null;
let size = sizes.length === 1 ? sizes[0] : '*';
if (typeof bid.getFloor === 'function') {
try {
- 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) {
const syncs = [];
if (syncOptions.iframeEnabled && serverResponses.length) {
const syncIFs = serverResponses[0].body.syncIFs;
if (syncIFs) {
- 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 initSession
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function initSession() {
const now = new Date();
const expires = new Date(now.getTime() + SESSION_DURATION);
const timestamp = Math.floor(now.getTime() / 1000);
let begin = 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 _addDealCustomTargetings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _addDealCustomTargetings(imp, bid) {
var dctr = '';
var dctrLen;
if (bid.params.dctr) {
dctr = bid.params.dctr;
- 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 _parseNativeResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _parseNativeResponse(bid, newBid) {
if (bid.hasOwnProperty('adm')) {
var adm = '';
try {
adm = JSON.parse(bid.adm.replace(/\\/g, ''));
- 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 _addFledgeflag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _addFledgeflag(impObj, bid, isFledgeEnabled) {
if (isFledgeEnabled) {
impObj.ext = impObj.ext || {};
if (bid?.ortb2Imp?.ext?.ae !== undefined) {
impObj.ext.ae = bid.ortb2Imp.ext.ae;
- 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(syncOptions, serverResponses = [], gdprConsent = {}, uspConsent = '', gppConsent = {}) {
let { gdprApplies, consentString = '' } = gdprConsent;
let { gppString = '', applicableSections = [] } = gppConsent;
let bannerResponse = find(serverResponses, (res) => isArray(res.body));
- 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 getImpression
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getImpression(bidRequest) {
let impression = {
id: bidRequest.bidId
};
- 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, responses, gdprConsent) {
if (gdprConsent) {
let gdpr = (typeof gdprConsent.gdprApplies === 'boolean') ? Number(gdprConsent.gdprApplies) : 0;
if (syncOptions.iframeEnabled && (!gdprConsent.gdprApplies || hasPurpose1Consent(gdprConsent))) {
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 initTranslation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function initTranslation(url, localStorageKey) {
setupBeforeHookFnOnce(addBidResponse, getAdserverCategoryHook, 50);
let mappingData = storage.getDataFromLocalStorage(localStorageKey);
try {
mappingData = mappingData ? JSON.parse(mappingData) : 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 interpretResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
interpretResponse: ({ body }, req) => {
if (
!body ||
!body.seatbid ||
body.seatbid.length === 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 buildRequests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
buildRequests: function (validBidRequests, bidderRequest) {
return validBidRequests.map(bidRequest => {
const sizes = parseSizesInput(bidRequest.params.size || bidRequest.sizes);
let mdType = 0;
if (bidRequest.mediaTypes[BANNER]) {
- 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 adResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function adResponse(bid, ad) {
const price = getPrice(ad);
const adDetails = getAdDetails(ad);
const markup = getAdMarkup(ad);
- 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"