prebid/Prebid.js

View on GitHub
modules/yahoosspBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File yahoosspBidAdapter.js has 602 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { deepAccess, isFn, isStr, isNumber, isArray, isEmpty, isPlainObject, generateUUID, logInfo, logWarn } from '../src/utils.js';
import { config } from '../src/config.js';
import { Renderer } from '../src/Renderer.js';
Severity: Major
Found in modules/yahoosspBidAdapter.js - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

        if (bid.mediaTypes.video && (mediaTypeMode === VIDEO || mediaTypeMode === '*')) {
          const playerSize = transformSizes(bid.mediaTypes.video.playerSize);
          impObject.video = {
            mimes: deepAccess(bid, 'params.bidOverride.imp.video.mimes') || bid.mediaTypes.video.mimes || ['video/mp4', 'application/javascript'],
            w: deepAccess(bid, 'params.bidOverride.imp.video.w') || playerSize[0].w,
    Severity: Critical
    Found in modules/yahoosspBidAdapter.js - About 1 day to fix

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

      function appendImpObject(bid, openRtbObject) {
        const mediaTypeMode = getAdapterMode(bid);
      
        if (openRtbObject && bid) {
          const impObject = {
      Severity: Minor
      Found in modules/yahoosspBidAdapter.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 generateOpenRtbObject has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      function generateOpenRtbObject(bidderRequest, bid) {
        if (bidderRequest) {
          let outBoundBidRequest = {
            id: generateUUID(),
            cur: [getFloorModuleData(bidderRequest).currency || deepAccess(bid, 'params.bidOverride.cur') || DEFAULT_CURRENCY],
      Severity: Minor
      Found in modules/yahoosspBidAdapter.js - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function appendFirstPartyData has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function appendFirstPartyData(outBoundBidRequest, bid) {
        const ortb2Object = bid.ortb2;
        const siteObject = deepAccess(ortb2Object, 'site') || undefined;
        const siteContentObject = deepAccess(siteObject, 'content') || undefined;
        const sitePublisherObject = deepAccess(siteObject, 'publisher') || undefined;
      Severity: Major
      Found in modules/yahoosspBidAdapter.js - About 2 hrs to fix

        Function generateOpenRtbObject has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function generateOpenRtbObject(bidderRequest, bid) {
          if (bidderRequest) {
            let outBoundBidRequest = {
              id: generateUUID(),
              cur: [getFloorModuleData(bidderRequest).currency || deepAccess(bid, 'params.bidOverride.cur') || DEFAULT_CURRENCY],
        Severity: Major
        Found in modules/yahoosspBidAdapter.js - About 2 hrs to fix

          Function appendImpObject has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function appendImpObject(bid, openRtbObject) {
            const mediaTypeMode = getAdapterMode(bid);
          
            if (openRtbObject && bid) {
              const impObject = {
          Severity: Major
          Found in modules/yahoosspBidAdapter.js - About 2 hrs to fix

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

            function validateAppendObject(validationType, allowedKeys, inputObject, appendToObject) {
              const outputObject = {
                ...appendToObject
              };
            
            
            Severity: Minor
            Found in modules/yahoosspBidAdapter.js - About 2 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

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

            function validateAppendObject(validationType, allowedKeys, inputObject, appendToObject) {
              const outputObject = {
                ...appendToObject
              };
            
            
            Severity: Minor
            Found in modules/yahoosspBidAdapter.js - About 1 hr to fix

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

              function appendFirstPartyData(outBoundBidRequest, bid) {
                const ortb2Object = bid.ortb2;
                const siteObject = deepAccess(ortb2Object, 'site') || undefined;
                const siteContentObject = deepAccess(siteObject, 'content') || undefined;
                const sitePublisherObject = deepAccess(siteObject, 'publisher') || undefined;
              Severity: Minor
              Found in modules/yahoosspBidAdapter.js - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Consider simplifying this complex logical expression.
              Open

                if (bidderRequest) {
                  let outBoundBidRequest = {
                    id: generateUUID(),
                    cur: [getFloorModuleData(bidderRequest).currency || deepAccess(bid, 'params.bidOverride.cur') || DEFAULT_CURRENCY],
                    imp: [],
              Severity: Major
              Found in modules/yahoosspBidAdapter.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                          if (array.every(value => isStr(value)) || array.every(value => isNumber(value))) {
                            impObject.ext.kvs[key] = bid.params.kvp[key];
                          }
                Severity: Major
                Found in modules/yahoosspBidAdapter.js - About 45 mins to fix

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

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

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

                    function generateServerRequest({payload, requestOptions, bidderRequest}) {
                      const pubIdMode = getPubIdMode(bidderRequest);
                      const overrideEndpoint = getConfigValue(bidderRequest, 'endpoint');
                      let sspEndpoint = overrideEndpoint || SSP_ENDPOINT_DCN_POS;
                    
                    
                    Severity: Minor
                    Found in modules/yahoosspBidAdapter.js - About 25 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                    function updateConsentQueryParams(url, consentData) {
                      const parameterMap = {
                        'gdpr_consent': consentData.gdpr ? consentData.gdpr.consentString : '',
                        'gdpr': consentData.gdpr && consentData.gdpr.gdprApplies ? '1' : '0',
                        'us_privacy': consentData.uspConsent ? consentData.uspConsent : '',
                    Severity: Minor
                    Found in modules/yahoosspBidAdapter.js - About 25 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                      isBidRequestValid: function(bid) {
                        const params = bid.params;
                        if (deepAccess(params, 'testing.e2etest') === true) {
                          return true;
                        } else if (
                    Severity: Minor
                    Found in modules/yahoosspBidAdapter.js - About 25 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                    function extractUserSyncUrls(syncOptions, pixels) {
                      let itemsRegExp = /(img|iframe)[\s\S]*?src\s*=\s*("|')(.*?)\2/gi;
                      let tagNameRegExp = /\w*(?=\s)/;
                      let srcRegExp = /src=("|')(.*?)\1/;
                      let userSyncObjects = [];
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 day to fix
                    modules/adtrgtmeBidAdapter.js on lines 28..55

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                        if (bid.mediaTypes.banner && (typeof mediaTypeMode === 'undefined' || mediaTypeMode === BANNER || mediaTypeMode === '*')) {
                          impObject.banner = {
                            mimes: bid.mediaTypes.banner.mimes || ['text/html', 'text/javascript', 'application/javascript', 'image/jpg'],
                            format: transformSizes(bid.sizes)
                          };
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 3 hrs to fix
                    modules/adtrgtmeBidAdapter.js on lines 161..169

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                        if (bidderRequest.ortb2?.regs?.gpp) {
                          outBoundBidRequest.regs.ext.gpp = bidderRequest.ortb2.regs.gpp;
                          outBoundBidRequest.regs.ext.gpp_sid = bidderRequest.ortb2.regs.gpp_sid
                        };
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 2 hrs to fix
                    modules/vrtcalBidAdapter.js on lines 102..105

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

                    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 (deepAccess(bid, 'ortb2Imp.instl') && isNumber(bid.ortb2Imp.instl) && (bid.ortb2Imp.instl === 1)) {
                          impObject.instl = bid.ortb2Imp.instl;
                        };
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 hr to fix
                    modules/adtrgtmeBidAdapter.js on lines 183..185

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

                        if (isArray(schainData) && schainData.length > 0) {
                          outBoundBidRequest.source.ext.schain = bid.schain;
                          outBoundBidRequest.source.ext.schain.nodes[0].rid = outBoundBidRequest.id;
                        };
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 hr to fix
                    modules/adtrgtmeBidAdapter.js on lines 142..145

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 62.

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

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

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

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

                    Refactorings

                    Further Reading

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

                    function transformSizes(sizes) {
                      if (isArray(sizes) && sizes.length === 2 && !isArray(sizes[0])) {
                        return [ getSize(sizes) ];
                      }
                      return sizes.map(getSize);
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 hr to fix
                    modules/33acrossBidAdapter.js on lines 384..390

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

                    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

                        return filteredBidRequests.map(bid => {
                          const payloadClone = generateOpenRtbObject(bidderRequest, bid);
                          appendImpObject(bid, payloadClone);
                          return generateServerRequest({payload: payloadClone, requestOptions, bidderRequest: bid});
                        });
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 hr to fix
                    modules/adtrgtmeBidAdapter.js on lines 272..277

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

                    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 (deepAccess(bid, 'ortb2Imp.ext.data') && isPlainObject(bid.ortb2Imp.ext.data)) {
                          impObject.ext.data = bid.ortb2Imp.ext.data;
                        };
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 hr to fix
                    modules/adtrgtmeBidAdapter.js on lines 179..181

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 59.

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

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

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

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

                    Refactorings

                    Further Reading

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

                      if (mediaTypesMode === BANNER) {
                        result = validBidRequests.filter(bid => {
                          return Object.keys(bid.mediaTypes).some(item => item === BANNER);
                        });
                      } else if (mediaTypesMode === VIDEO) {
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 hr to fix
                    modules/yahoosspBidAdapter.js on lines 202..210

                    Duplicated Code

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

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

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

                    Tuning

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

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

                      } else if (mediaTypesMode === VIDEO) {
                        result = validBidRequests.filter(bid => {
                          return Object.keys(bid.mediaTypes).some(item => item === VIDEO);
                        });
                      } else if (mediaTypesMode === '*') {
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 1 hr to fix
                    modules/yahoosspBidAdapter.js on lines 198..210

                    Duplicated Code

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

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

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

                    Tuning

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

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

                          case 'number':
                            if (allowedKeys.indexOf(objectKey) !== -1 && isNumber(inputObject[objectKey])) {
                              outputObject[objectKey] = inputObject[objectKey];
                            };
                            break;
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 3 other locations - About 55 mins to fix
                    modules/yahoosspBidAdapter.js on lines 221..225
                    modules/yahoosspBidAdapter.js on lines 232..236
                    modules/yahoosspBidAdapter.js on lines 237..241

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 54.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          case 'string':
                            if (allowedKeys.indexOf(objectKey) !== -1 && isStr(inputObject[objectKey])) {
                              outputObject[objectKey] = inputObject[objectKey];
                            };
                            break;
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 3 other locations - About 55 mins to fix
                    modules/yahoosspBidAdapter.js on lines 226..230
                    modules/yahoosspBidAdapter.js on lines 232..236
                    modules/yahoosspBidAdapter.js on lines 237..241

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 54.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          case 'array':
                            if (allowedKeys.indexOf(objectKey) !== -1 && isArray(inputObject[objectKey])) {
                              outputObject[objectKey] = inputObject[objectKey];
                            };
                            break;
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 3 other locations - About 55 mins to fix
                    modules/yahoosspBidAdapter.js on lines 221..225
                    modules/yahoosspBidAdapter.js on lines 226..230
                    modules/yahoosspBidAdapter.js on lines 237..241

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 54.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          case 'object':
                            if (allowedKeys.indexOf(objectKey) !== -1 && isPlainObject(inputObject[objectKey])) {
                              outputObject[objectKey] = inputObject[objectKey];
                            };
                            break;
                    Severity: Major
                    Found in modules/yahoosspBidAdapter.js and 3 other locations - About 55 mins to fix
                    modules/yahoosspBidAdapter.js on lines 221..225
                    modules/yahoosspBidAdapter.js on lines 226..230
                    modules/yahoosspBidAdapter.js on lines 232..236

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 54.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          source: {
                            ext: {
                              hb: 1,
                              adapterver: ADAPTER_VERSION,
                              prebidver: PREBID_VERSION,
                    Severity: Minor
                    Found in modules/yahoosspBidAdapter.js and 1 other location - About 40 mins to fix
                    modules/adtrgtmeBidAdapter.js on lines 116..127

                    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

                    There are no issues that match your filters.

                    Category
                    Status