prebid/Prebid.js

View on GitHub
modules/mediakeysBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File mediakeysBidAdapter.js has 566 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {arrayFrom, find} from '../src/polyfill.js';
import {
  cleanObj,
  deepAccess,
  deepClone,
Severity: Major
Found in modules/mediakeysBidAdapter.js - About 1 day to fix

    Function createNativeImp has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    function createNativeImp(bid) {
      if (!bid.nativeParams) {
        logWarn(`${BIDDER_CODE}: bid.nativeParams object has not been found.`);
        return
      }
    Severity: Minor
    Found in modules/mediakeysBidAdapter.js - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function createNativeImp has 109 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createNativeImp(bid) {
      if (!bid.nativeParams) {
        logWarn(`${BIDDER_CODE}: bid.nativeParams object has not been found.`);
        return
      }
    Severity: Major
    Found in modules/mediakeysBidAdapter.js - About 4 hrs to fix

      Function nativeBidResponseHandler has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function nativeBidResponseHandler(bid) {
        const nativeAdm = JSON.parse(bid.adm);
        if (!nativeAdm || !nativeAdm.assets.length) {
          logError(`${BIDDER_CODE}: invalid native response.`);
          return;
      Severity: Major
      Found in modules/mediakeysBidAdapter.js - About 2 hrs to fix

        ORTB_VIDEO_PARAMS has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        const ORTB_VIDEO_PARAMS = {
          mimes: value => Array.isArray(value) && value.length > 0 && value.every(v => typeof v === 'string'),
          minduration: value => isInteger(value),
          maxduration: value => isInteger(value),
          protocols: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].indexOf(v) !== -1),
        Severity: Minor
        Found in modules/mediakeysBidAdapter.js - About 2 hrs to fix

          Function interpretResponse has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            interpretResponse(serverResponse, bidRequest) {
              const bidResponses = [];
          
              try {
                if (serverResponse.body && serverResponse.body.seatbid && isArray(serverResponse.body.seatbid)) {
          Severity: Major
          Found in modules/mediakeysBidAdapter.js - About 2 hrs to fix

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

              buildRequests: function(validBidRequests, bidderRequest) {
                // convert Native ORTB definition to old-style prebid native definition
                validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
            
                const payload = createOrtbTemplate();
            Severity: Minor
            Found in modules/mediakeysBidAdapter.js - About 2 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

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

              buildRequests: function(validBidRequests, bidderRequest) {
                // convert Native ORTB definition to old-style prebid native definition
                validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
            
                const payload = createOrtbTemplate();
            Severity: Minor
            Found in modules/mediakeysBidAdapter.js - About 2 hrs to fix

              Function createImp has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              function createImp(bid) {
                const imp = {
                  id: bid.bidId,
                  tagid: bid.params.adUnit || undefined,
                  bidfloorcur: DEFAULT_CURRENCY,
              Severity: Minor
              Found in modules/mediakeysBidAdapter.js - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Consider simplifying this complex logical expression.
              Open

                    if (serverResponse.body && serverResponse.body.seatbid && isArray(serverResponse.body.seatbid)) {
                      const currency = serverResponse.body.cur || DEFAULT_CURRENCY;
                      const referrer = bidRequest.site && bidRequest.site.ref ? bidRequest.site.ref : '';
              
                      serverResponse.body.seatbid.forEach(bidderSeat => {
              Severity: Critical
              Found in modules/mediakeysBidAdapter.js - About 1 hr to fix

                Function createImp has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function createImp(bid) {
                  const imp = {
                    id: bid.bidId,
                    tagid: bid.params.adUnit || undefined,
                    bidfloorcur: DEFAULT_CURRENCY,
                Severity: Minor
                Found in modules/mediakeysBidAdapter.js - About 1 hr to fix

                  Function createOrtbTemplate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function createOrtbTemplate() {
                    return {
                      id: '',
                      at: AUCTION_TYPE,
                      cur: [DEFAULT_CURRENCY],
                  Severity: Minor
                  Found in modules/mediakeysBidAdapter.js - About 1 hr to fix

                    Function nativeBidResponseHandler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function nativeBidResponseHandler(bid) {
                      const nativeAdm = JSON.parse(bid.adm);
                      if (!nativeAdm || !nativeAdm.assets.length) {
                        logError(`${BIDDER_CODE}: invalid native response.`);
                        return;
                    Severity: Minor
                    Found in modules/mediakeysBidAdapter.js - About 55 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 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      interpretResponse(serverResponse, bidRequest) {
                        const bidResponses = [];
                    
                        try {
                          if (serverResponse.body && serverResponse.body.seatbid && isArray(serverResponse.body.seatbid)) {
                    Severity: Minor
                    Found in modules/mediakeysBidAdapter.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

                      if (navigator.appVersion.indexOf('X11') != -1) return 'Unix';
                    Severity: Major
                    Found in modules/mediakeysBidAdapter.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        if (navigator.userAgent.indexOf('Linux') != -1) return 'Linux';
                      Severity: Major
                      Found in modules/mediakeysBidAdapter.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return 'Others';
                        Severity: Major
                        Found in modules/mediakeysBidAdapter.js - About 30 mins to fix

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

                          function getOS() {
                            if (navigator.userAgent.indexOf('Android') != -1) return 'Android';
                            if (navigator.userAgent.indexOf('like Mac') != -1) return 'iOS';
                            if (navigator.userAgent.indexOf('Win') != -1) return 'Windows';
                            if (navigator.userAgent.indexOf('Mac') != -1) return 'Macintosh';
                          Severity: Minor
                          Found in modules/mediakeysBidAdapter.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 2 locations. Consider refactoring.
                          Open

                          function getOS() {
                            if (navigator.userAgent.indexOf('Android') != -1) return 'Android';
                            if (navigator.userAgent.indexOf('like Mac') != -1) return 'iOS';
                            if (navigator.userAgent.indexOf('Win') != -1) return 'Windows';
                            if (navigator.userAgent.indexOf('Mac') != -1) return 'Macintosh';
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 6 hrs to fix
                          modules/pubxaiAnalyticsAdapter.js on lines 132..140

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

                          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

                              nativeAdm.eventtrackers.forEach(tracker => {
                                // Only Impression events are supported. Prebid does not support Viewability events yet.
                                if (tracker.event !== 1) {
                                  return;
                                }
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 5 hrs to fix
                          modules/adagioBidAdapter.js on lines 526..549

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

                          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 getHighestFloor(bid) {
                            const floors = [];
                          
                            for (let mediaType in bid.mediaTypes) {
                              const floor = getFloor(bid, mediaType);
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 3 hrs to fix
                          modules/mediasniperBidAdapter.js on lines 270..288

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

                          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

                            Object.keys(ORTB_VIDEO_PARAMS).forEach(name => {
                              if (videoParams.hasOwnProperty(name)) {
                                if (ORTB_VIDEO_PARAMS[name](videoParams[name])) {
                                  video[name] = videoParams[name];
                                } else {
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 3 hrs to fix
                          modules/mediakeysBidAdapter.js on lines 270..278

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

                          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

                            Object.keys(ORTB_NATIVE_PARAMS).forEach(name => {
                              if (extraParams.hasOwnProperty(name)) {
                                if (ORTB_NATIVE_PARAMS[name](extraParams[name])) {
                                  nativeObject[name] = extraParams[name];
                                } else {
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 3 hrs to fix
                          modules/mediakeysBidAdapter.js on lines 412..420

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

                          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 (Array.isArray(videoAdUnitParams.playerSize)) {
                              const tempSize = (Array.isArray(videoAdUnitParams.playerSize[0])) ? videoAdUnitParams.playerSize[0] : videoAdUnitParams.playerSize;
                              computedParams.w = tempSize[0];
                              computedParams.h = tempSize[1];
                            }
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 2 hrs to fix
                          modules/adagioBidAdapter.js on lines 430..434

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

                          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

                              sizes.forEach(function (size) {
                                if (size.length && size.length > 1) {
                                  format.push({w: size[0], h: size[1]});
                                }
                              });
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 1 hr to fix
                          modules/mediasniperBidAdapter.js on lines 306..310

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

                          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

                            onBidWon: function (bid) {
                              if (!bid.burl) {
                                return;
                              }
                          
                          
                          Severity: Major
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 1 hr to fix
                          modules/mediasniperBidAdapter.js on lines 151..159

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 56.

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

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

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

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

                          Refactorings

                          Further Reading

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

                            playbackmethod: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6].indexOf(v) !== -1),
                          Severity: Minor
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 55 mins to fix
                          modules/mediakeysBidAdapter.js on lines 83..83

                          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

                            api: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6].indexOf(v) !== -1),
                          Severity: Minor
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 55 mins to fix
                          modules/mediakeysBidAdapter.js on lines 79..79

                          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

                                  case 'image':
                                    asset.img = {
                                      type: internalNativeAsset.type,
                                      mimes: param.mimes,
                                      ext: param.ext,
                          Severity: Minor
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 50 mins to fix
                          modules/mediakeysBidAdapter.js on lines 342..350

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 52.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  case 'icon':
                                    asset.img = {
                                      type: internalNativeAsset.type,
                                      mimes: param.mimes,
                                      ext: param.ext,
                          Severity: Minor
                          Found in modules/mediakeysBidAdapter.js and 1 other location - About 50 mins to fix
                          modules/mediakeysBidAdapter.js on lines 332..341

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 52.

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

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

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

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

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status