prebid/Prebid.js

View on GitHub
modules/outbrainBidAdapter.js

Summary

Maintainability
F
5 days
Test Coverage

File outbrainBidAdapter.js has 403 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// jshint esversion: 6, es3: false, node: true
'use strict';

import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
Severity: Minor
Found in modules/outbrainBidAdapter.js - About 5 hrs to fix

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

      buildRequests: (validBidRequests, bidderRequest) => {
        // convert Native ORTB definition to old-style prebid native definition
        validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
        const ortb2 = bidderRequest.ortb2 || {};
        const page = bidderRequest.refererInfo.page;
    Severity: Major
    Found in modules/outbrainBidAdapter.js - About 3 hrs to fix

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

        buildRequests: (validBidRequests, bidderRequest) => {
          // convert Native ORTB definition to old-style prebid native definition
          validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
          const ortb2 = bidderRequest.ortb2 || {};
          const page = bidderRequest.refererInfo.page;
      Severity: Minor
      Found in modules/outbrainBidAdapter.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 isBidRequestValid has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        isBidRequestValid: (bid) => {
          if (typeof bid.params !== 'object') {
            return false;
          }
      
      
      Severity: Minor
      Found in modules/outbrainBidAdapter.js - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

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

      function createRenderer(bid) {
        let config = {};
        let playerUrl = OUTSTREAM_RENDERER_URL;
        let render = function (bid) {
          bid.renderer.push(() => {
      Severity: Minor
      Found in modules/outbrainBidAdapter.js - About 1 hr to fix

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

          getUserSyncs: (syncOptions, responses, gdprConsent, uspConsent, gppConsent) => {
            const syncs = [];
            let syncUrl = config.getConfig('outbrain.usersyncUrl');
        
            let query = [];
        Severity: Minor
        Found in modules/outbrainBidAdapter.js - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function parseNative has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function parseNative(bid) {
          const { assets, link, privacy, eventtrackers } = JSON.parse(bid.adm);
          const result = {
            clickUrl: link.url,
            clickTrackers: link.clicktrackers || undefined
        Severity: Minor
        Found in modules/outbrainBidAdapter.js - About 1 hr to fix

          Function getNativeAssets has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function getNativeAssets(bid) {
            return _map(bid.nativeParams, (bidParams, key) => {
              const props = NATIVE_PARAMS[key];
              const asset = {
                required: bidParams.required & 1,
          Severity: Minor
          Found in modules/outbrainBidAdapter.js - About 1 hr to fix

            Function imps has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                const imps = validBidRequests.map((bid, id) => {
                  bid.netRevenue = 'net';
                  const imp = {
                    id: id + 1 + ''
                  }
            Severity: Minor
            Found in modules/outbrainBidAdapter.js - About 1 hr to fix

              Avoid too many return statements within this function.
              Open

                  return (
                    !!config.getConfig('outbrain.bidderUrl') &&
                    (!!(bid.nativeParams || bid.sizes) || isValidVideoRequest(bid))
                  );
              Severity: Major
              Found in modules/outbrainBidAdapter.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

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

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

                  function transformSizes(requestSizes) {
                    if (!isArray(requestSizes)) {
                      return [];
                    }
                  
                  
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 1 other location - About 6 hrs to fix
                  modules/codefuelBidAdapter.js on lines 165..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 155.

                  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

                  const NATIVE_PARAMS = {
                    title: { id: 0, name: 'title' },
                    icon: { id: 2, type: 1, name: 'img' },
                    image: { id: 3, type: 3, name: 'img' },
                    sponsoredBy: { id: 5, name: 'data', type: 1 },
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 3 other locations - About 4 hrs to fix
                  modules/adotBidAdapter.js on lines 35..42
                  modules/dianomiBidAdapter.js on lines 31..61
                  modules/gothamadsBidAdapter.js on lines 23..53

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 129.

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

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

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

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

                  Refactorings

                  Further Reading

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

                      if (!!bid.params.bcat && (typeof bid.params.bcat !== 'object' || !bid.params.bcat.every(item => typeof item === 'string'))) {
                        return false;
                      }
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 1 other location - About 1 hr to fix
                  modules/outbrainBidAdapter.js on lines 52..54

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 72.

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

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

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

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

                  Refactorings

                  Further Reading

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

                      if (!!bid.params.badv && (typeof bid.params.badv !== 'object' || !bid.params.badv.every(item => typeof item === 'string'))) {
                        return false;
                      }
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 1 other location - About 1 hr to fix
                  modules/outbrainBidAdapter.js on lines 48..50

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 72.

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

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

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

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

                  Refactorings

                  Further Reading

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

                        if (aRatios && aRatios[0]) {
                          aRatios = aRatios[0];
                          wmin = aRatios.min_width || 0;
                          hmin = aRatios.ratio_height * wmin / aRatios.ratio_width | 0;
                        }
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 4 other locations - About 1 hr to fix
                  modules/dianomiBidAdapter.js on lines 155..159
                  modules/gothamadsBidAdapter.js on lines 270..274
                  modules/revcontentBidAdapter.js on lines 247..251
                  modules/seedingAllianceBidAdapter.js on lines 58..62

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

                      const bidResponses = flatten(seatbid.map(seat => seat.bid)).reduce((result, bid) => {
                        result[bid.impid - 1] = bid;
                        return result;
                      }, []);
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 3 other locations - About 1 hr to fix
                  modules/adfBidAdapter.js on lines 200..203
                  modules/codefuelBidAdapter.js on lines 101..104
                  modules/dianomiBidAdapter.js on lines 252..255

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

                  function setOnAny(collection, key) {
                    for (let i = 0, result; i < collection.length; i++) {
                      result = deepAccess(collection[i], key);
                      if (result) {
                        return result;
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 5 other locations - About 1 hr to fix
                  modules/adfBidAdapter.js on lines 256..263
                  modules/carodaBidAdapter.js on lines 132..139
                  modules/codefuelBidAdapter.js on lines 151..158
                  modules/dianomiBidAdapter.js on lines 358..365
                  modules/finativeBidAdapter.js on lines 227..234

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

                        if (bidParams.sizes) {
                          const sizes = flatten(bidParams.sizes);
                          w = parseInt(sizes[0], 10);
                          h = parseInt(sizes[1], 10);
                        }
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 1 other location - About 1 hr to fix
                  modules/seedingAllianceBidAdapter.js on lines 64..68

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

                  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 (gdprConsent) {
                          query.push('gdpr=' + (gdprConsent.gdprApplies & 1));
                          query.push('gdpr_consent=' + encodeURIComponent(gdprConsent.consentString || ''));
                        }
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 1 other location - About 1 hr to fix
                  modules/adxcgBidAdapter.js on lines 69..72

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

                  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

                        asset[props.name] = {
                          len: bidParams.len,
                          type: props.type,
                          wmin,
                          hmin,
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 3 other locations - About 55 mins to fix
                  modules/dianomiBidAdapter.js on lines 167..174
                  modules/revcontentBidAdapter.js on lines 253..260
                  modules/seedingAllianceBidAdapter.js on lines 75..82

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

                    if (typeof floorInfo === 'object' && floorInfo.currency === CURRENCY && !isNaN(parseFloat(floorInfo.floor))) {
                      return parseFloat(floorInfo.floor);
                    }
                  Severity: Minor
                  Found in modules/outbrainBidAdapter.js and 1 other location - About 55 mins to fix
                  modules/impactifyBidAdapter.js on lines 100..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 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 6 locations. Consider refactoring.
                  Open

                          } else if (type === BANNER) {
                            bidObject.ad = bidResponse.adm;
                            bidObject.width = bidResponse.w;
                            bidObject.height = bidResponse.h;
                          } else if (type === VIDEO) {
                  Severity: Major
                  Found in modules/outbrainBidAdapter.js and 5 other locations - About 40 mins to fix
                  modules/exadsBidAdapter.js on lines 273..277
                  modules/h12mediaBidAdapter.js on lines 116..120
                  modules/operaadsBidAdapter.js on lines 374..379
                  modules/staqAnalyticsAdapter.js on lines 199..204
                  src/videoCache.js on lines 80..84

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 49.

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

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

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

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

                  Refactorings

                  Further Reading

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

                    onBidWon: (bid) => {
                      // for native requests we put the nurl as an imp tracker, otherwise if the auction takes place on prebid server
                      // the server JS adapter puts the nurl in the adm as a tracking pixel and removes the attribute
                      if (bid.nurl) {
                        ajax(replaceAuctionPrice(bid.nurl, bid.originalCpm))
                  Severity: Minor
                  Found in modules/outbrainBidAdapter.js and 1 other location - About 30 mins to fix
                  modules/adxcgBidAdapter.js on lines 85..91

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

                  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