prebid/Prebid.js

View on GitHub
modules/mediafuseBidAdapter.js

Summary

Maintainability
F
1 mo
Test Coverage

File mediafuseBidAdapter.js has 910 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  createTrackPixelHtml,
  deepAccess,
  deepClone,
  getBidRequest,
Severity: Major
Found in modules/mediafuseBidAdapter.js - About 2 days to fix

    Function buildRequests has 149 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      buildRequests: function (bidRequests, bidderRequest) {
        // convert Native ORTB definition to old-style prebid native definition
        bidRequests = convertOrtbRequestToProprietaryNative(bidRequests);
        const tags = bidRequests.map(bidToTag);
        const userObjBid = find(bidRequests, hasUserInfo);
    Severity: Major
    Found in modules/mediafuseBidAdapter.js - About 5 hrs to fix

      Function bidToTag has 146 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function bidToTag(bid) {
        const tag = {};
        tag.sizes = transformSizes(bid.sizes);
        tag.primary_size = tag.sizes[0];
        tag.ad_types = [];
      Severity: Major
      Found in modules/mediafuseBidAdapter.js - About 5 hrs to fix

        Function newBid has 137 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function newBid(serverBid, rtbBid, bidderRequest) {
          const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]);
          const bid = {
            requestId: serverBid.uuid,
            cpm: rtbBid.cpm,
        Severity: Major
        Found in modules/mediafuseBidAdapter.js - About 5 hrs to fix

          Function bidToTag has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

          function bidToTag(bid) {
            const tag = {};
            tag.sizes = transformSizes(bid.sizes);
            tag.primary_size = tag.sizes[0];
            tag.ad_types = [];
          Severity: Minor
          Found in modules/mediafuseBidAdapter.js - About 5 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 a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

            buildRequests: function (bidRequests, bidderRequest) {
              // convert Native ORTB definition to old-style prebid native definition
              bidRequests = convertOrtbRequestToProprietaryNative(bidRequests);
              const tags = bidRequests.map(bidToTag);
              const userObjBid = find(bidRequests, hasUserInfo);
          Severity: Minor
          Found in modules/mediafuseBidAdapter.js - About 4 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function reloadViewabilityScriptWithCorrectParameters has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          function reloadViewabilityScriptWithCorrectParameters(bid) {
            let viewJsPayload = getMediafuseViewabilityScriptFromJsTrackers(bid.native.javascriptTrackers);
          
            if (viewJsPayload) {
              let prebidParams = 'pbjs_adid=' + bid.adId + ';pbjs_auc=' + bid.adUnitCode;
          Severity: Minor
          Found in modules/mediafuseBidAdapter.js - About 4 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function newBid has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          function newBid(serverBid, rtbBid, bidderRequest) {
            const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]);
            const bid = {
              requestId: serverBid.uuid,
              cpm: rtbBid.cpm,
          Severity: Minor
          Found in modules/mediafuseBidAdapter.js - About 4 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

          function formatRequest(payload, bidderRequest) {
            let request = [];
            let options = {
              withCredentials: true
            };
          Severity: Minor
          Found in modules/mediafuseBidAdapter.js - About 1 hr to fix

            Function reloadViewabilityScriptWithCorrectParameters has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function reloadViewabilityScriptWithCorrectParameters(bid) {
              let viewJsPayload = getMediafuseViewabilityScriptFromJsTrackers(bid.native.javascriptTrackers);
            
              if (viewJsPayload) {
                let prebidParams = 'pbjs_adid=' + bid.adId + ';pbjs_auc=' + bid.adUnitCode;
            Severity: Minor
            Found in modules/mediafuseBidAdapter.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                          if (currentScript.getAttribute('data-src') == jsTrackerSrc) {
                            currentScript.setAttribute('src', newJsTrackerSrc);
                            currentScript.setAttribute('data-src', '');
                            if (currentScript.removeAttribute) {
                              currentScript.removeAttribute('data-src');
              Severity: Major
              Found in modules/mediafuseBidAdapter.js - About 45 mins to fix

                Function getMediafuseViewabilityScriptFromJsTrackers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                function getMediafuseViewabilityScriptFromJsTrackers(jsTrackerArray) {
                  let viewJsPayload;
                  if (isStr(jsTrackerArray) && strIsMediafuseViewabilityScript(jsTrackerArray)) {
                    viewJsPayload = jsTrackerArray;
                  } else if (isArray(jsTrackerArray)) {
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                  interpretResponse: function (serverResponse, { bidderRequest }) {
                    serverResponse = serverResponse.body;
                    const bids = [];
                    if (!serverResponse || serverResponse.error) {
                      let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`;
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                  if (rtbBid.rtb.video) {
                    // shared video properties used for all 3 contexts
                    Object.assign(bid, {
                      width: rtbBid.rtb.video.player_width,
                      height: rtbBid.rtb.video.player_height,
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 2 days to fix
                modules/goldbachBidAdapter.js on lines 616..721

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

                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 (videoMediaType) {
                    tag.video = tag.video || {};
                    Object.keys(videoMediaType)
                      .filter(param => includes(VIDEO_RTB_TARGETING, param))
                      .forEach(param => {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 2 days to fix
                modules/goldbachBidAdapter.js on lines 832..874

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

                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

                  } else if (rtbBid.rtb[NATIVE]) {
                    const nativeAd = rtbBid.rtb[NATIVE];
                
                    // setting up the jsTracker:
                    // we put it as a data-src attribute so that the tracker isn't called
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 2 days to fix
                modules/adrelevantisBidAdapter.js on lines 355..420
                modules/goldbachBidAdapter.js on lines 654..721

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

                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 reloadViewabilityScriptWithCorrectParameters(bid) {
                  let viewJsPayload = getMediafuseViewabilityScriptFromJsTrackers(bid.native.javascriptTrackers);
                
                  if (viewJsPayload) {
                    let prebidParams = 'pbjs_adid=' + bid.adId + ';pbjs_auc=' + bid.adUnitCode;
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 2 days to fix
                modules/goldbachBidAdapter.js on lines 425..474

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

                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

                function buildNativeRequest(params) {
                  const request = {};
                
                  // map standard prebid native asset identifier to /ut parameters
                  // e.g., tag specifies `body` but /ut only knows `description`.
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 1 day to fix
                modules/appnexusBidAdapter.js on lines 1148..1182
                modules/goldbachBidAdapter.js on lines 1016..1050

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

                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

                function formatRequest(payload, bidderRequest) {
                  let request = [];
                  let options = {
                    withCredentials: true
                  };
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 1 day to fix
                modules/appnexusBidAdapter.js on lines 512..556
                modules/goldbachBidAdapter.js on lines 510..554

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

                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.video) {
                    tag.video = {};
                    // place any valid video params on the tag
                    Object.keys(bid.params.video)
                      .filter(param => includes(VIDEO_TARGETING, param))
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 1 day to fix
                modules/appnexusBidAdapter.js on lines 870..894
                modules/goldbachBidAdapter.js on lines 805..829

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

                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

                function createAdPodRequest(tags, adPodBid) {
                  const { durationRangeSec, requireExactDuration } = adPodBid.mediaTypes.video;
                
                  const numberOfPlacements = getAdPodPlacementNumber(adPodBid.mediaTypes.video);
                  const maxDuration = Math.max(...durationRangeSec);
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 1 day to fix
                modules/appnexusBidAdapter.js on lines 1101..1127
                modules/goldbachBidAdapter.js on lines 969..995

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

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

                    if (userObjBid) {
                      Object.keys(userObjBid.params.user)
                        .filter(param => includes(USER_PARAMS, param))
                        .forEach((param) => {
                          let uparam = convertCamelToUnderscore(param);
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 3 other locations - About 1 day to fix
                modules/appnexusBidAdapter.js on lines 156..175
                modules/goldbachBidAdapter.js on lines 139..158
                modules/pixfutureBidAdapter.js on lines 56..75

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

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

                function transformSizes(requestSizes) {
                  let sizes = [];
                  let sizeObj = {};
                
                  if (isArray(requestSizes) && requestSizes.length === 2 &&
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 4 other locations - About 1 day to fix
                modules/adrelevantisBidAdapter.js on lines 522..542
                modules/appnexusBidAdapter.js on lines 975..995
                modules/goldbachBidAdapter.js on lines 896..916
                modules/winrBidAdapter.js on lines 508..531

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

                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

                function newRenderer(adUnitCode, rtbBid, rendererOptions = {}) {
                  const renderer = Renderer.install({
                    id: rtbBid.renderer_id,
                    url: rtbBid.renderer_url,
                    config: rendererOptions,
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 3 other locations - About 7 hrs to fix
                modules/adrelevantisBidAdapter.js on lines 244..268
                modules/appnexusBidAdapter.js on lines 558..582
                modules/goldbachBidAdapter.js on lines 556..580

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

                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 (bidderRequest && bidderRequest.gdprConsent) {
                      // note - objects for impbus use underscore instead of camelCase
                      payload.gdpr_consent = {
                        consent_string: bidderRequest.gdprConsent.consentString,
                        consent_required: bidderRequest.gdprConsent.gdprApplies
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 7 hrs to fix
                modules/appnexusBidAdapter.js on lines 283..296
                modules/goldbachBidAdapter.js on lines 234..247

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

                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

                  transformBidParams: function (params, isOpenRtb) {
                    params = convertTypes({
                      'member': 'string',
                      'invCode': 'string',
                      'placementId': 'number',
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 7 hrs to fix
                modules/goldbachBidAdapter.js on lines 389..412

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

                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 (bidRequests[0].userId) {
                      let eids = [];
                
                      addUserId(eids, deepAccess(bidRequests[0], `userId.criteoId`), 'criteo.com', null);
                      addUserId(eids, deepAccess(bidRequests[0], `userId.netId`), 'netid.de', null);
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 6 hrs to fix
                modules/goldbachBidAdapter.js on lines 274..286
                modules/winrBidAdapter.js on lines 246..258

                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

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

                function outstreamRender(bid) {
                  hidedfpContainer(bid.adUnitCode);
                  hideSASIframe(bid.adUnitCode);
                  // push to render queue because ANOutstreamVideo may not be loaded yet
                  bid.renderer.push(() => {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 6 hrs to fix
                modules/goldbachBidAdapter.js on lines 1075..1089

                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

                    if (serverResponse.tags) {
                      serverResponse.tags.forEach(serverBid => {
                        const rtbBid = getRtbBid(serverBid);
                        if (rtbBid) {
                          const cpmCheck = (bidderSettings.get(bidderRequest.bidderCode, 'allowZeroCpmBids') === true) ? rtbBid.cpm >= 0 : rtbBid.cpm > 0;
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 6 hrs to fix
                modules/appnexusBidAdapter.js on lines 408..420

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

                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

                function hasOmidSupport(bid) {
                  let hasOmid = false;
                  const bidderParams = bid.params;
                  const videoParams = bid.params.video;
                  if (bidderParams.frameworks && isArray(bidderParams.frameworks)) {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 5 hrs to fix
                modules/appnexusBidAdapter.js on lines 1083..1094
                modules/goldbachBidAdapter.js on lines 951..962

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

                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 (bid.mediaType === NATIVE || deepAccess(bid, `mediaTypes.${NATIVE}`)) {
                    tag.ad_types.push(NATIVE);
                    if (tag.sizes.length === 0) {
                      tag.sizes = transformSizes([1, 1]);
                    }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 4 hrs to fix
                modules/adrelevantisBidAdapter.js on lines 474..484
                modules/goldbachBidAdapter.js on lines 776..786

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

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

                function getBidFloor(bid) {
                  if (!isFn(bid.getFloor)) {
                    return (bid.params.reserve) ? bid.params.reserve : null;
                  }
                
                
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 10 other locations - About 4 hrs to fix
                modules/brightcomBidAdapter.js on lines 287..301
                modules/brightcomSSPBidAdapter.js on lines 307..319
                modules/goldbachBidAdapter.js on lines 1117..1131
                modules/nextrollBidAdapter.js on lines 197..212
                modules/omsBidAdapter.js on lines 269..281
                modules/onomagicBidAdapter.js on lines 260..274
                modules/pixfutureBidAdapter.js on lines 342..356
                modules/proxistoreBidAdapter.js on lines 161..175
                modules/pstudioBidAdapter.js on lines 419..433
                modules/winrBidAdapter.js on lines 577..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 129.

                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.refererInfo) {
                      let refererinfo = {
                        // TODO: this collects everything it finds, except for canonicalUrl
                        rd_ref: encodeURIComponent(bidderRequest.refererInfo.topmostLocation),
                        rd_top: bidderRequest.refererInfo.reachedTop,
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 4 other locations - About 4 hrs to fix
                modules/adrelevantisBidAdapter.js on lines 137..146
                modules/goldbachBidAdapter.js on lines 253..262
                modules/pixfutureBidAdapter.js on lines 93..102
                modules/winrBidAdapter.js on lines 233..244

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

                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 getMediafuseViewabilityScriptFromJsTrackers(jsTrackerArray) {
                  let viewJsPayload;
                  if (isStr(jsTrackerArray) && strIsMediafuseViewabilityScript(jsTrackerArray)) {
                    viewJsPayload = jsTrackerArray;
                  } else if (isArray(jsTrackerArray)) {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 3 hrs to fix
                modules/goldbachBidAdapter.js on lines 486..499

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

                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

                function hideSASIframe(elementId) {
                  try {
                    // find script tag with id 'sas_script'. This ensures it only works if you're using Smart Ad Server.
                    const el = document.getElementById(elementId).querySelectorAll("script[id^='sas_script']");
                    if (el[0].nextSibling && el[0].nextSibling.localName === 'iframe') {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 3 hrs to fix
                modules/appnexusBidAdapter.js on lines 1199..1209
                modules/goldbachBidAdapter.js on lines 1063..1073

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

                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 strIsMediafuseViewabilityScript(str) {
                  let regexMatchUrlStart = str.match(VIEWABILITY_URL_START);
                  let viewUrlStartInStr = regexMatchUrlStart != null && regexMatchUrlStart.length >= 1;
                
                  let regexMatchFileName = str.match(VIEWABILITY_FILE_NAME);
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 3 hrs to fix
                modules/goldbachBidAdapter.js on lines 476..484

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

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

                    if (appDeviceObjBid && appDeviceObjBid.params && appDeviceObjBid.params.app) {
                      appDeviceObj = {};
                      Object.keys(appDeviceObjBid.params.app)
                        .filter(param => includes(APP_DEVICE_PARAMS, param))
                        .forEach(param => appDeviceObj[param] = appDeviceObjBid.params.app[param]);
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 4 other locations - About 3 hrs to fix
                modules/adrelevantisBidAdapter.js on lines 98..103
                modules/appnexusBidAdapter.js on lines 179..184
                modules/goldbachBidAdapter.js on lines 162..167
                modules/winrBidAdapter.js on lines 181..186

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

                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 bid = {
                    requestId: serverBid.uuid,
                    cpm: rtbBid.cpm,
                    creativeId: rtbBid.creative_id,
                    dealId: rtbBid.deal_id,
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 3 hrs to fix
                modules/goldbachBidAdapter.js on lines 591..605

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

                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 (hasAdPodBid) {
                      bidRequests.filter(hasAdPod).forEach(adPodBid => {
                        const adPodTags = createAdPodRequest(tags, adPodBid);
                        // don't need the original adpod placement because it's in adPodTags
                        const nonPodTags = payload.tags.filter(tag => tag.uuid !== adPodBid.bidId);
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 3 hrs to fix
                modules/appnexusBidAdapter.js on lines 331..338
                modules/goldbachBidAdapter.js on lines 265..272

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

                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

                function getAdPodPlacementNumber(videoParams) {
                  const { adPodDurationSec, durationRangeSec, requireExactDuration } = videoParams;
                  const minAllowedDuration = Math.min(...durationRangeSec);
                  const numberOfPlacements = Math.floor(adPodDurationSec / minAllowedDuration);
                
                
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 3 other locations - About 2 hrs to fix
                modules/appnexusBidAdapter.js on lines 1129..1137
                modules/goldbachBidAdapter.js on lines 997..1005
                modules/smaatoBidAdapter.js on lines 440..448

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

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

                const NATIVE_MAPPING = {
                  body: 'description',
                  body2: 'desc2',
                  cta: 'ctatext',
                  image: {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 3 other locations - About 2 hrs to fix
                modules/adrelevantisBidAdapter.js on lines 40..56
                modules/appnexusBidAdapter.js on lines 83..99
                modules/goldbachBidAdapter.js on lines 72..88

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

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

                function addUserId(eids, id, source, rti) {
                  if (id) {
                    if (rti) {
                      eids.push({ source, id, rti_partner: rti });
                    } else {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 3 other locations - About 2 hrs to fix
                modules/goldbachBidAdapter.js on lines 1106..1115
                modules/pixfutureBidAdapter.js on lines 305..314
                modules/winrBidAdapter.js on lines 566..575

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

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

                    if (!serverResponse || serverResponse.error) {
                      let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`;
                      if (serverResponse && serverResponse.error) { errorMessage += `: ${serverResponse.error}`; }
                      logError(errorMessage);
                      return bids;
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 3 other locations - About 2 hrs to fix
                modules/adrelevantisBidAdapter.js on lines 169..174
                modules/appnexusBidAdapter.js on lines 401..406
                modules/winrBidAdapter.js on lines 277..284

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

                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 VIDEO_MAPPING = {
                  playback_method: {
                    'unknown': 0,
                    'auto_play_sound_on': 1,
                    'auto_play_sound_off': 2,
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 2 hrs to fix
                modules/goldbachBidAdapter.js on lines 54..71

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

                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 (debugObj && debugObj.enabled) {
                      Object.keys(debugObj)
                        .filter(param => includes(DEBUG_PARAMS, param))
                        .forEach(param => {
                          debugObjParams[param] = debugObj[param];
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 1 hr to fix
                modules/appnexusBidAdapter.js on lines 224..230
                modules/goldbachBidAdapter.js on lines 184..190

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

                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 getViewabilityScriptUrlFromPayload(viewJsPayload) {
                  // extracting the content of the src attribute
                  // -> substring between src=" and "
                  let indexOfFirstQuote = viewJsPayload.indexOf('src="') + 5; // offset of 5: the length of 'src=' + 1
                  let indexOfSecondQuote = viewJsPayload.indexOf('"', indexOfFirstQuote);
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 1 hr to fix
                modules/goldbachBidAdapter.js on lines 501..508

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

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

                    if (appIdObjBid && appIdObjBid.params && appDeviceObjBid.params.app && appDeviceObjBid.params.app.id) {
                      appIdObj = {
                        appid: appIdObjBid.params.app.id
                      };
                    }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 4 other locations - About 1 hr to fix
                modules/adrelevantisBidAdapter.js on lines 107..111
                modules/appnexusBidAdapter.js on lines 188..192
                modules/goldbachBidAdapter.js on lines 171..175
                modules/winrBidAdapter.js on lines 190..194

                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

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

                function hasAppId(bid) {
                  if (bid.params && bid.params.app) {
                    return !!bid.params.app.id
                  }
                  return !!bid.params.app
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 4 other locations - About 1 hr to fix
                modules/adrelevantisBidAdapter.js on lines 554..559
                modules/appnexusBidAdapter.js on lines 1064..1069
                modules/goldbachBidAdapter.js on lines 932..937
                modules/winrBidAdapter.js on lines 547..552

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

                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

                function hidedfpContainer(elementId) {
                  var el = document.getElementById(elementId).querySelectorAll("div[id^='google_ads']");
                  if (el[0]) {
                    el[0].style.setProperty('display', 'none');
                  }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 1 hr to fix
                modules/adrelevantisBidAdapter.js on lines 274..279
                modules/goldbachBidAdapter.js on lines 1056..1061

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

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

                  if (bid.params.placementId) {
                    tag.id = parseInt(bid.params.placementId, 10);
                  } else {
                    tag.code = bid.params.invCode;
                  }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 3 other locations - About 1 hr to fix
                modules/goldbachBidAdapter.js on lines 732..736
                modules/pixfutureBidAdapter.js on lines 234..238
                modules/winrBidAdapter.js on lines 463..467

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

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

                function parseMediaType(rtbBid) {
                  const adType = rtbBid.ad_type;
                  if (adType === VIDEO) {
                    return VIDEO;
                  } else if (adType === NATIVE) {
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 4 other locations - About 1 hr to fix
                modules/adrelevantisBidAdapter.js on lines 601..610
                modules/appnexusBidAdapter.js on lines 1232..1241
                modules/craftBidAdapter.js on lines 202..211
                modules/goldbachBidAdapter.js on lines 1095..1104

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

                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 setupDChain(rtbBid) {
                    let dchain = {
                      ver: '1.0',
                      complete: 0,
                      nodes: [{
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 1 hr to fix
                modules/appnexusBidAdapter.js on lines 624..634

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

                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

                  getUserSyncs: function (syncOptions, responses, gdprConsent) {
                    if (syncOptions.iframeEnabled && hasPurpose1Consent({gdprConsent})) {
                      return [{
                        type: 'iframe',
                        url: 'https://acdn.adnxs.com/dmp/async_usersync.html'
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 55 mins to fix
                modules/goldbachBidAdapter.js on lines 380..387

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

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

                function getRtbBid(tag) {
                  return tag && tag.ads && tag.ads.length && find(tag.ads, ad => ad.rtb);
                }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 6 other locations - About 55 mins to fix
                modules/adrelevantisBidAdapter.js on lines 561..563
                modules/appnexusBidAdapter.js on lines 1144..1146
                modules/craftBidAdapter.js on lines 198..200
                modules/goldbachBidAdapter.js on lines 1012..1014
                modules/targetVideoBidAdapter.js on lines 192..194
                modules/winrBidAdapter.js on lines 554..556

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

                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

                function setVideoProperty(tag, key, value) {
                  if (isEmpty(tag.video)) { tag.video = {}; }
                  tag.video[key] = value;
                }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 55 mins to fix
                modules/appnexusBidAdapter.js on lines 1139..1142
                modules/goldbachBidAdapter.js on lines 1007..1010

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

                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.params.position) {
                    tag.position = { 'above': 1, 'below': 2 }[bid.params.position] || 0;
                  }
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 55 mins to fix
                modules/goldbachBidAdapter.js on lines 745..747

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

                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

                  isBidRequestValid: function (bid) {
                    return !!(bid.params.placementId || (bid.params.member && bid.params.invCode));
                  },
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 50 mins to fix
                modules/goldbachBidAdapter.js on lines 107..109

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

                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 (bid.params.frameworks && isArray(bid.params.frameworks)) {
                    tag['banner_frameworks'] = bid.params.frameworks;
                  }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 45 mins to fix
                modules/appnexusBidAdapter.js on lines 959..961
                modules/goldbachBidAdapter.js on lines 880..882

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 50.

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

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

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

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

                Refactorings

                Further Reading

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

                  if (rtbBid.advertiser_id) {
                    bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
                  }
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 40 mins to fix
                modules/appnexusBidAdapter.js on lines 619..621

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

                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

                function hasAdPod(bid) {
                  return (
                    bid.mediaTypes &&
                    bid.mediaTypes.video &&
                    bid.mediaTypes.video.context === ADPOD
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 40 mins to fix
                modules/appnexusBidAdapter.js on lines 1075..1081
                modules/goldbachBidAdapter.js on lines 943..949

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

                  if (rtbBid.brand_id) {
                    bid.meta = Object.assign({}, bid.meta, { brandId: rtbBid.brand_id });
                  }
                Severity: Major
                Found in modules/mediafuseBidAdapter.js and 5 other locations - About 35 mins to fix
                modules/adrelevantisBidAdapter.js on lines 325..327
                modules/appnexusBidAdapter.js on lines 615..617
                modules/appnexusBidAdapter.js on lines 639..641
                modules/goldbachBidAdapter.js on lines 612..614
                modules/winrBidAdapter.js on lines 421..425

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                  if (rtbBid.buyer_member_id) {
                    bid.meta = Object.assign({}, bid.meta, {dchain: setupDChain(rtbBid)});
                  }
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js and 1 other location - About 35 mins to fix
                modules/appnexusBidAdapter.js on lines 635..637

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                  if (rtbBid.adomain) {
                    bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [] });
                  }
                Severity: Minor
                Found in modules/mediafuseBidAdapter.js and 2 other locations - About 35 mins to fix
                modules/goldbachBidAdapter.js on lines 608..610
                modules/winrBidAdapter.js on lines 417..419

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 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