prebid/Prebid.js

View on GitHub
modules/pubwiseBidAdapter.js

Summary

Maintainability
F
2 wks
Test Coverage

Function _createNativeRequest has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
Open

function _createNativeRequest(params) {
  var nativeRequestObject = {
    assets: []
  };
  for (var key in params) {
Severity: Minor
Found in modules/pubwiseBidAdapter.js - About 2 days 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

File pubwiseBidAdapter.js has 836 lines of code (exceeds 250 allowed). Consider refactoring.
Open


import { _each, isBoolean, isEmptyStr, isNumber, isStr, deepClone, isArray, deepSetValue, inIframe, mergeDeep, deepAccess, logMessage, logInfo, logWarn, logError } 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';
Severity: Major
Found in modules/pubwiseBidAdapter.js - About 2 days to fix

    Function _createNativeRequest has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function _createNativeRequest(params) {
      var nativeRequestObject = {
        assets: []
      };
      for (var key in params) {
    Severity: Major
    Found in modules/pubwiseBidAdapter.js - About 4 hrs to fix

      Consider simplifying this complex logical expression.
      Open

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

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

        function _createImpressionObject(bid, conf) {
          var impObj = {};
          var bannerObj;
          var videoObj;
          var nativeObj = {};
        Severity: Minor
        Found in modules/pubwiseBidAdapter.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 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          buildRequests: function (validBidRequests, bidderRequest) {
            validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
            var refererInfo;
            if (bidderRequest && bidderRequest.refererInfo) {
              refererInfo = bidderRequest.refererInfo;
        Severity: Major
        Found in modules/pubwiseBidAdapter.js - About 2 hrs to fix

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

            interpretResponse: function (response, request) {
              const bidResponses = [];
              var respCur = DEFAULT_CURRENCY;
              _logInfo('interpretResponse request', request);
              let parsedRequest = request.data; // not currently stringified
          Severity: Major
          Found in modules/pubwiseBidAdapter.js - About 2 hrs to fix

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

            function _parseNativeResponse(bid, newBid) {
              newBid.native = {};
              if (bid.hasOwnProperty('adm')) {
                var adm = '';
                try {
            Severity: Minor
            Found in modules/pubwiseBidAdapter.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)) {
                  _logInfo('interpretResponse response body', response.body);
                  // Supporting multiple bid responses for same adSize
                  respCur = response.body.cur || respCur;
                  response.body.seatbid.forEach(seatbidder => {
            Severity: Critical
            Found in modules/pubwiseBidAdapter.js - About 2 hrs to fix

              Function _parseNativeResponse has 58 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/pubwiseBidAdapter.js - About 2 hrs to fix

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

                function _parseAdSlot(bid) {
                  _logInfo('parseAdSlot bid', bid);
                  if (bid.adUnitCode) {
                    bid.params.adUnit = bid.adUnitCode;
                  } else {
                Severity: Minor
                Found in modules/pubwiseBidAdapter.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 isBidRequestValid has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                  isBidRequestValid: function (bid) {
                    // siteId is required for any type
                    if (bid.params && bid.params.siteId) {
                      // it must be a string
                      if (!isStr(bid.params.siteId)) {
                Severity: Minor
                Found in modules/pubwiseBidAdapter.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 _createBannerRequest has a Cognitive Complexity of 16 (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/pubwiseBidAdapter.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 (params[key].sizes && params[key].sizes.length > 0) {
                              assetObj = {
                                id: NATIVE_ASSETS.IMAGE.ID,
                                required: params[key].required ? 1 : 0,
                                img: {
                Severity: Critical
                Found in modules/pubwiseBidAdapter.js - About 2 hrs to fix

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

                  function _handleCustomParams(params, conf) {
                    var key, value, entry;
                    for (key in CUSTOM_PARAMS) {
                      if (CUSTOM_PARAMS.hasOwnProperty(key)) {
                        value = params[key];
                  Severity: Minor
                  Found in modules/pubwiseBidAdapter.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 _createImpressionObject has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function _createImpressionObject(bid, conf) {
                    var impObj = {};
                    var bannerObj;
                    var videoObj;
                    var nativeObj = {};
                  Severity: Minor
                  Found in modules/pubwiseBidAdapter.js - About 1 hr to fix

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

                      buildRequests: function (validBidRequests, bidderRequest) {
                        validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
                        var refererInfo;
                        if (bidderRequest && bidderRequest.refererInfo) {
                          refererInfo = bidderRequest.refererInfo;
                    Severity: Minor
                    Found in modules/pubwiseBidAdapter.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 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function _checkMediaType(bid, newBid) {
                      // Check Various ADM Aspects to Determine Media Type
                      if (bid.ext && bid.ext['bidtype'] != undefined) {
                        // this is the most explicity check
                        newBid.mediaType = MEDIATYPE[bid.ext.bidtype];
                    Severity: Minor
                    Found in modules/pubwiseBidAdapter.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 _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/pubwiseBidAdapter.js - About 1 hr to fix

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

                      function _parseAdSlot(bid) {
                        _logInfo('parseAdSlot bid', bid);
                        if (bid.adUnitCode) {
                          bid.params.adUnit = bid.adUnitCode;
                        } else {
                      Severity: Minor
                      Found in modules/pubwiseBidAdapter.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 (videoData !== UNDEFINED) {
                        Severity: Minor
                        Found in modules/pubwiseBidAdapter.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 (!(nativeRequestObject.assets && nativeRequestObject.assets.length > 0 && nativeRequestObject.assets.hasOwnProperty(key))) {
                                switch (key) {
                                  case NATIVE_ASSETS.TITLE.KEY:
                                    if (params[key].len || params[key].length) {
                                      assetObj = {
                        Severity: Major
                        Found in modules/pubwiseBidAdapter.js - About 1 hr to fix

                          Avoid deeply nested control flow statements.
                          Open

                                      if (params[key].sizes && params[key].sizes.length > 0) {
                                        assetObj = {
                                          id: NATIVE_ASSETS.ICON.ID,
                                          required: params[key].required ? 1 : 0,
                                          img: {
                          Severity: Major
                          Found in modules/pubwiseBidAdapter.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                        if (params[key].sizes && params[key].sizes.length > 0) {
                                          assetObj = {
                                            id: NATIVE_ASSETS.IMAGE.ID,
                                            required: params[key].required ? 1 : 0,
                                            img: {
                            Severity: Major
                            Found in modules/pubwiseBidAdapter.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      switch (videoContext) {
                                                        case OUTSTREAM:
                                                          // not currently supported
                                                          break;
                                                        case INSTREAM:
                              Severity: Major
                              Found in modules/pubwiseBidAdapter.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                            if (params[key].len || params[key].length) {
                                              assetObj = {
                                                id: NATIVE_ASSETS.TITLE.ID,
                                                required: params[key].required ? 1 : 0,
                                                title: {
                                Severity: Major
                                Found in modules/pubwiseBidAdapter.js - About 45 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if (params[key].sizes && params[key].sizes.length > 0) {
                                                assetObj = {
                                                  id: NATIVE_ASSETS.ICON.ID,
                                                  required: params[key].required ? 1 : 0,
                                                  img: {
                                  Severity: Major
                                  Found in modules/pubwiseBidAdapter.js - About 40 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

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

                                      Avoid too many return statements within this function.
                                      Open

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

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

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

                                        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

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

                                                      assetObj = {
                                                        id: NATIVE_ASSETS.ICON.ID,
                                                        required: params[key].required ? 1 : 0,
                                                        img: {
                                                          type: NATIVE_ASSET_IMAGE_TYPE.ICON,
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 1 other location - About 6 hrs to fix
                                        modules/pubwiseBidAdapter.js on lines 763..771

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

                                        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

                                                    assetObj = {
                                                      id: NATIVE_ASSETS.LOGO.ID,
                                                      required: params[key].required ? 1 : 0,
                                                      img: {
                                                        type: NATIVE_ASSET_IMAGE_TYPE.LOGO,
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 1 other location - About 6 hrs to fix
                                        modules/pubwiseBidAdapter.js on lines 730..738

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

                                        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

                                            [BANNER, VIDEO, NATIVE].forEach(mediaType => {
                                              if (impObj.hasOwnProperty(mediaType)) {
                                                let floorInfo = bid.getFloor({ currency: impObj.bidFloorCur, mediaType: mediaType, size: '*' });
                                                if (typeof floorInfo === 'object' && floorInfo.currency === impObj.bidFloorCur && !isNaN(parseInt(floorInfo.floor))) {
                                                  let mediaTypeFloor = parseFloat(floorInfo.floor);
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 1 other location - About 5 hrs to fix
                                        modules/lemmaDigitalBidAdapter.js on lines 295..303

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

                                        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

                                                  case NATIVE_ASSETS.IMAGE.ID:
                                                    newBid.native.image = {
                                                      url: adm.assets[i].img && adm.assets[i].img.url,
                                                      height: adm.assets[i].img && adm.assets[i].img.h,
                                                      width: adm.assets[i].img && adm.assets[i].img.w,
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 1 other location - About 5 hrs to fix
                                        modules/pubwiseBidAdapter.js on lines 429..435

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

                                        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

                                                  case NATIVE_ASSETS.ICON.ID:
                                                    newBid.native.icon = {
                                                      url: adm.assets[i].img && adm.assets[i].img.url,
                                                      height: adm.assets[i].img && adm.assets[i].img.h,
                                                      width: adm.assets[i].img && adm.assets[i].img.w,
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 1 other location - About 5 hrs to fix
                                        modules/pubwiseBidAdapter.js on lines 422..428

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

                                        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 _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/pubwiseBidAdapter.js and 1 other location - About 4 hrs to fix
                                        modules/tappxBidAdapter.js on lines 585..607

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

                                        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/pubwiseBidAdapter.js and 1 other location - About 3 hrs to fix
                                        modules/pubmaticBidAdapter.js on lines 296..304

                                        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

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

                                        function _commonNativeRequestObject(nativeAsset, params) {
                                          var key = nativeAsset.KEY;
                                          return {
                                            id: nativeAsset.ID,
                                            required: params[key].required ? 1 : 0,
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 1 other location - About 2 hrs to fix
                                        modules/mgidBidAdapter.js on lines 669..680

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

                                        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 NATIVE_MINIMUM_REQUIRED_IMAGE_ASSETS = [
                                          {
                                            id: NATIVE_ASSETS.SPONSOREDBY.ID,
                                            required: true,
                                            data: {
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 1 other location - About 2 hrs to fix
                                        modules/mgidBidAdapter.js on lines 63..79

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

                                        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/pubwiseBidAdapter.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/pubmaticBidAdapter.js on lines 1218..1221
                                        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('bcat') && isArray(bid.params.bcat)) {
                                                blockedIabCategories = blockedIabCategories.concat(bid.params.bcat);
                                              }
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 2 other locations - About 1 hr to fix
                                        modules/pubmaticBidAdapter.js on lines 1142..1144
                                        modules/pubmaticBidAdapter.js on lines 1145..1147

                                        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 (typeof config.getConfig('device') === 'object') {
                                              payload.device = Object.assign(payload.device, config.getConfig('device'));
                                            }
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 2 other locations - About 1 hr to fix
                                        modules/distroscaleBidAdapter.js on lines 195..197
                                        modules/pubmaticBidAdapter.js on lines 1197..1199

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

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

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

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

                                        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.dspid) {
                                                        newBid.meta.networkId = bid.ext.dspid;
                                                      }
                                        Severity: Major
                                        Found in modules/pubwiseBidAdapter.js and 4 other locations - About 35 mins to fix
                                        modules/adtrueBidAdapter.js on lines 585..587
                                        modules/adtrueBidAdapter.js on lines 588..590
                                        modules/gridBidAdapter.js on lines 557..559
                                        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/pubwiseBidAdapter.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/pubmaticBidAdapter.js on lines 1027..1030

                                        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

                                        There are no issues that match your filters.

                                        Category
                                        Status