prebid/Prebid.js

View on GitHub
modules/mediagoBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File mediagoBidAdapter.js has 398 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * gulp serve --modules=mediagoBidAdapter,pubCommonId --nolint   --notest
 */

import * as utils from '../src/utils.js';
Severity: Minor
Found in modules/mediagoBidAdapter.js - About 5 hrs to fix

    Function getParam has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getParam(validBidRequests, bidderRequest) {
      const pubcid = utils.deepAccess(validBidRequests[0], 'crumbs.pubcid');
      const sharedid =
        utils.deepAccess(validBidRequests[0], 'userId.sharedid.id') ||
        utils.deepAccess(validBidRequests[0], 'userId.pubcid');
    Severity: Major
    Found in modules/mediagoBidAdapter.js - About 3 hrs to fix

      Function getItems has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getItems(validBidRequests, bidderRequest) {
        let items = [];
        items = validBidRequests.map((req, i) => {
          let ret = {};
          let mediaTypes = getProperty(req, 'mediaTypes');
      Severity: Major
      Found in modules/mediagoBidAdapter.js - About 2 hrs to fix

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

        function getParam(validBidRequests, bidderRequest) {
          const pubcid = utils.deepAccess(validBidRequests[0], 'crumbs.pubcid');
          const sharedid =
            utils.deepAccess(validBidRequests[0], 'userId.sharedid.id') ||
            utils.deepAccess(validBidRequests[0], 'userId.pubcid');
        Severity: Minor
        Found in modules/mediagoBidAdapter.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 getUserSyncs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          getUserSyncs: function (syncOptions, serverResponse, gdprConsent, uspConsent, gppConsent) {
            const origin = encodeURIComponent(location.origin || `https://${location.host}`);
            let syncParamUrl = `dm=${origin}`;
        
            if (gdprConsent && gdprConsent.consentString) {
        Severity: Minor
        Found in modules/mediagoBidAdapter.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 (items && items.length) {
            let c = {
              // TODO: fix auctionId leak: https://github.com/prebid/Prebid.js/issues/9781
              id: 'mgprebidjs_' + auctionId,
              test: +isTest,
        Severity: Critical
        Found in modules/mediagoBidAdapter.js - About 1 hr to fix

          Function isMobileAndTablet has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function isMobileAndTablet() {
            let check = false;
            (function (a) {
              let reg1 = new RegExp(
                [
          Severity: Minor
          Found in modules/mediagoBidAdapter.js - About 1 hr to fix

            Function getUserSyncs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              getUserSyncs: function (syncOptions, serverResponse, gdprConsent, uspConsent, gppConsent) {
                const origin = encodeURIComponent(location.origin || `https://${location.host}`);
                let syncParamUrl = `dm=${origin}`;
            
                if (gdprConsent && gdprConsent.consentString) {
            Severity: Minor
            Found in modules/mediagoBidAdapter.js - About 1 hr to fix

              Function getUserSyncs has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                getUserSyncs: function (syncOptions, serverResponse, gdprConsent, uspConsent, gppConsent) {
              Severity: Minor
              Found in modules/mediagoBidAdapter.js - About 35 mins to fix

                Function getPageTitle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export function getPageTitle(win = window) {
                  try {
                    const ogTitle = win.top.document.querySelector('meta[property="og:title"]')
                    return win.top.document.title || (ogTitle && ogTitle.content) || '';
                  } catch (e) {
                Severity: Minor
                Found in modules/mediagoBidAdapter.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

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

                  getUserSyncs: function (syncOptions, serverResponse, gdprConsent, uspConsent, gppConsent) {
                    const origin = encodeURIComponent(location.origin || `https://${location.host}`);
                    let syncParamUrl = `dm=${origin}`;
                
                    if (gdprConsent && gdprConsent.consentString) {
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 1 day to fix
                modules/discoveryBidAdapter.js on lines 669..706

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

                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 transformSizes(requestSizes) {
                  let sizes = [];
                  let sizeObj = {};
                
                  if (utils.isArray(requestSizes) && requestSizes.length === 2 && !utils.isArray(requestSizes[0])) {
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 1 day to fix
                modules/discoveryBidAdapter.js on lines 245..268

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

                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 isMobileAndTablet() {
                  let check = false;
                  (function (a) {
                    let reg1 = new RegExp(
                      [
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 6 hrs to fix
                modules/discoveryBidAdapter.js on lines 172..214

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

                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

                export function getPageTitle(win = window) {
                  try {
                    const ogTitle = win.top.document.querySelector('meta[property="og:title"]')
                    return win.top.document.title || (ogTitle && ogTitle.content) || '';
                  } catch (e) {
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 4 hrs to fix
                modules/discoveryBidAdapter.js on lines 75..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 126.

                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

                export function getPageDescription(win = window) {
                  let element;
                
                  try {
                    element = win.top.document.querySelector('meta[name="description"]') ||
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 4 hrs to fix
                modules/discoveryBidAdapter.js on lines 89..101

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

                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

                const mediagoAdSize = [
                  { w: 300, h: 250 },
                  { w: 300, h: 600 },
                  { w: 728, h: 90 },
                  { w: 970, h: 250 },
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 4 hrs to fix
                modules/discoveryBidAdapter.js on lines 271..281

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

                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

                function getBidFloor(bid) {
                  if (!utils.isFn(bid.getFloor)) {
                    return utils.deepAccess(bid, 'params.bidfloor', 0);
                  }
                
                
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 2 hrs to fix
                modules/discoveryBidAdapter.js on lines 223..238

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 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

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

                export function getPageKeywords(win = window) {
                  let element;
                
                  try {
                    element = win.top.document.querySelector('meta[name="keywords"]');
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 2 hrs to fix
                modules/discoveryBidAdapter.js on lines 107..117

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

                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

                function getReferrer(bidRequest = {}, bidderRequest = {}) {
                  let pageUrl;
                  if (bidRequest.params && bidRequest.params.referrer) {
                    pageUrl = bidRequest.params.referrer;
                  } else {
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 2 hrs to fix
                modules/discoveryBidAdapter.js on lines 297..305

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

                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

                export function getConnectionDownLink(win = window) {
                  const nav = win.navigator || {};
                  return nav && nav.connection && nav.connection.downlink >= 0 ? nav.connection.downlink.toString() : undefined;
                }
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 2 hrs to fix
                modules/discoveryBidAdapter.js on lines 123..126

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

                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

                        page: {
                          title: title ? title.slice(0, 100) : undefined,
                          desc: desc ? desc.slice(0, 300) : undefined,
                          keywords: keywords ? keywords.slice(0, 100) : undefined,
                          hLen: topWindow.history?.length || undefined,
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 2 hrs to fix
                modules/discoveryBidAdapter.js on lines 490..495

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

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

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

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

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

                Refactorings

                Further Reading

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

                    if (!matchSize) {
                      matchSize = sizes[0] ? { h: sizes[0].height || 0, w: sizes[0].width || 0 } : { h: 0, w: 0 };
                    }
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 1 hr to fix
                modules/discoveryBidAdapter.js on lines 383..387

                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

                    for (let size of sizes) {
                      matchSize = mediagoAdSize.find(item => size.width === item.w && size.height === item.h);
                      if (matchSize) {
                        break;
                      }
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 1 hr to fix
                modules/discoveryBidAdapter.js on lines 375..382

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

                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

                export function getCurrentTimeToUTCString() {
                  const date = new Date();
                  date.setTime(date.getTime() + COOKIE_RETENTION_TIME);
                  return date.toUTCString();
                }
                Severity: Major
                Found in modules/mediagoBidAdapter.js and 1 other location - About 1 hr to fix
                modules/discoveryBidAdapter.js on lines 311..315

                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

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

                        device: {
                          nbw: getConnectionDownLink(),
                          hc: topWindow.navigator?.hardwareConcurrency || undefined,
                          dm: topWindow.navigator?.deviceMemory || undefined,
                        }
                Severity: Minor
                Found in modules/mediagoBidAdapter.js and 1 other location - About 40 mins to fix
                modules/discoveryBidAdapter.js on lines 496..500

                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

                There are no issues that match your filters.

                Category
                Status