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"
Further reading
Function interpretResponse
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
function interpretResponse(serverResponse, bidRequest) {
let bidResponses = [];
if (serverResponse && serverResponse.body) {
if (serverResponse.error) {
return bidResponses;
- 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 50 (exceeds 5 allowed). Consider refactoring. Open
function buildRequests(validBidRequests, bidderRequest) {
let bidRequests = [];
for (let i = 0; i < validBidRequests.length; i++) {
let bidRequest = validBidRequests[i];
- 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 getCpmData
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function getCpmData(xml) {
let ret = {cpm: 0, currency: 'USD'};
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"
Further reading
File aniviewBidAdapter.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { VIDEO, BANNER } from '../src/mediaTypes.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { Renderer } from '../src/Renderer.js';
import { logError } from '../src/utils.js';
Function buildRequests
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildRequests(validBidRequests, bidderRequest) {
let bidRequests = [];
for (let i = 0; i < validBidRequests.length; i++) {
let bidRequest = validBidRequests[i];
Function interpretResponse
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function interpretResponse(serverResponse, bidRequest) {
let bidResponses = [];
if (serverResponse && serverResponse.body) {
if (serverResponse.error) {
return bidResponses;
Function getSyncData
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSyncData(xml, options) {
let ret = [];
if (xml) {
let ext = xml.getElementsByTagName('Extensions');
if (ext && ext.length > 0) {
Function getUserSyncs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getUserSyncs(syncOptions, serverResponses) {
if (serverResponses && serverResponses[0] && serverResponses[0].body) {
if (serverResponses.error) {
return [];
} else {
- 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 newRenderer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function newRenderer(bidRequest) {
let playerDomain = 'player.aniview.com';
const config = {};
if (bidRequest && bidRequest.bidRequest && bidRequest.bidRequest.params) {
- 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
Avoid deeply nested control flow statements. Open
if (ext[i].getAttribute('type') == 'ANIVIEW') {
let price = ext[i].getElementsByTagName('Cpm');
if (price && price.length == 1) {
ret.cpm = price[0].textContent;
}
Avoid deeply nested control flow statements. Open
if (cpmData.cpm > 0) {
bidResponse.requestId = bidRequest.data.bidId;
bidResponse.ad = '';
bidResponse.cpm = cpmData.cpm;
bidResponse.width = bidRequest.data.AV_WIDTH;
Avoid deeply nested control flow statements. Open
if (ext[i].getAttribute('type') == 'ANIVIEW') {
let syncs = ext[i].getElementsByTagName('AdServingSync');
if (syncs && syncs.length == 1) {
try {
let data = JSON.parse(syncs[0].textContent);