Showing 3,230 of 5,407 total issues
Function newConfig
has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring. Open
export function newConfig() {
let listeners = [];
let defaults;
let config;
let bidderConfig;
- 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 detectReferer
has a Cognitive Complexity of 98 (exceeds 5 allowed). Consider refactoring. Open
export function detectReferer(win) {
/**
* This function would return a read-only array of hostnames for all the parent frames.
* win.location.ancestorOrigins is only supported in webkit browsers. For non-webkit browsers it will return 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
File medianetAnalyticsAdapter.js
has 814 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
_map,
deepAccess,
getWindowTop,
groupBy,
Function MarsmediaAdapter
has 360 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MarsmediaAdapter() {
this.code = 'marsmedia';
this.aliases = ['mars'];
this.supportedMediaTypes = [VIDEO, BANNER];
Function newConfig
has 357 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function newConfig() {
let listeners = [];
let defaults;
let config;
let bidderConfig;
Function newStorageManager
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
export function newStorageManager({moduleName, moduleType} = {}, {isAllowed = isActivityAllowed} = {}) {
function isValid(cb, storageType) {
let mod = moduleName;
const curBidder = config.getCurrentBidder();
if (curBidder && moduleType === MODULE_TYPE_BIDDER && adapterManager.aliasRegistry[curBidder] === moduleName) {
- 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 VideojsProvider
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
export function VideojsProvider(providerConfig, vjs_, adState_, timeState_, callbackStorage_, utils) {
let vjs = vjs_;
// Supplied callbacks are typically wrapped by handlers
// we use this dict to keep track of these pairings
const callbackToHandler = {};
- 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 track
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
track({ eventType, args }) {
if (typeof args !== 'undefined') {
switch (eventType) {
case EVENTS.AUCTION_INIT:
logInfo(localStoragePrefix + 'AUCTION_INIT:', JSON.stringify(args));
- 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
File index.js
has 715 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* This module adds User ID support to prebid.js
* @module modules/userId
*/
File mgidBidAdapter.js
has 710 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
_each,
deepAccess,
isPlainObject,
isArray,
File criteoBidAdapter.js
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { deepAccess, generateUUID, isArray, logError, logInfo, logWarn, parseUrl } from '../src/utils.js';
import { loadExternalScript } from '../src/adloader.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
File jwplayerVideoProvider.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
PROTOCOLS, API_FRAMEWORKS, VIDEO_MIME_TYPE, PLAYBACK_METHODS, PLACEMENT, VPAID_MIME_TYPE, AD_POSITION
} from '../libraries/video/constants/ortb.js';
import {
SETUP_COMPLETE, SETUP_FAILED, DESTROYED, AD_REQUEST, AD_BREAK_START, AD_LOADED, AD_STARTED, AD_IMPRESSION, AD_PLAY,
File uid2IdSystem_shared.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable no-console */
import { ajax } from '../src/ajax.js';
import { cyrb53Hash } from '../src/utils.js';
export const Uid2CodeVersion = '1.1';
Function buildRequests
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
buildRequests: function(bidRequests, bidderRequest) {
// TODO: does the fallback make sense here?
const referer = bidderRequest.refererInfo.page || bidderRequest.refererInfo.topmostLocation;
const isPageSecure = !!referer.match(/^https:/);
- 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
File utils.js
has 687 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {config} from './config.js';
import clone from 'just-clone';
import {includes} from './polyfill.js';
import { EVENTS, S2S } from './constants.js';
import {GreedyPromise} from './utils/promise.js';
Function RhythmOneBidAdapter
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
function RhythmOneBidAdapter() {
this.code = 'rhythmone';
this.supportedMediaTypes = [VIDEO, BANNER];
this.gvlid = 36;
- 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
File auction.js
has 681 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Module for auction instances.
*
* In Prebid 0.x, $$PREBID_GLOBAL$$ had _bidsRequested and _bidsReceived as public properties.
* Starting 1.0, Prebid will support concurrent auctions. Each auction instance will store private properties, bidsRequested and bidsReceived.
File invibesBidAdapter.js
has 676 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {logInfo} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {getStorageManager} from '../src/storageManager.js';
/**
File newspassidBidAdapter.js
has 675 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
logInfo,
logError,
deepAccess,
logWarn,
Function getSyncData
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
function getSyncData(xml, options) {
let ret = [];
if (xml) {
let ext = xml.getElementsByTagName('Extensions');
if (ext && ext.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"