prebid/Prebid.js

View on GitHub
modules/adrelevantisBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File adrelevantisBidAdapter.js has 492 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {Renderer} from '../src/Renderer.js';
import {
  createTrackPixelHtml,
  deepAccess,
  deepClone,
Severity: Minor
Found in modules/adrelevantisBidAdapter.js - About 7 hrs to fix

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

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

    Cognitive Complexity

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

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

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

    Further reading

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

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

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

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

        Function buildRequests has 66 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/adrelevantisBidAdapter.js - About 2 hrs to fix

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

          function newBid(serverBid, rtbBid, bidderRequest) {
            const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]);
            const bid = {
              requestId: serverBid.uuid,
              cpm: rtbBid.cpm,
          Severity: Minor
          Found in modules/adrelevantisBidAdapter.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 buildRequests has a Cognitive Complexity of 12 (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/adrelevantisBidAdapter.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

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

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

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

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

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

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

          Refactorings

          Further Reading

          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/adrelevantisBidAdapter.js and 4 other locations - About 1 day to fix
          modules/appnexusBidAdapter.js on lines 975..995
          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

          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/adrelevantisBidAdapter.js and 3 other locations - About 7 hrs to fix
          modules/appnexusBidAdapter.js on lines 558..582
          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

          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/adrelevantisBidAdapter.js and 2 other locations - About 5 hrs to fix
          modules/appnexusBidAdapter.js on lines 798..807
          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 3 locations. Consider refactoring.
          Open

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 130.

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

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

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

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

          Refactorings

          Further Reading

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

              if (serverResponse.tags) {
                serverResponse.tags.forEach(serverBid => {
                  const rtbBid = getRtbBid(serverBid);
                  if (rtbBid) {
                    if (rtbBid.cpm !== 0 && includes(this.supportedMediaTypes, rtbBid.ad_type)) {
          Severity: Major
          Found in modules/adrelevantisBidAdapter.js and 3 other locations - About 4 hrs to fix
          modules/craftBidAdapter.js on lines 86..97
          modules/goldbachBidAdapter.js on lines 350..361
          modules/winrBidAdapter.js on lines 286..300

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

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

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

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

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

          Refactorings

          Further Reading

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

              if (bidderRequest && bidderRequest.refererInfo) {
                let refererinfo = {
                  // TODO: this sends everything it finds to the backend, except for canonicalUrl
                  rd_ref: encodeURIComponent(bidderRequest.refererInfo.topmostLocation),
                  rd_top: bidderRequest.refererInfo.reachedTop,
          Severity: Major
          Found in modules/adrelevantisBidAdapter.js and 4 other locations - About 4 hrs to fix
          modules/goldbachBidAdapter.js on lines 253..262
          modules/mediafuseBidAdapter.js on lines 254..263
          modules/pixfutureBidAdapter.js on lines 93..102
          modules/winrBidAdapter.js on lines 233..244

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 116.

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

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

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

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

          Refactorings

          Further Reading

          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/adrelevantisBidAdapter.js and 4 other locations - About 3 hrs to fix
          modules/appnexusBidAdapter.js on lines 179..184
          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 4 locations. Consider refactoring.
          Open

          const NATIVE_MAPPING = {
            body: 'description',
            body2: 'desc2',
            cta: 'ctatext',
            image: {
          Severity: Major
          Found in modules/adrelevantisBidAdapter.js and 3 other locations - About 2 hrs to fix
          modules/appnexusBidAdapter.js on lines 83..99
          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/adrelevantisBidAdapter.js and 3 other locations - About 2 hrs to fix
          modules/appnexusBidAdapter.js on lines 401..406
          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 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/adrelevantisBidAdapter.js and 4 other locations - About 1 hr to fix
          modules/appnexusBidAdapter.js on lines 188..192
          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/adrelevantisBidAdapter.js and 4 other locations - About 1 hr to fix
          modules/appnexusBidAdapter.js on lines 1064..1069
          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

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 65.

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

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

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

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

          Refactorings

          Further Reading

          Identical blocks of code found in 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/adrelevantisBidAdapter.js and 4 other locations - About 1 hr to fix
          modules/appnexusBidAdapter.js on lines 1232..1241
          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

              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/adrelevantisBidAdapter.js and 1 other location - About 1 hr to fix
          modules/winrBidAdapter.js on lines 221..227

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

          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/adrelevantisBidAdapter.js and 6 other locations - About 55 mins to fix
          modules/appnexusBidAdapter.js on lines 1144..1146
          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 2 locations. Consider refactoring.
          Open

              try {
                const url = rtbBid.rtb.trackers[0].impression_urls[0];
                const tracker = createTrackPixelHtml(url);
                bid.ad += tracker;
              } catch (error) {
          Severity: Minor
          Found in modules/adrelevantisBidAdapter.js and 1 other location - About 50 mins to fix
          modules/goldbachBidAdapter.js on lines 713..717

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 52.

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

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

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

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

          Refactorings

          Further Reading

          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/adrelevantisBidAdapter.js and 5 other locations - About 35 mins to fix
          modules/appnexusBidAdapter.js on lines 615..617
          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

          There are no issues that match your filters.

          Category
          Status