Showing 4,826 of 4,826 total issues
Function buildRequests
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
buildRequests: function (validBidRequests, bidderRequest) {
const payload = createOrtbTemplate();
deepSetValue(payload, 'id', bidderRequest.bidderRequestId);
- 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 setMediaTypes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function setMediaTypes(types, bid) {
if (bid.mediaType && validMediaType(bid.mediaType)) {
return [bid.mediaType];
}
if (Array.isArray(types)) {
- 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 normalizeDefault
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function normalizeDefault(model) {
if (isNumber(model.default)) {
let defaultRule = '*';
const numFields = (model.schema?.fields || []).length;
if (!numFields) {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent, gppConsent) {
const syncs = [];
const queryParams = ['src=pbjs%2F$prebid.version$'];
if (gdprConsent) {
queryParams.push(`gdpr=${Number(gdprConsent.gdprApplies && 1)}&consent=${encodeURIComponent(gdprConsent.consentString || '')}`);
- 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 site
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function site(bidRequests, bidderRequest) {
const pubId =
bidRequests && bidRequests.length > 0
? bidRequests[0].params.publisherId
: '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 decode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
decode (value, config) {
if (!value) {
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 _validateParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function _validateParams(bidRequest) {
if (!bidRequest.params) {
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 fillBidMeta
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function fillBidMeta(bid, tag) {
if (isStr(tag.agencyName)) {
deepSetValue(bid, 'meta.agencyName', tag.agencyName);
}
if (isNumber(tag.advertiserId)) {
- 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 isBidResponseValid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function isBidResponseValid(bidResponse) {
let requiredKeys = ['requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency'];
switch (bidResponse.mediaType) {
case 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 isBidRequestValid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
isBidRequestValid: function(bidRequest) {
logInfo('bid: ', bidRequest);
// check if request has valid mediaTypes
if (!hasValidMediaType(bidRequest)) 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 getPlayer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getPlayer(playerDivId) {
const jwplayer = window.jwplayer;
if (!jwplayer) {
logError(SUBMODULE_NAME + '.js was not found on page');
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 buildSiteComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
let buildSiteComponent = (bidRequest, bidderRequest) => {
let loc = parseUrl(bidderRequest.refererInfo.page || '', {
decodeSearchAsString: 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 handleEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function handleEvent(eventType, eventArgs) {
if (eventArgs) {
eventArgs = hasNonSerializableProperty(eventArgs) ? eventArgs : deepClone(eventArgs)
} else {
eventArgs = {}
- 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 getStartDelayForVideoBidRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getStartDelayForVideoBidRequest: function(videoMediaType, videoParams) {
if (videoParams?.startDelay) {
return videoParams.startDelay;
} else if (videoMediaType?.startdelay) {
if (videoMediaType.startdelay > 0 || videoMediaType.startdelay == -1) {
- 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 getEids
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getEids(bidRequest) {
let eids = {}
let uId2 = deepAccess(bidRequest, 'userId.uid2.id');
if (uId2) {
- 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 buildVideoImp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function buildVideoImp(bidRequest, imp) {
if (bidRequest.mediaTypes[VIDEO]?.context === 'outstream') {
imp.video.placement = imp.video.placement || 4;
}
- 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 addEventToQueue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const addEventToQueue = (event, auctionId, eventName) => {
// If it's auction has not left yet, add it there
if (cache.auctions[auctionId] && !cache.auctions[auctionId].sent) {
cache.auctions[auctionId].pendingEvents = mergeDeep(cache.auctions[auctionId].pendingEvents, event);
} else if (rubiConf.analyticsEventDelay > 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 6 (exceeds 5 allowed). Consider refactoring. Open
buildRequests: (bidRequests, bidderRequest) => {
return bidRequests.map((bid) => {
var gdprConsent;
if (bidderRequest && bidderRequest.gdprConsent) {
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 registerEventsForAdServers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function registerEventsForAdServers(config) {
const GPT_EVENTS = new Set([
'impressionViewable',
'slotRenderEnded',
'slotVisibilityChanged',
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
interpretResponse: function(serverResponse) {
let responseBody = serverResponse.body;
const bids = [];
if (responseBody && responseBody.no_bid !== 1) {
let size = parseSize(responseBody.size);
- 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"