prebid/Prebid.js

View on GitHub
modules/winrBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File winrBidAdapter.js has 459 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  deepAccess,
  getBidRequest,
  getParameterByName,
  isArray,
Severity: Minor
Found in modules/winrBidAdapter.js - About 7 hrs to fix

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

      buildRequests: function (bidRequests, bidderRequest) {
        const tags = bidRequests.map(bidToTag);
        const userObjBid = find(bidRequests, hasUserInfo);
        let userObj = {};
        if (config.getConfig('coppa') === true) {
    Severity: Major
    Found in modules/winrBidAdapter.js - About 4 hrs to fix

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

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

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

          buildRequests: function (bidRequests, bidderRequest) {
            const tags = bidRequests.map(bidToTag);
            const userObjBid = find(bidRequests, hasUserInfo);
            let userObj = {};
            if (config.getConfig('coppa') === true) {
        Severity: Minor
        Found in modules/winrBidAdapter.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 wrapAd has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function wrapAd(bid, position) {
          return `<!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
        Severity: Major
        Found in modules/winrBidAdapter.js - About 2 hrs to fix

          Function bidToTag has 43 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: Minor
          Found in modules/winrBidAdapter.js - About 1 hr to fix

            Function bidToTag has a Cognitive Complexity of 11 (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/winrBidAdapter.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 too many return statements within this function.
            Open

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

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

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

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

              function transformSizes(requestSizes) {
                let sizes = [];
                let sizeObj = {};
              
                if (
              Severity: Major
              Found in modules/winrBidAdapter.js and 4 other locations - About 1 day to fix
              modules/adrelevantisBidAdapter.js on lines 498..518
              modules/appnexusBidAdapter.js on lines 975..995
              modules/goldbachBidAdapter.js on lines 870..890
              modules/mediafuseBidAdapter.js on lines 857..877

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

                  if (bidRequests[0].userId) {
                    let eids = [];
              
                    addUserId(eids, deepAccess(bidRequests[0], `userId.criteoId`), 'criteo.com', null);
                    addUserId(eids, deepAccess(bidRequests[0], `userId.netId`), 'netid.de', null);
              Severity: Major
              Found in modules/winrBidAdapter.js and 2 other locations - About 6 hrs to fix
              modules/goldbachBidAdapter.js on lines 273..285
              modules/mediafuseBidAdapter.js on lines 273..285

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 165.

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

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

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

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

              Refactorings

              Further Reading

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

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

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 129.

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

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

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

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

              Refactorings

              Further Reading

              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 (
              Severity: Major
              Found in modules/winrBidAdapter.js and 3 other locations - About 4 hrs to fix
              modules/adrelevantisBidAdapter.js on lines 174..185
              modules/craftBidAdapter.js on lines 84..95
              modules/goldbachBidAdapter.js on lines 349..360

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 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 collects everything it finds, except for canonicalUrl
                      rd_ref: encodeURIComponent(bidderRequest.refererInfo.topmostLocation),
                      rd_top: bidderRequest.refererInfo.reachedTop,
              Severity: Major
              Found in modules/winrBidAdapter.js and 4 other locations - About 4 hrs to fix
              modules/adrelevantisBidAdapter.js on lines 135..144
              modules/goldbachBidAdapter.js on lines 252..261
              modules/mediafuseBidAdapter.js on lines 252..261
              modules/pixfutureBidAdapter.js on lines 93..102

              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/winrBidAdapter.js and 4 other locations - About 3 hrs to fix
              modules/adrelevantisBidAdapter.js on lines 96..101
              modules/appnexusBidAdapter.js on lines 179..184
              modules/goldbachBidAdapter.js on lines 161..166
              modules/mediafuseBidAdapter.js on lines 147..152

              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

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

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 82.

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

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

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

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

              Refactorings

              Further Reading

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

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

              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/winrBidAdapter.js and 4 other locations - About 1 hr to fix
              modules/adrelevantisBidAdapter.js on lines 105..109
              modules/appnexusBidAdapter.js on lines 188..192
              modules/goldbachBidAdapter.js on lines 170..174
              modules/mediafuseBidAdapter.js on lines 156..160

              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/winrBidAdapter.js and 4 other locations - About 1 hr to fix
              modules/adrelevantisBidAdapter.js on lines 530..535
              modules/appnexusBidAdapter.js on lines 1064..1069
              modules/goldbachBidAdapter.js on lines 906..911
              modules/mediafuseBidAdapter.js on lines 893..898

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

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

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 62.

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

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

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

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

              Refactorings

              Further Reading

              Identical blocks of code found in 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/winrBidAdapter.js and 1 other location - About 1 hr to fix
              modules/adrelevantisBidAdapter.js on lines 127..133

              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/winrBidAdapter.js and 6 other locations - About 55 mins to fix
              modules/adrelevantisBidAdapter.js on lines 537..539
              modules/appnexusBidAdapter.js on lines 1144..1146
              modules/craftBidAdapter.js on lines 178..180
              modules/goldbachBidAdapter.js on lines 986..988
              modules/mediafuseBidAdapter.js on lines 973..975
              modules/targetVideoBidAdapter.js on lines 192..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 53.

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

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

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

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

              Refactorings

              Further Reading

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

                if (rtbBid.advertiser_id) {
                  bid.meta = Object.assign({}, bid.meta, {
                    advertiserId: rtbBid.advertiser_id,
                  });
                }
              Severity: Major
              Found in modules/winrBidAdapter.js and 5 other locations - About 35 mins to fix
              modules/adrelevantisBidAdapter.js on lines 301..303
              modules/appnexusBidAdapter.js on lines 615..617
              modules/appnexusBidAdapter.js on lines 639..641
              modules/goldbachBidAdapter.js on lines 586..588
              modules/mediafuseBidAdapter.js on lines 570..572

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 47.

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

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

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

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

              Refactorings

              Further Reading

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

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

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 46.

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

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

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

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

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status