prebid/Prebid.js

View on GitHub
modules/pubmaticBidAdapter.js

Summary

Maintainability
F
3 wks
Test Coverage

File pubmaticBidAdapter.js has 1194 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { getBidRequest, logWarn, isBoolean, isStr, isArray, inIframe, mergeDeep, deepAccess, isNumber, deepSetValue, logInfo, logError, deepClone, uniques, isPlainObject, isInteger, generateUUID } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO, NATIVE, ADPOD } from '../src/mediaTypes.js';
import { config } from '../src/config.js';
import { Renderer } from '../src/Renderer.js';
Severity: Major
Found in modules/pubmaticBidAdapter.js - About 3 days to fix

    Function toOrtbNativeRequest has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
    Open

    export function toOrtbNativeRequest(legacyNativeAssets) {
      if (!legacyNativeAssets && !isPlainObject(legacyNativeAssets)) {
        logWarn(`${LOG_WARN_PREFIX}: Native assets object is empty or not an object: ${legacyNativeAssets}`);
        isInvalidNativeRequest = true;
        return;
    Severity: Minor
    Found in modules/pubmaticBidAdapter.js - About 1 day to fix

    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 55 (exceeds 5 allowed). Consider refactoring.
    Open

      buildRequests: (validBidRequests, bidderRequest) => {
        // convert Native ORTB definition to old-style prebid native definition
        // validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
        var refererInfo;
        if (bidderRequest && bidderRequest.refererInfo) {
    Severity: Minor
    Found in modules/pubmaticBidAdapter.js - About 1 day to fix

    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 173 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      buildRequests: (validBidRequests, bidderRequest) => {
        // convert Native ORTB definition to old-style prebid native definition
        // validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
        var refererInfo;
        if (bidderRequest && bidderRequest.refererInfo) {
    Severity: Major
    Found in modules/pubmaticBidAdapter.js - About 6 hrs to fix

      Function _createImpressionObject has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

      function _createImpressionObject(bid, bidderRequest) {
        var impObj = {};
        var bannerObj;
        var videoObj;
        var nativeObj = {};
      Severity: Minor
      Found in modules/pubmaticBidAdapter.js - About 4 hrs to fix

      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 toOrtbNativeRequest has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function toOrtbNativeRequest(legacyNativeAssets) {
        if (!legacyNativeAssets && !isPlainObject(legacyNativeAssets)) {
          logWarn(`${LOG_WARN_PREFIX}: Native assets object is empty or not an object: ${legacyNativeAssets}`);
          isInvalidNativeRequest = true;
          return;
      Severity: Major
      Found in modules/pubmaticBidAdapter.js - About 3 hrs to fix

        Function interpretResponse has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          interpretResponse: (response, request) => {
            const bidResponses = [];
            var respCur = DEFAULT_CURRENCY;
            let parsedRequest = JSON.parse(request.data);
            let parsedReferrer = parsedRequest.site && parsedRequest.site.ref ? parsedRequest.site.ref : '';
        Severity: Major
        Found in modules/pubmaticBidAdapter.js - About 3 hrs to fix

          Function _createImpressionObject has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _createImpressionObject(bid, bidderRequest) {
            var impObj = {};
            var bannerObj;
            var videoObj;
            var nativeObj = {};
          Severity: Major
          Found in modules/pubmaticBidAdapter.js - About 2 hrs to fix

            Function isBidRequestValid has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

              isBidRequestValid: bid => {
                if (bid && bid.params) {
                  if (!isStr(bid.params.publisherId)) {
                    logWarn(LOG_WARN_PREFIX + 'Error: publisherId is mandatory and cannot be numeric (wrap it in quotes in your config). Call to OpenBid will not be sent for ad unit: ' + JSON.stringify(bid));
                    return false;
            Severity: Minor
            Found in modules/pubmaticBidAdapter.js - About 2 hrs to fix

            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

            Consider simplifying this complex logical expression.
            Open

                  if (response.body && response.body.seatbid && isArray(response.body.seatbid)) {
                    // Supporting multiple bid responses for same adSize
                    respCur = response.body.cur || respCur;
                    response.body.seatbid.forEach(seatbidder => {
                      seatbidder.bid &&
            Severity: Critical
            Found in modules/pubmaticBidAdapter.js - About 2 hrs to fix

              Function _createBannerRequest has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

              function _createBannerRequest(bid) {
                var sizes = bid.mediaTypes.banner.sizes;
                var format = [];
                var bannerObj;
                if (sizes !== UNDEFINED && isArray(sizes)) {
              Severity: Minor
              Found in modules/pubmaticBidAdapter.js - About 2 hrs to fix

              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 _handleCustomParams has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              function _handleCustomParams(params, conf) {
                if (!conf.kadpageurl) {
                  conf.kadpageurl = conf.pageURL;
                }
              
              
              Severity: Minor
              Found in modules/pubmaticBidAdapter.js - About 2 hrs to fix

              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

              Consider simplifying this complex logical expression.
              Open

                  } else if (key === 'icon' || key === 'image') {
                    ortbAsset.img = {
                      type: key === 'icon' ? NATIVE_IMAGE_TYPES.ICON : NATIVE_IMAGE_TYPES.MAIN,
                    }
                    // if min_width and min_height are defined in aspect_ratio, they are preferred
              Severity: Critical
              Found in modules/pubmaticBidAdapter.js - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                        if (assetObj.img.type == NATIVE_ASSET_IMAGE_TYPE.IMAGE) {
                          assetObj.w = assetObj.w || assetObj.width || (assetObj.sizes ? assetObj.sizes[0] : UNDEFINED);
                          assetObj.h = assetObj.h || assetObj.height || (assetObj.sizes ? assetObj.sizes[1] : UNDEFINED);
                          assetObj.wmin = assetObj.wmin || assetObj.minimumWidth || (assetObj.minsizes ? assetObj.minsizes[0] : UNDEFINED);
                          assetObj.hmin = assetObj.hmin || assetObj.minimumHeight || (assetObj.minsizes ? assetObj.minsizes[1] : UNDEFINED);
                Severity: Critical
                Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                  Function _parseAdSlot has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _parseAdSlot(bid) {
                    bid.params.adUnit = '';
                    bid.params.adUnitIndex = '0';
                    bid.params.width = 0;
                    bid.params.height = 0;
                  Severity: Minor
                  Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                  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 _addFloorFromFloorModule has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function _addFloorFromFloorModule(impObj, bid) {
                    let bidFloor = -1;
                    // get lowest floor from floorModule
                    if (typeof bid.getFloor === 'function' && !config.getConfig('pubmatic.disableFloors')) {
                      [BANNER, VIDEO, NATIVE].forEach(mediaType => {
                  Severity: Minor
                  Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                    Function _parseAdSlot has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function _parseAdSlot(bid) {
                      bid.params.adUnit = '';
                      bid.params.adUnitIndex = '0';
                      bid.params.width = 0;
                      bid.params.height = 0;
                    Severity: Minor
                    Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                      Function _createBannerRequest has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function _createBannerRequest(bid) {
                        var sizes = bid.mediaTypes.banner.sizes;
                        var format = [];
                        var bannerObj;
                        if (sizes !== UNDEFINED && isArray(sizes)) {
                      Severity: Minor
                      Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                        Function _assignRenderer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function _assignRenderer(newBid, request) {
                          let bidParams, context, adUnitCode;
                          if (request.bidderRequest && request.bidderRequest.bids) {
                            for (let bidderRequestBidsIndex = 0; bidderRequestBidsIndex < request.bidderRequest.bids.length; bidderRequestBidsIndex++) {
                              if (request.bidderRequest.bids[bidderRequestBidsIndex].bidId === newBid.requestId) {
                        Severity: Minor
                        Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                        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 _checkMediaType has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function _checkMediaType(bid, newBid) {
                          // Create a regex here to check the strings
                          if (bid.ext && bid.ext['bidtype'] != undefined) {
                            newBid.mediaType = MEDIATYPE[bid.ext.bidtype];
                          } else {
                        Severity: Minor
                        Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                        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 _createNativeRequest has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function _createNativeRequest(params) {
                          var nativeRequestObject;
                        
                          // TODO delete this code when removing native 1.1 support
                          if (!params.ortb) { // legacy assets definition found
                        Severity: Minor
                        Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                          Function isBidRequestValid has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            isBidRequestValid: bid => {
                              if (bid && bid.params) {
                                if (!isStr(bid.params.publisherId)) {
                                  logWarn(LOG_WARN_PREFIX + 'Error: publisherId is mandatory and cannot be numeric (wrap it in quotes in your config). Call to OpenBid will not be sent for ad unit: ' + JSON.stringify(bid));
                                  return false;
                          Severity: Minor
                          Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                            Function _createVideoRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function _createVideoRequest(bid) {
                              var videoData = mergeDeep(deepAccess(bid.mediaTypes, 'video'), bid.params.video);
                              var videoObj;
                            
                              if (FEATURES.VIDEO && videoData !== UNDEFINED) {
                            Severity: Minor
                            Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                            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 prepareMetaObject has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function prepareMetaObject(br, bid, seat) {
                              br.meta = {};
                            
                              if (bid.ext && bid.ext.dspid) {
                                br.meta.networkId = bid.ext.dspid;
                            Severity: Minor
                            Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                              Function getUserSyncs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                getUserSyncs: (syncOptions, responses, gdprConsent, uspConsent, gppConsent) => {
                                  let syncurl = '' + publisherId;
                              
                                  // Attaching GDPR Consent Params in UserSync url
                                  if (gdprConsent) {
                              Severity: Minor
                              Found in modules/pubmaticBidAdapter.js - About 1 hr to fix

                                Function getUserSyncs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  getUserSyncs: (syncOptions, responses, gdprConsent, uspConsent, gppConsent) => {
                                    let syncurl = '' + publisherId;
                                
                                    // Attaching GDPR Consent Params in UserSync url
                                    if (gdprConsent) {
                                Severity: Minor
                                Found in modules/pubmaticBidAdapter.js - About 55 mins to fix

                                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 prepareMetaObject has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function prepareMetaObject(br, bid, seat) {
                                  br.meta = {};
                                
                                  if (bid.ext && bid.ext.dspid) {
                                    br.meta.networkId = bid.ext.dspid;
                                Severity: Minor
                                Found in modules/pubmaticBidAdapter.js - About 55 mins to fix

                                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 bootstrapPlayer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  bootstrapPlayer: function(bid) {
                                    const config = {
                                      code: bid.adUnitCode,
                                    };
                                
                                
                                Severity: Minor
                                Found in modules/pubmaticBidAdapter.js - About 45 mins to fix

                                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 (!isArray(asset.aspect_ratios)) {
                                          logWarn(`${LOG_WARN_PREFIX}: image.aspect_ratios was passed, but it's not a an array: ${asset.aspect_ratios}`);
                                        } else if (!asset.aspect_ratios.length) {
                                          logWarn(`${LOG_WARN_PREFIX}: image.aspect_ratios was passed, but it's empty: ${asset.aspect_ratios}`);
                                        } else {
                                Severity: Major
                                Found in modules/pubmaticBidAdapter.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                          if (asset.sizes.length !== 2 || !isInteger(asset.sizes[0]) || !isInteger(asset.sizes[1])) {
                                            logWarn(`${LOG_WARN_PREFIX}: image.sizes was passed, but its value is not an array of integers: ${asset.sizes}`);
                                          } else {
                                            logInfo(`${LOG_WARN_PREFIX}: if asset.sizes exist, by OpenRTB spec we should remove wmin and hmin`);
                                            ortbAsset.img.w = asset.sizes[0];
                                  Severity: Major
                                  Found in modules/pubmaticBidAdapter.js - About 45 mins to fix

                                    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, ''));
                                    Severity: Minor
                                    Found in modules/pubmaticBidAdapter.js - About 35 mins to fix

                                    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;
                                    Severity: Minor
                                    Found in modules/pubmaticBidAdapter.js - About 35 mins to fix

                                    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;
                                    Severity: Minor
                                    Found in modules/pubmaticBidAdapter.js - About 35 mins to fix

                                    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 too many return statements within this function.
                                    Open

                                                return false;
                                    Severity: Major
                                    Found in modules/pubmaticBidAdapter.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return true;
                                      Severity: Major
                                      Found in modules/pubmaticBidAdapter.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            return false;
                                        Severity: Major
                                        Found in modules/pubmaticBidAdapter.js - About 30 mins to fix

                                          Function interpretResponse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                            interpretResponse: (response, request) => {
                                              const bidResponses = [];
                                              var respCur = DEFAULT_CURRENCY;
                                              let parsedRequest = JSON.parse(request.data);
                                              let parsedReferrer = parsedRequest.site && parsedRequest.site.ref ? parsedRequest.site.ref : '';
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js - About 25 mins to fix

                                          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

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                          function _createBannerRequest(bid) {
                                            var sizes = bid.mediaTypes.banner.sizes;
                                            var format = [];
                                            var bannerObj;
                                            if (sizes !== UNDEFINED && isArray(sizes)) {
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 2 days to fix
                                          modules/adtrueBidAdapter.js on lines 275..314

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 454.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            } else if (bid.hasOwnProperty('mediaTypes') &&
                                                   bid.mediaTypes.hasOwnProperty(BANNER) &&
                                                    bid.mediaTypes.banner.hasOwnProperty('sizes')) {
                                              var i = 0;
                                              var sizeArray = [];
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 1 day to fix
                                          modules/adtrueBidAdapter.js on lines 114..132

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 289.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            if (FEATURES.VIDEO && videoData !== UNDEFINED) {
                                              videoObj = {};
                                              checkVideoPlacement(videoData, bid.adUnitCode);
                                              for (var key in VIDEO_CUSTOM_PARAMS) {
                                                if (videoData.hasOwnProperty(key)) {
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 1 day to fix
                                          modules/pubwiseBidAdapter.js on lines 894..913

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 272.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            if (bid.hasOwnProperty('mediaTypes')) {
                                              for (mediaTypes in bid.mediaTypes) {
                                                switch (mediaTypes) {
                                                  case BANNER:
                                                    bannerObj = _createBannerRequest(bid);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 7 hrs to fix
                                          modules/adtrueBidAdapter.js on lines 382..419

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 176.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                          Open

                                          const VIDEO_CUSTOM_PARAMS = {
                                            'mimes': DATA_TYPES.ARRAY,
                                            'minduration': DATA_TYPES.NUMBER,
                                            'maxduration': DATA_TYPES.NUMBER,
                                            'startdelay': DATA_TYPES.NUMBER,
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 2 other locations - About 5 hrs to fix
                                          modules/zeta_global_sspBidAdapter.js on lines 32..49
                                          modules/zmaticooBidAdapter.js on lines 22..39

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 152.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                          function _checkParamDataType(key, value, datatype) {
                                            var errMsg = 'Ignoring param key: ' + key + ', expects ' + datatype + ', found ' + typeof value;
                                            var functionToExecute;
                                            switch (datatype) {
                                              case DATA_TYPES.BOOLEAN:
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 4 hrs to fix
                                          modules/adtrueBidAdapter.js on lines 190..212

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 134.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              if (bidderRequest?.gppConsent?.gppString) {
                                                deepSetValue(payload, 'regs.gpp', bidderRequest.gppConsent.gppString);
                                                deepSetValue(payload, 'regs.gpp_sid', bidderRequest.gppConsent.applicableSections);
                                              } else if (bidderRequest?.ortb2?.regs?.gpp) {
                                                deepSetValue(payload, 'regs.gpp', bidderRequest.ortb2.regs.gpp);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 4 hrs to fix
                                          modules/deepintentBidAdapter.js on lines 102..108

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 115.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              device: {
                                                ua: navigator.userAgent,
                                                js: 1,
                                                dnt: (navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0,
                                                h: screen.height,
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 3 hrs to fix
                                          modules/pubwiseBidAdapter.js on lines 509..517

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 98.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              } else if (FEATURES.VIDEO && videoRegex.test(adm)) {
                                                newBid.mediaType = VIDEO;
                                              } else {
                                                try {
                                                  admStr = JSON.parse(adm.replace(/\\/g, ''));
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 2 hrs to fix
                                          modules/adtrueBidAdapter.js on lines 351..362

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 83.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                if (fledgeAuctionConfigs) {
                                                  fledgeAuctionConfigs = Object.entries(fledgeAuctionConfigs).map(([bidId, cfg]) => {
                                                    return {
                                                      bidId,
                                                      config: Object.assign({
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 2 hrs to fix
                                          modules/sovrnBidAdapter.js on lines 280..293

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 83.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            blockedIabCategories = blockedIabCategories
                                              .filter(function(category) {
                                                if (typeof category === 'string') { // only strings
                                                  return true;
                                                } else {
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 2 hrs to fix
                                          modules/pubmaticBidAdapter.js on lines 920..930

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 83.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            allowedIabCategories = allowedIabCategories
                                              .filter(function(category) {
                                                if (typeof category === 'string') { // returns only strings
                                                  return true;
                                                } else {
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 2 hrs to fix
                                          modules/pubmaticBidAdapter.js on lines 896..912

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 83.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                if (bidCurrency === '') {
                                                  bidCurrency = bid.params.currency || UNDEFINED;
                                                } else if (bid.params.hasOwnProperty('currency') && bidCurrency !== bid.params.currency) {
                                                  logWarn(LOG_WARN_PREFIX + 'Currency specifier ignored. Only one currency permitted.');
                                                }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 2 hrs to fix
                                          modules/adtrueBidAdapter.js on lines 473..477

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 77.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                    const aspectRatios = asset.aspect_ratios
                                                      .filter((ar) => ar.ratio_width && ar.ratio_height)
                                                      .map(ratio => `${ratio.ratio_width}:${ratio.ratio_height}`);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 1 hr to fix
                                          src/native.js on lines 545..547

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 68.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 5 locations. Consider refactoring.
                                          Open

                                              if (bidderRequest && bidderRequest.gdprConsent) {
                                                deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
                                                deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0));
                                              }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 4 other locations - About 1 hr to fix
                                          modules/adtrueBidAdapter.js on lines 520..523
                                          modules/distroscaleBidAdapter.js on lines 205..208
                                          modules/pubwiseBidAdapter.js on lines 261..264
                                          modules/zeta_global_sspBidAdapter.js on lines 161..164

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 59.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                          Open

                                                if (bid.params.hasOwnProperty('acat') && isArray(bid.params.acat)) {
                                                  allowedIabCategories = allowedIabCategories.concat(bid.params.acat);
                                                }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 2 other locations - About 1 hr to fix
                                          modules/pubmaticBidAdapter.js on lines 1142..1144
                                          modules/pubwiseBidAdapter.js on lines 208..210

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 58.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                          Open

                                                if (bid.params.hasOwnProperty('bcat') && isArray(bid.params.bcat)) {
                                                  blockedIabCategories = blockedIabCategories.concat(bid.params.bcat);
                                                }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 2 other locations - About 1 hr to fix
                                          modules/pubmaticBidAdapter.js on lines 1145..1147
                                          modules/pubwiseBidAdapter.js on lines 208..210

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 58.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                          function _initConf(refererInfo) {
                                            return {
                                              // TODO: do the fallbacks make sense here?
                                              pageURL: refererInfo?.page || window.location.href,
                                              refURL: refererInfo?.ref || window.document.referrer
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 1 hr to fix
                                          modules/adtrueBidAdapter.js on lines 135..141

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 57.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                          Open

                                              if (typeof config.getConfig('device') === 'object') {
                                                payload.device = Object.assign(payload.device, config.getConfig('device'));
                                              }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 2 other locations - About 1 hr to fix
                                          modules/distroscaleBidAdapter.js on lines 195..197
                                          modules/pubwiseBidAdapter.js on lines 248..250

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 57.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              if (syncOptions.iframeEnabled) {
                                                return [{
                                                  type: 'iframe',
                                                  url: USER_SYNC_URL_IFRAME + syncurl
                                                }];
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 1 hr to fix
                                          modules/zeta_global_sspBidAdapter.js on lines 260..270

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 55.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                          Open

                                              if (gdprConsent) {
                                                syncurl += '&gdpr=' + (gdprConsent.gdprApplies ? 1 : 0);
                                                syncurl += '&gdpr_consent=' + encodeURIComponent(gdprConsent.consentString || '');
                                              }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 2 other locations - About 1 hr to fix
                                          modules/adyoulikeBidAdapter.js on lines 200..203
                                          modules/zeta_global_sspBidAdapter.js on lines 245..248

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 55.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                    allowedBiddersList = allowedBiddersList.map(val => val.trim().toLowerCase()).filter(val => !!val).filter(uniques);
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 50 mins to fix
                                          src/adapters/bidderFactory.js on lines 342..342

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 51.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 7 locations. Consider refactoring.
                                          Open

                                            if (bid.ext && bid.ext.dspid) {
                                              br.meta.networkId = bid.ext.dspid;
                                              br.meta.demandSource = bid.ext.dspid;
                                            }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 6 other locations - About 45 mins to fix
                                          modules/dspxBidAdapter.js on lines 75..78
                                          modules/exadsBidAdapter.js on lines 131..134
                                          modules/nextMillenniumBidAdapter.js on lines 320..323
                                          modules/radsBidAdapter.js on lines 178..186
                                          modules/sharethroughBidAdapter.js on lines 87..93
                                          modules/trafficgateBidAdapter.js on lines 55..58

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 50.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                  if (asset.sizes.length !== 2 || !isInteger(asset.sizes[0]) || !isInteger(asset.sizes[1])) {
                                                    logWarn(`${LOG_WARN_PREFIX}: image.sizes was passed, but its value is not an array of integers: ${asset.sizes}`);
                                                  } else {
                                                    logInfo(`${LOG_WARN_PREFIX}: if asset.sizes exist, by OpenRTB spec we should remove wmin and hmin`);
                                                    ortbAsset.img.w = asset.sizes[0];
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 45 mins to fix
                                          src/native.js on lines 558..565

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 50.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                          Open

                                              if (typeof config.getConfig('content') === 'object') {
                                                payload.site.content = config.getConfig('content');
                                              }
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 2 other locations - About 40 mins to fix
                                          modules/distroscaleBidAdapter.js on lines 190..192
                                          modules/pubwiseBidAdapter.js on lines 243..245

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 48.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                ortbAsset.img.wmin = asset.wmin || asset.minimumWidth || (asset.minsizes ? asset.minsizes[0] : UNDEFINED);
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 40 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 434..434

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 48.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                                ortbAsset.img.hmin = asset.hmin || asset.minimumHeight || (asset.minsizes ? asset.minsizes[1] : UNDEFINED);
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 40 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 433..433

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 48.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                              if (bid.vastXml) config.vastXml = bid.vastXml;
                                              else if (bid.vastUrl) config.vastUrl = bid.vastUrl;
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 35 mins to fix
                                          modules/bluebillywigBidAdapter.js on lines 136..137

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 47.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                            let connection = window.navigator && (window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection);
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 35 mins to fix
                                          modules/gumgumBidAdapter.js on lines 44..44

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 47.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                          Open

                                            if (bid.cat && isNonEmptyArray(bid.cat)) {
                                              br.meta.secondaryCatIds = bid.cat;
                                              br.meta.primaryCatId = bid.cat[0];
                                            }
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 3 other locations - About 35 mins to fix
                                          modules/adtrueBidAdapter.js on lines 591..594
                                          modules/operaadsBidAdapter.js on lines 339..342
                                          modules/pubwiseBidAdapter.js on lines 361..364

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 46.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                          Open

                                                    assetObj.h = assetObj.h || assetObj.height || (assetObj.sizes ? assetObj.sizes[1] : UNDEFINED);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 5 other locations - About 30 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 501..501
                                          modules/pubmaticBidAdapter.js on lines 503..503
                                          modules/pubmaticBidAdapter.js on lines 504..504
                                          modules/pubmaticBidAdapter.js on lines 506..506
                                          modules/pubmaticBidAdapter.js on lines 507..507

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                          Open

                                                    assetObj.hmin = assetObj.hmin || assetObj.minimumHeight || (assetObj.minsizes ? assetObj.minsizes[1] : UNDEFINED);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 5 other locations - About 30 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 501..501
                                          modules/pubmaticBidAdapter.js on lines 502..502
                                          modules/pubmaticBidAdapter.js on lines 503..503
                                          modules/pubmaticBidAdapter.js on lines 506..506
                                          modules/pubmaticBidAdapter.js on lines 507..507

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                          Open

                                                    assetObj.w = assetObj.w || assetObj.width || (assetObj.sizes ? assetObj.sizes[0] : UNDEFINED);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 5 other locations - About 30 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 501..501
                                          modules/pubmaticBidAdapter.js on lines 502..502
                                          modules/pubmaticBidAdapter.js on lines 503..503
                                          modules/pubmaticBidAdapter.js on lines 504..504
                                          modules/pubmaticBidAdapter.js on lines 507..507

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                          Open

                                          export function _getDomainFromURL(url) {
                                            let anchor = document.createElement('a');
                                            anchor.href = url;
                                            return anchor.hostname;
                                          }
                                          Severity: Minor
                                          Found in modules/pubmaticBidAdapter.js and 1 other location - About 30 mins to fix
                                          modules/zmaticooBidAdapter.js on lines 296..300

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                          Open

                                                    assetObj.h = assetObj.h || assetObj.height || (assetObj.sizes ? assetObj.sizes[1] : UNDEFINED);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 5 other locations - About 30 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 501..501
                                          modules/pubmaticBidAdapter.js on lines 502..502
                                          modules/pubmaticBidAdapter.js on lines 503..503
                                          modules/pubmaticBidAdapter.js on lines 504..504
                                          modules/pubmaticBidAdapter.js on lines 506..506

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                          Open

                                                    assetObj.w = assetObj.w || assetObj.width || (assetObj.sizes ? assetObj.sizes[0] : UNDEFINED);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 5 other locations - About 30 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 502..502
                                          modules/pubmaticBidAdapter.js on lines 503..503
                                          modules/pubmaticBidAdapter.js on lines 504..504
                                          modules/pubmaticBidAdapter.js on lines 506..506
                                          modules/pubmaticBidAdapter.js on lines 507..507

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          Similar blocks of code found in 6 locations. Consider refactoring.
                                          Open

                                                    assetObj.wmin = assetObj.wmin || assetObj.minimumWidth || (assetObj.minsizes ? assetObj.minsizes[0] : UNDEFINED);
                                          Severity: Major
                                          Found in modules/pubmaticBidAdapter.js and 5 other locations - About 30 mins to fix
                                          modules/pubmaticBidAdapter.js on lines 501..501
                                          modules/pubmaticBidAdapter.js on lines 502..502
                                          modules/pubmaticBidAdapter.js on lines 504..504
                                          modules/pubmaticBidAdapter.js on lines 506..506
                                          modules/pubmaticBidAdapter.js on lines 507..507

                                          Duplicated Code

                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                          Tuning

                                          This issue has a mass of 45.

                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                          Refactorings

                                          Further Reading

                                          There are no issues that match your filters.

                                          Category
                                          Status