prebid/Prebid.js

View on GitHub
modules/adtrueBidAdapter.js

Summary

Maintainability
F
2 wks
Test Coverage

File adtrueBidAdapter.js has 580 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { logWarn, isArray, inIframe, isNumber, isStr, deepClone, deepSetValue, logError, deepAccess, isBoolean } from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import {getStorageManager} from '../src/storageManager.js';
Severity: Major
Found in modules/adtrueBidAdapter.js - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

        if (adm && adm.native && adm.native.assets && adm.native.assets.length > 0) {
          newBid.mediaType = NATIVE;
          for (let i = 0, len = adm.native.assets.length; i < len; i++) {
            switch (adm.native.assets[i].id) {
              case NATIVE_ASSETS.TITLE.ID:
    Severity: Critical
    Found in modules/adtrueBidAdapter.js - About 4 hrs to fix

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

      function _createImpressionObject(bid, conf) {
        var impObj = {};
        var bannerObj;
        var videoObj;
        var sizes = bid.hasOwnProperty('sizes') ? bid.sizes : [];
      Severity: Minor
      Found in modules/adtrueBidAdapter.js - About 3 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 buildRequests has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        buildRequests: function (validBidRequests, bidderRequest) {
          // convert Native ORTB definition to old-style prebid native definition
          validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
      
          let refererInfo;
      Severity: Major
      Found in modules/adtrueBidAdapter.js - About 2 hrs to fix

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

        function _parseNativeResponse(bid, newBid) {
          newBid.native = {};
          if (bid.hasOwnProperty('adm')) {
            var adm = '';
            try {
        Severity: Minor
        Found in modules/adtrueBidAdapter.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 interpretResponse has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          interpretResponse: function (serverResponses, bidderRequest) {
            const bidResponses = [];
            var respCur = ADTRUE_CURRENCY;
            let parsedRequest = JSON.parse(bidderRequest.data);
            let parsedReferrer = parsedRequest.site && parsedRequest.site.ref ? parsedRequest.site.ref : '';
        Severity: Major
        Found in modules/adtrueBidAdapter.js - About 2 hrs to fix

          Function _parseNativeResponse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _parseNativeResponse(bid, newBid) {
            newBid.native = {};
            if (bid.hasOwnProperty('adm')) {
              var adm = '';
              try {
          Severity: Major
          Found in modules/adtrueBidAdapter.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/adtrueBidAdapter.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 getUserSyncs has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
                if (!responses || responses.length === 0 || (!syncOptions.iframeEnabled && !syncOptions.pixelEnabled)) {
                  return [];
                }
                return responses.reduce((accum, rsp) => {
            Severity: Minor
            Found in modules/adtrueBidAdapter.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 _createImpressionObject has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function _createImpressionObject(bid, conf) {
              var impObj = {};
              var bannerObj;
              var videoObj;
              var sizes = bid.hasOwnProperty('sizes') ? bid.sizes : [];
            Severity: Major
            Found in modules/adtrueBidAdapter.js - About 2 hrs to fix

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

              function _createVideoRequest(bid) {
                var videoData = bid.params.video;
                var videoObj;
              
                if (videoData !== UNDEFINED) {
              Severity: Minor
              Found in modules/adtrueBidAdapter.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

              Consider simplifying this complex logical expression.
              Open

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

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

                  buildRequests: function (validBidRequests, bidderRequest) {
                    // convert Native ORTB definition to old-style prebid native definition
                    validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
                
                    let refererInfo;
                Severity: Minor
                Found in modules/adtrueBidAdapter.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 _createOrtbTemplate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function _createOrtbTemplate(conf) {
                  var guid;
                  if (storage.getDataFromLocalStorage('adtrue_user_id') == null) {
                    storage.setDataInLocalStorage('adtrue_user_id', _generateGUID())
                  }
                Severity: Minor
                Found in modules/adtrueBidAdapter.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/adtrueBidAdapter.js - About 1 hr to fix

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

                      isBidRequestValid: function (bid) {
                        if (bid && bid.params) {
                          if (!bid.params.zoneId) {
                            logWarn(LOG_WARN_PREFIX + 'Error: missing zoneId');
                            return false;
                    Severity: Minor
                    Found in modules/adtrueBidAdapter.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 _createVideoRequest has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function _createVideoRequest(bid) {
                      var videoData = bid.params.video;
                      var videoObj;
                    
                      if (videoData !== UNDEFINED) {
                    Severity: Minor
                    Found in modules/adtrueBidAdapter.js - About 1 hr to fix

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

                      function _parseAdSlot(bid) {
                        bid.params.width = 0;
                        bid.params.height = 0;
                        // check if size is mentioned in sizes array. in that case do not check for @ in adslot
                        if (bid.hasOwnProperty('mediaTypes') &&
                      Severity: Minor
                      Found in modules/adtrueBidAdapter.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

                      Avoid too many return statements within this function.
                      Open

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

                        Avoid too many return statements within this function.
                        Open

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

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

                          function _checkMediaType(adm, newBid) {
                            var admStr = '';
                            var videoRegex = new RegExp(/VAST\s+version/);
                            newBid.mediaType = BANNER;
                            if (videoRegex.test(adm)) {
                          Severity: Minor
                          Found in modules/adtrueBidAdapter.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/adtrueBidAdapter.js and 1 other location - About 2 days to fix
                          modules/pubmaticBidAdapter.js on lines 520..559

                          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

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

                          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

                          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/adtrueBidAdapter.js and 1 other location - About 7 hrs to fix
                          modules/pubmaticBidAdapter.js on lines 682..731

                          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

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

                                    case NATIVE_ASSETS.IMAGE.ID:
                                      newBid.native.image = {
                                        url: adm.native.assets[i].img && adm.native.assets[i].img.url,
                                        height: adm.native.assets[i].img && adm.native.assets[i].img.h,
                                        width: adm.native.assets[i].img && adm.native.assets[i].img.w,
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 3 other locations - About 6 hrs to fix
                          modules/adtrueBidAdapter.js on lines 238..244
                          modules/mgidBidAdapter.js on lines 699..705
                          modules/mgidBidAdapter.js on lines 706..712

                          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 164.

                          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

                                    case NATIVE_ASSETS.ICON.ID:
                                      newBid.native.icon = {
                                        url: adm.native.assets[i].img && adm.native.assets[i].img.url,
                                        height: adm.native.assets[i].img && adm.native.assets[i].img.h,
                                        width: adm.native.assets[i].img && adm.native.assets[i].img.w,
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 3 other locations - About 6 hrs to fix
                          modules/adtrueBidAdapter.js on lines 231..237
                          modules/mgidBidAdapter.js on lines 699..705
                          modules/mgidBidAdapter.js on lines 706..712

                          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 164.

                          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/adtrueBidAdapter.js and 1 other location - About 4 hrs to fix
                          modules/pubmaticBidAdapter.js on lines 310..332

                          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

                          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/adtrueBidAdapter.js and 1 other location - About 4 hrs to fix
                          modules/tappxBidAdapter.js on lines 31..46

                          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

                          function _generateGUID() {
                            var d = new Date().getTime();
                            var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
                              var r = (d + Math.random() * 16) % 16 | 0;
                              d = Math.floor(d / 16);
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 1 other location - About 4 hrs to fix
                          modules/intentIqIdSystem.js on lines 34..42

                          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 124.

                          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 (videoRegex.test(adm)) {
                              newBid.mediaType = VIDEO;
                            } else {
                              try {
                                admStr = JSON.parse(adm.replace(/\\/g, ''));
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 1 other location - About 2 hrs to fix
                          modules/pubmaticBidAdapter.js on lines 858..869

                          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/adtrueBidAdapter.js and 1 other location - About 2 hrs to fix
                          modules/pubmaticBidAdapter.js on lines 1132..1136

                          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

                                    case NATIVE_ASSETS.TITLE.ID:
                                      newBid.native.title = adm.native.assets[i].title && adm.native.assets[i].title.text;
                                      break;
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 1 other location - About 1 hr to fix
                          modules/mgidBidAdapter.js on lines 696..698

                          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/adtrueBidAdapter.js and 4 other locations - About 1 hr to fix
                          modules/distroscaleBidAdapter.js on lines 205..208
                          modules/pubmaticBidAdapter.js on lines 1218..1221
                          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

                          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/adtrueBidAdapter.js and 1 other location - About 1 hr to fix
                          modules/pubmaticBidAdapter.js on lines 229..235

                          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 5 locations. Consider refactoring.
                          Open

                                      if (bid.ext && bid.ext.dspid) {
                                        newBid.meta.networkId = bid.ext.dspid;
                                      }
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 4 other locations - About 35 mins to fix
                          modules/adtrueBidAdapter.js on lines 588..590
                          modules/gridBidAdapter.js on lines 557..559
                          modules/pubwiseBidAdapter.js on lines 355..357
                          modules/pubwiseBidAdapter.js on lines 358..360

                          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 4 locations. Consider refactoring.
                          Open

                                      if (bid.adomain && bid.adomain.length > 0) {
                                        newBid.meta.advertiserDomains = bid.adomain;
                                        newBid.meta.clickUrl = bid.adomain[0];
                                      }
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 3 other locations - About 35 mins to fix
                          modules/operaadsBidAdapter.js on lines 339..342
                          modules/pubmaticBidAdapter.js on lines 1027..1030
                          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 5 locations. Consider refactoring.
                          Open

                                      if (bid.ext && bid.ext.advid) {
                                        newBid.meta.buyerId = bid.ext.advid;
                                      }
                          Severity: Major
                          Found in modules/adtrueBidAdapter.js and 4 other locations - About 35 mins to fix
                          modules/adtrueBidAdapter.js on lines 585..587
                          modules/gridBidAdapter.js on lines 557..559
                          modules/pubwiseBidAdapter.js on lines 355..357
                          modules/pubwiseBidAdapter.js on lines 358..360

                          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 2 locations. Consider refactoring.
                          Open

                              if (!responses || responses.length === 0 || (!syncOptions.iframeEnabled && !syncOptions.pixelEnabled)) {
                                return [];
                              }
                          Severity: Minor
                          Found in modules/adtrueBidAdapter.js and 1 other location - About 30 mins to fix
                          modules/adkernelBidAdapter.js on lines 216..218

                          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