prebid/Prebid.js

View on GitHub
modules/invibesBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File invibesBidAdapter.js has 682 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {logInfo} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {getStorageManager} from '../src/storageManager.js';

/**
Severity: Major
Found in modules/invibesBidAdapter.js - About 1 day to fix

    Function handleResponse has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    function handleResponse(responseObj, bidRequests) {
      if (bidRequests == null || bidRequests.length === 0) {
        logInfo('Invibes Adapter - No bids have been requested');
        return [];
      }
    Severity: Minor
    Found in modules/invibesBidAdapter.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 keywords has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    let keywords = (function () {
      const cap = 300;
      let headTag = document.getElementsByTagName('head')[0];
      let metaTag = headTag ? headTag.getElementsByTagName('meta') : [];
    
    
    Severity: Minor
    Found in modules/invibesBidAdapter.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 buildRequest has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function buildRequest(bidRequests, bidderRequest) {
      bidderRequest = bidderRequest || {};
      const _placementIds = [];
      const _adUnitCodes = [];
      let _customEndpoint, _userId, _domainId;
    Severity: Major
    Found in modules/invibesBidAdapter.js - About 3 hrs to fix

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

      function buildRequest(bidRequests, bidderRequest) {
        bidderRequest = bidderRequest || {};
        const _placementIds = [];
        const _adUnitCodes = [];
        let _customEndpoint, _userId, _domainId;
      Severity: Minor
      Found in modules/invibesBidAdapter.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 createBid has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      function createBid(bidRequest, requestPlacement, multipositionEnabled, usedPlacementId) {
        if (requestPlacement === null || requestPlacement.BidModel === null) {
          logInfo('Invibes Adapter - Placement not configured for bidding ' + usedPlacementId);
          return null;
        }
      Severity: Minor
      Found in modules/invibesBidAdapter.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 readGdprConsent has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      function readGdprConsent(gdprConsent) {
        if (gdprConsent && gdprConsent.vendorData) {
          invibes.GdprModuleInstalled = true;
          invibes.gdpr_consent = getVendorConsentData(gdprConsent.vendorData);
      
      
      Severity: Minor
      Found in modules/invibesBidAdapter.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 tryCopyValueToArray has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      function tryCopyValueToArray(value, target, length) {
        if (value instanceof Array) {
          for (let i = 0; i < length && i < value.length; i++) {
            target[i] = !((value[i] === false || value[i] === 'false' || value[i] == null));
          }
      Severity: Minor
      Found in modules/invibesBidAdapter.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 handleResponse has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function handleResponse(responseObj, bidRequests) {
        if (bidRequests == null || bidRequests.length === 0) {
          logInfo('Invibes Adapter - No bids have been requested');
          return [];
        }
      Severity: Major
      Found in modules/invibesBidAdapter.js - About 2 hrs to fix

        Function keywords has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        let keywords = (function () {
          const cap = 300;
          let headTag = document.getElementsByTagName('head')[0];
          let metaTag = headTag ? headTag.getElementsByTagName('meta') : [];
        
        
        Severity: Major
        Found in modules/invibesBidAdapter.js - About 2 hrs to fix

          Function createBid has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function createBid(bidRequest, requestPlacement, multipositionEnabled, usedPlacementId) {
            if (requestPlacement === null || requestPlacement.BidModel === null) {
              logInfo('Invibes Adapter - Placement not configured for bidding ' + usedPlacementId);
              return null;
            }
          Severity: Minor
          Found in modules/invibesBidAdapter.js - About 2 hrs to fix

            Function getCappedCampaignsAsString has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function getCappedCampaignsAsString() {
              const key = 'ivvcap';
            
              if (!invibes.optIn || !invibes.purposes[0]) {
                return '';
            Severity: Minor
            Found in modules/invibesBidAdapter.js - About 1 hr to fix

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

              function readGdprConsent(gdprConsent) {
                if (gdprConsent && gdprConsent.vendorData) {
                  invibes.GdprModuleInstalled = true;
                  invibes.gdpr_consent = getVendorConsentData(gdprConsent.vendorData);
              
              
              Severity: Minor
              Found in modules/invibesBidAdapter.js - About 1 hr to fix

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

                function buildSyncUrl() {
                  let syncUrl = _customUserSync || CONSTANTS.SYNC_ENDPOINT;
                  syncUrl += '?visitId=' + invibes.visitId;
                  syncUrl += '&optIn=' + invibes.optIn;
                
                
                Severity: Minor
                Found in modules/invibesBidAdapter.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 createEndpoint has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                function createEndpoint(customEndpoint, domainId, placementIds) {
                  if (customEndpoint != null) {
                    return customEndpoint;
                  }
                
                
                Severity: Minor
                Found in modules/invibesBidAdapter.js - About 45 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 getUserSync has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                function getUserSync(syncOptions) {
                  if (syncOptions.iframeEnabled) {
                    if (!(_disableUserSyncs == null || _disableUserSyncs == undefined ? CONSTANTS.DISABLE_USER_SYNC : _disableUserSyncs)) {
                      const syncUrl = buildSyncUrl();
                      return {
                Severity: Minor
                Found in modules/invibesBidAdapter.js - About 35 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Avoid too many return statements within this function.
                Open

                  return {
                    requestId: bidRequest.bidId,
                    cpm: ad.BidPrice,
                    width: bidModel.Width || size[0],
                    height: bidModel.Height || size[1],
                Severity: Major
                Found in modules/invibesBidAdapter.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

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

                    Avoid too many return statements within this function.
                    Open

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

                      Avoid too many return statements within this function.
                      Open

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

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

                        function addMeta(bidModelMeta) {
                          var meta = {};
                          if (bidModelMeta != null) {
                            for (let i = 0; i < CONSTANTS.META_TAXONOMY.length; i++) {
                              if (bidModelMeta.hasOwnProperty(CONSTANTS.META_TAXONOMY[i])) {
                        Severity: Minor
                        Found in modules/invibesBidAdapter.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

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

                        function getBiggerSize(array) {
                          let result = [0, 0];
                          for (let i = 0; i < array.length; i++) {
                            if (array[i][0] * array[i][1] > result[0] * result[1]) {
                              result = array[i];
                        Severity: Major
                        Found in modules/invibesBidAdapter.js and 1 other location - About 3 hrs to fix
                        modules/freewheel-sspBidAdapter.js on lines 34..42

                        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

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

                          if (!did) {
                            let str = invibes.getCookie('ivbsdid');
                            if (str) {
                              try {
                                let cookieLid = JSON.parse(str);
                        Severity: Major
                        Found in modules/invibesBidAdapter.js and 1 other location - About 2 hrs to fix
                        modules/invibesBidAdapter.js on lines 195..204

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 81.

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

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

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

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

                        Refactorings

                        Further Reading

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

                          if (!lid) {
                            let str = invibes.getCookie('ivbsdid');
                            if (str) {
                              try {
                                let cookieLid = JSON.parse(str);
                        Severity: Major
                        Found in modules/invibesBidAdapter.js and 1 other location - About 2 hrs to fix
                        modules/invibesBidAdapter.js on lines 577..586

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 81.

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

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

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

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

                        Refactorings

                        Further Reading

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

                        function getTopMostWindow() {
                          let res = window;
                        
                          try {
                            while (top !== res) {
                        Severity: Major
                        Found in modules/invibesBidAdapter.js and 1 other location - About 1 hr to fix
                        modules/freewheel-sspBidAdapter.js on lines 193..203

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                        function getVendorConsents(vendorData) {
                          if (vendorData.vendor && vendorData.vendor.consents) {
                            return vendorData.vendor.consents;
                          }
                        
                        
                        Severity: Major
                        Found in modules/invibesBidAdapter.js and 1 other location - About 1 hr to fix
                        modules/invibesBidAdapter.js on lines 687..697

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                        function getPurposeConsents(vendorData) {
                          if (vendorData.purpose && vendorData.purpose.consents) {
                            return vendorData.purpose.consents;
                          }
                        
                        
                        Severity: Major
                        Found in modules/invibesBidAdapter.js and 1 other location - About 1 hr to fix
                        modules/invibesBidAdapter.js on lines 716..726

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

                        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 (isNaN(parsedProp)) {
                                  target[i] = !((value[prop] === false || value[prop] === 'false' || value[prop] == null));
                                } else {
                        Severity: Minor
                        Found in modules/invibesBidAdapter.js and 1 other location - About 40 mins to fix
                        modules/invibesBidAdapter.js on lines 646..648

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 48.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            for (let i = 0; i < length && i < value.length; i++) {
                              target[i] = !((value[i] === false || value[i] === 'false' || value[i] == null));
                            }
                        Severity: Minor
                        Found in modules/invibesBidAdapter.js and 1 other location - About 40 mins to fix
                        modules/invibesBidAdapter.js on lines 660..662

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 48.

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

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

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

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

                        Refactorings

                        Further Reading

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

                          return '10000000100040008000100000000000'.replace(/[018]/g, c =>
                            (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
                          );
                        Severity: Minor
                        Found in modules/invibesBidAdapter.js and 1 other location - About 35 mins to fix
                        modules/novatiqIdSystem.js on lines 146..148

                        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