prebid/Prebid.js

View on GitHub
modules/appnexusBidAdapter.js

Summary

Maintainability
F
1 mo
Test Coverage

File appnexusBidAdapter.js has 1077 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

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

    function bidToTag(bid) {
      const tag = {};
      Object.keys(bid.params).forEach(paramKey => {
        let convertedKey = convertCamelToUnderscore(paramKey);
        if (convertedKey !== paramKey) {
    Severity: Minor
    Found in modules/appnexusBidAdapter.js - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function buildRequests has 209 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);
    Severity: Major
    Found in modules/appnexusBidAdapter.js - About 1 day to fix

      Function buildRequests has a Cognitive Complexity of 48 (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);
      Severity: Minor
      Found in modules/appnexusBidAdapter.js - About 7 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 bidToTag has 185 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function bidToTag(bid) {
        const tag = {};
        Object.keys(bid.params).forEach(paramKey => {
          let convertedKey = convertCamelToUnderscore(paramKey);
          if (convertedKey !== paramKey) {
      Severity: Major
      Found in modules/appnexusBidAdapter.js - About 7 hrs to fix

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

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

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

          function newBid(serverBid, rtbBid, bidderRequest) {
            const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]);
            const adId = getUniqueIdentifierStr();
            const bid = {
              adId: adId,
          Severity: Minor
          Found in modules/appnexusBidAdapter.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 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/appnexusBidAdapter.js - About 1 hr to fix

            Function transformBidParams has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              transformBidParams: function (params, isOpenRtb, adUnit, bidRequests) {
                let conversionFn = transformBidderParamKeywords;
                if (isOpenRtb === true) {
                  let s2sEndpointUrl = null;
                  let s2sConfig = config.getConfig('s2sConfig');
            Severity: Minor
            Found in modules/appnexusBidAdapter.js - About 1 hr to fix

              Function transformBidParams has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                transformBidParams: function (params, isOpenRtb, adUnit, bidRequests) {
                  let conversionFn = transformBidderParamKeywords;
                  if (isOpenRtb === true) {
                    let s2sEndpointUrl = null;
                    let s2sConfig = config.getConfig('s2sConfig');
              Severity: Minor
              Found in modules/appnexusBidAdapter.js - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

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

              function getContextFromPlcmt(ortbPlcmt, ortbStartDelay) {
                if (!ortbPlcmt) {
                  return;
                }
              
              
              Severity: Minor
              Found in modules/appnexusBidAdapter.js - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Avoid deeply nested control flow statements.
              Open

                              if (type >= 1 && type <= 4) {
                                tag.video['playback_method'] = type;
                              }
              Severity: Major
              Found in modules/appnexusBidAdapter.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                  if (v >= 1 && v <= 5) {
                                    return v;
                                  }
                Severity: Major
                Found in modules/appnexusBidAdapter.js - About 45 mins to fix

                  Function getUserSyncs has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
                  Severity: Minor
                  Found in modules/appnexusBidAdapter.js - About 35 mins to fix

                    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/appnexusBidAdapter.js - About 35 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Avoid too many return statements within this function.
                    Open

                        return 'outstream';
                    Severity: Major
                    Found in modules/appnexusBidAdapter.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return 'intersitial';
                      Severity: Major
                      Found in modules/appnexusBidAdapter.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return 'interstitial';
                        Severity: Major
                        Found in modules/appnexusBidAdapter.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return 'accompanying_content_post_roll';
                          Severity: Major
                          Found in modules/appnexusBidAdapter.js - About 30 mins to fix

                            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/appnexusBidAdapter.js and 2 other locations - About 1 day to fix
                            modules/goldbachBidAdapter.js on lines 1016..1050
                            modules/mediafuseBidAdapter.js on lines 1004..1038

                            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/appnexusBidAdapter.js and 2 other locations - About 1 day to fix
                            modules/goldbachBidAdapter.js on lines 510..554
                            modules/mediafuseBidAdapter.js on lines 475..519

                            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/appnexusBidAdapter.js and 2 other locations - About 1 day to fix
                            modules/goldbachBidAdapter.js on lines 805..829
                            modules/mediafuseBidAdapter.js on lines 793..817

                            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/appnexusBidAdapter.js and 2 other locations - About 1 day to fix
                            modules/goldbachBidAdapter.js on lines 969..995
                            modules/mediafuseBidAdapter.js on lines 957..983

                            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/appnexusBidAdapter.js and 3 other locations - About 1 day to fix
                            modules/goldbachBidAdapter.js on lines 139..158
                            modules/mediafuseBidAdapter.js on lines 126..145
                            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/appnexusBidAdapter.js and 4 other locations - About 1 day to fix
                            modules/adrelevantisBidAdapter.js on lines 522..542
                            modules/goldbachBidAdapter.js on lines 896..916
                            modules/mediafuseBidAdapter.js on lines 884..904
                            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

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

                              } else if (FEATURES.NATIVE && rtbBid.rtb[NATIVE]) {
                                const nativeAd = rtbBid.rtb[NATIVE];
                                let viewScript;
                            
                                if (strIsAppnexusViewabilityScript(rtbBid.viewability.config)) {
                            Severity: Major
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 1 day to fix
                            modules/mediafuseBidAdapter.js on lines 639..708

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

                            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/appnexusBidAdapter.js and 3 other locations - About 7 hrs to fix
                            modules/adrelevantisBidAdapter.js on lines 244..268
                            modules/goldbachBidAdapter.js on lines 556..580
                            modules/mediafuseBidAdapter.js on lines 521..545

                            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/appnexusBidAdapter.js and 2 other locations - About 7 hrs to fix
                            modules/goldbachBidAdapter.js on lines 234..247
                            modules/mediafuseBidAdapter.js on lines 235..248

                            Duplicated Code

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

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

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

                            Tuning

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

                                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/appnexusBidAdapter.js and 1 other location - About 6 hrs to fix
                            modules/mediafuseBidAdapter.js on lines 313..325

                            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/appnexusBidAdapter.js and 2 other locations - About 5 hrs to fix
                            modules/goldbachBidAdapter.js on lines 951..962
                            modules/mediafuseBidAdapter.js on lines 939..950

                            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

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

                              if (bid.params.position) {
                                tag.position = { 'above': 1, 'below': 2 }[bid.params.position] || 0;
                              } else {
                                let mediaTypePos = deepAccess(bid, `mediaTypes.banner.pos`) || deepAccess(bid, `mediaTypes.video.pos`);
                                // only support unknown, atf, and btf values for position at this time
                            Severity: Major
                            Found in modules/appnexusBidAdapter.js and 2 other locations - About 5 hrs to fix
                            modules/adrelevantisBidAdapter.js on lines 441..450
                            modules/pixfutureBidAdapter.js on lines 247..256

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

                            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 (bidderRequest?.gppConsent) {
                                  payload.privacy = {
                                    gpp: bidderRequest.gppConsent.gppString,
                                    gpp_sid: bidderRequest.gppConsent.applicableSections
                                  }
                            Severity: Major
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 4 hrs to fix
                            modules/richaudienceBidAdapter.js on lines 78..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 115.

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

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

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

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

                            Refactorings

                            Further Reading

                            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/appnexusBidAdapter.js and 2 other locations - About 3 hrs to fix
                            modules/goldbachBidAdapter.js on lines 1063..1073
                            modules/mediafuseBidAdapter.js on lines 1051..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 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

                            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/appnexusBidAdapter.js and 4 other locations - About 3 hrs to fix
                            modules/adrelevantisBidAdapter.js on lines 98..103
                            modules/goldbachBidAdapter.js on lines 162..167
                            modules/mediafuseBidAdapter.js on lines 149..154
                            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

                            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/appnexusBidAdapter.js and 2 other locations - About 3 hrs to fix
                            modules/goldbachBidAdapter.js on lines 265..272
                            modules/mediafuseBidAdapter.js on lines 266..273

                            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

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

                                  debugText = debugText
                                    .replace(/(<td>|<th>)/gm, '\t') // Tables
                                    .replace(/(<\/td>|<\/th>)/gm, '\n') // Tables
                                    .replace(/^<br>/gm, '') // Remove leading <br>
                                    .replace(/(<br>\n|<br>)/gm, '\n') // <br>
                            Severity: Major
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 3 hrs to fix
                            modules/goldbachBidAdapter.js on lines 366..373

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

                            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/appnexusBidAdapter.js and 3 other locations - About 2 hrs to fix
                            modules/goldbachBidAdapter.js on lines 997..1005
                            modules/mediafuseBidAdapter.js on lines 985..993
                            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/appnexusBidAdapter.js and 3 other locations - About 2 hrs to fix
                            modules/adrelevantisBidAdapter.js on lines 40..56
                            modules/goldbachBidAdapter.js on lines 72..88
                            modules/mediafuseBidAdapter.js on lines 71..87

                            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

                                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/appnexusBidAdapter.js and 3 other locations - About 2 hrs to fix
                            modules/adrelevantisBidAdapter.js on lines 169..174
                            modules/mediafuseBidAdapter.js on lines 306..311
                            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 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/appnexusBidAdapter.js and 2 other locations - About 1 hr to fix
                            modules/goldbachBidAdapter.js on lines 184..190
                            modules/mediafuseBidAdapter.js on lines 182..188

                            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 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/appnexusBidAdapter.js and 4 other locations - About 1 hr to fix
                            modules/adrelevantisBidAdapter.js on lines 107..111
                            modules/goldbachBidAdapter.js on lines 171..175
                            modules/mediafuseBidAdapter.js on lines 158..162
                            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/appnexusBidAdapter.js and 4 other locations - About 1 hr to fix
                            modules/adrelevantisBidAdapter.js on lines 554..559
                            modules/goldbachBidAdapter.js on lines 932..937
                            modules/mediafuseBidAdapter.js on lines 920..925
                            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

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

                                if (isStr(keywords[key])) {
                                  if (keywords[key] !== '') {
                                    result += `${key}=${keywords[key]},`
                                  } else {
                                    result += `${key},`;
                            Severity: Major
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 1 hr to fix
                            modules/dgkeywordRtdProvider.js on lines 160..179

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

                            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/appnexusBidAdapter.js and 4 other locations - About 1 hr to fix
                            modules/adrelevantisBidAdapter.js on lines 601..610
                            modules/craftBidAdapter.js on lines 202..211
                            modules/goldbachBidAdapter.js on lines 1095..1104
                            modules/mediafuseBidAdapter.js on lines 1083..1092

                            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/appnexusBidAdapter.js and 1 other location - About 1 hr to fix
                            modules/mediafuseBidAdapter.js on lines 582..592

                            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 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/appnexusBidAdapter.js and 6 other locations - About 55 mins to fix
                            modules/adrelevantisBidAdapter.js on lines 561..563
                            modules/craftBidAdapter.js on lines 198..200
                            modules/goldbachBidAdapter.js on lines 1012..1014
                            modules/mediafuseBidAdapter.js on lines 1000..1002
                            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/appnexusBidAdapter.js and 2 other locations - About 55 mins to fix
                            modules/goldbachBidAdapter.js on lines 1007..1010
                            modules/mediafuseBidAdapter.js on lines 995..998

                            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

                                  ['dsarequired', 'pubrender', 'datatopub'].forEach((dsaKey) => {
                                    if (isNumber(pubDsaObj[dsaKey])) {
                                      dsaObj[dsaKey] = pubDsaObj[dsaKey];
                                    }
                                  });
                            Severity: Minor
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 50 mins to fix
                            modules/ixBidAdapter.js on lines 1211..1215

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 51.

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

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

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

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

                            Refactorings

                            Further Reading

                            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/appnexusBidAdapter.js and 2 other locations - About 45 mins to fix
                            modules/goldbachBidAdapter.js on lines 880..882
                            modules/mediafuseBidAdapter.js on lines 868..870

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 50.

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

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

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

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

                            Refactorings

                            Further Reading

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

                              if (rtbBid.adomain) {
                                bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [rtbBid.adomain] });
                              }
                            Severity: Minor
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 40 mins to fix
                            modules/pixfutureBidAdapter.js on lines 214..216

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

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

                            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/appnexusBidAdapter.js and 2 other locations - About 40 mins to fix
                            modules/goldbachBidAdapter.js on lines 943..949
                            modules/mediafuseBidAdapter.js on lines 931..937

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

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

                              if (ortbStartDelay === 0) {
                                return 'pre_roll';
                              } else if (ortbStartDelay === -1) {
                                return 'mid_roll';
                              } else if (ortbStartDelay === -2) {
                            Severity: Minor
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 40 mins to fix
                            modules/appnexusBidAdapter.js on lines 1036..1042

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                if (ortbStartDelay === 0) {
                                  return 'accompanying_content_pre_roll';
                                } else if (ortbStartDelay === -1) {
                                  return 'accompanying_content_mid_roll';
                                } else if (ortbStartDelay === -2) {
                            Severity: Minor
                            Found in modules/appnexusBidAdapter.js and 1 other location - About 40 mins to fix
                            modules/appnexusBidAdapter.js on lines 1018..1024

                            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.advertiser_id) {
                                bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
                              }
                            Severity: Major
                            Found in modules/appnexusBidAdapter.js and 5 other locations - About 35 mins to fix
                            modules/adrelevantisBidAdapter.js on lines 325..327
                            modules/appnexusBidAdapter.js on lines 639..641
                            modules/goldbachBidAdapter.js on lines 612..614
                            modules/mediafuseBidAdapter.js on lines 597..599
                            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/appnexusBidAdapter.js and 1 other location - About 35 mins to fix
                            modules/mediafuseBidAdapter.js on lines 593..595

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 47.

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

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

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

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

                            Refactorings

                            Further Reading

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

                              if (rtbBid.brand_id) {
                                bid.meta = Object.assign({}, bid.meta, { brandId: rtbBid.brand_id });
                              }
                            Severity: Major
                            Found in modules/appnexusBidAdapter.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/goldbachBidAdapter.js on lines 612..614
                            modules/mediafuseBidAdapter.js on lines 597..599
                            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

                            There are no issues that match your filters.

                            Category
                            Status