File tripleliftBidAdapter.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from '../src/utils.js';
import { logMessage, logError, isEmpty, logWarn } from '../src/utils.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';
Function _buildResponseObject
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function _buildResponseObject(bidderRequest, bid) {
let bidResponse = {};
let width = bid.width || 1;
let height = bid.height || 1;
let dealId = bid.deal_id || '';
- 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 _buildResponseObject
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _buildResponseObject(bidderRequest, bid) {
let bidResponse = {};
let width = bid.width || 1;
let height = bid.height || 1;
let dealId = bid.deal_id || '';
Function buildRequests
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
buildRequests: function(bidRequests, bidderRequest) {
let tlCall = STR_ENDPOINT;
let data = _buildPostBody(bidRequests, bidderRequest);
tlCall = tryAppendQueryString(tlCall, 'lib', 'prebid');
- 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 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildRequests: function(bidRequests, bidderRequest) {
let tlCall = STR_ENDPOINT;
let data = _buildPostBody(bidRequests, bidderRequest);
tlCall = tryAppendQueryString(tlCall, 'lib', 'prebid');
Function _buildPostBody
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _buildPostBody(bidRequests, bidderRequest) {
let data = {};
let { schain } = bidRequests[0];
const globalFpd = _getGlobalFpd(bidderRequest);
Function _buildPostBody
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function _buildPostBody(bidRequests, bidderRequest) {
let data = {};
let { schain } = bidRequests[0];
const globalFpd = _getGlobalFpd(bidderRequest);
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy, gppConsent) {
let syncType = _getSyncType(syncOptions);
if (!syncType) return;
let syncEndpoint = 'https://eb2.3lift.com/sync?';
- 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 _getGlobalFpd
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _getGlobalFpd(bidderRequest) {
const fpd = {};
const context = {}
const user = {};
const ortbData = bidderRequest.ortb2 || {};
Function getUserSyncs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy, gppConsent) {
let syncType = _getSyncType(syncOptions);
if (!syncType) return;
let syncEndpoint = 'https://eb2.3lift.com/sync?';
Function _getFloor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function _getFloor (bid) {
let floor = null;
if (typeof bid.getFloor === 'function') {
try {
const floorInfo = bid.getFloor({
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy, gppConsent) {
Function _getGlobalFpd
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function _getGlobalFpd(bidderRequest) {
const fpd = {};
const context = {}
const user = {};
const ortbData = bidderRequest.ortb2 || {};
- 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"