prebid/Prebid.js

View on GitHub
modules/zeta_global_sspBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

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

  buildRequests: function (validBidRequests, bidderRequest) {
    const secure = 1; // treat all requests as secure
    const params = validBidRequests[0].params;
    const imps = validBidRequests.map(request => {
      const impData = {
Severity: Minor
Found in modules/zeta_global_sspBidAdapter.js - About 1 day 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

File zeta_global_sspBidAdapter.js has 357 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {deepAccess, deepSetValue, isArray, isBoolean, isNumber, isStr, logWarn} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import {parseDomain} from '../src/refererDetection.js';
Severity: Minor
Found in modules/zeta_global_sspBidAdapter.js - About 4 hrs to fix

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

      buildRequests: function (validBidRequests, bidderRequest) {
        const secure = 1; // treat all requests as secure
        const params = validBidRequests[0].params;
        const imps = validBidRequests.map(request => {
          const impData = {
    Severity: Major
    Found in modules/zeta_global_sspBidAdapter.js - About 4 hrs to fix

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

      function cropPage(page) {
        if (page) {
          if (page.length > 100) {
            page = page.substring(0, 100);
          }
      Severity: Minor
      Found in modules/zeta_global_sspBidAdapter.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 imps has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          const imps = validBidRequests.map(request => {
            const impData = {
              id: request.bidId,
              secure: secure
            };
      Severity: Minor
      Found in modules/zeta_global_sspBidAdapter.js - About 1 hr to fix

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

          interpretResponse: function (serverResponse, bidRequest) {
            let bidResponses = [];
            const response = (serverResponse || {}).body;
            if (response && response.seatbid && response.seatbid[0].bid && response.seatbid[0].bid.length) {
              response.seatbid.forEach(zetaSeatbid => {
        Severity: Minor
        Found in modules/zeta_global_sspBidAdapter.js - About 1 hr to fix

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

          function provideSegments(bidderRequest, payload) {
            const data = bidderRequest.ortb2?.user?.data;
            if (isArray(data)) {
              const segments = data.filter(d => d?.segment).map(d => d.segment).filter(s => isArray(s)).flatMap(s => s).filter(s => s?.id);
              if (segments.length > 0) {
          Severity: Minor
          Found in modules/zeta_global_sspBidAdapter.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 getUserSyncs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            getUserSyncs: (syncOptions, responses, gdprConsent, uspConsent) => {
              let syncurl = '';
          
              // Attaching GDPR Consent Params in UserSync url
              if (gdprConsent) {
          Severity: Minor
          Found in modules/zeta_global_sspBidAdapter.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 clearEmpties has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function clearEmpties(o) {
            for (let k in o) {
              if (o[k] === null) {
                delete o[k];
                continue;
          Severity: Minor
          Found in modules/zeta_global_sspBidAdapter.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 buildVideo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function buildVideo(request) {
            let video = {};
            const videoParams = deepAccess(request, 'mediaTypes.video', {});
            for (const key in VIDEO_CUSTOM_PARAMS) {
              if (videoParams.hasOwnProperty(key)) {
          Severity: Minor
          Found in modules/zeta_global_sspBidAdapter.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

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

          function provideMediaType(zetaBid, bid, bidRequest) {
            if (zetaBid.ext && zetaBid.ext.prebid && zetaBid.ext.prebid.type) {
              bid.mediaType = zetaBid.ext.prebid.type === VIDEO ? VIDEO : BANNER;
            } else {
              bid.mediaType = bidRequest.imp[0].video ? VIDEO : BANNER;
          Severity: Minor
          Found in modules/zeta_global_sspBidAdapter.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 buildVideo(request) {
            let video = {};
            const videoParams = deepAccess(request, 'mediaTypes.video', {});
            for (const key in VIDEO_CUSTOM_PARAMS) {
              if (videoParams.hasOwnProperty(key)) {
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 1 day to fix
          modules/zmaticooBidAdapter.js on lines 242..260

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

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

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

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

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

          Refactorings

          Further Reading

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

          const VIDEO_CUSTOM_PARAMS = {
            'mimes': DATA_TYPES.ARRAY,
            'minduration': DATA_TYPES.NUMBER,
            'maxduration': DATA_TYPES.NUMBER,
            'startdelay': DATA_TYPES.NUMBER,
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 2 other locations - About 5 hrs to fix
          modules/pubmaticBidAdapter.js on lines 47..64
          modules/zmaticooBidAdapter.js on lines 22..39

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

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

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

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

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

          Refactorings

          Further Reading

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

                if (typeof request.getFloor === 'function') {
                  const floorInfo = request.getFloor({
                    currency: 'USD',
                    mediaType: impData.video ? 'video' : 'banner',
                    size: [ impData.video ? impData.video.w : impData.banner.w, impData.video ? impData.video.h : impData.banner.h ]
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 5 hrs to fix
          modules/zmaticooBidAdapter.js on lines 105..114

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

          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 checkParamDataType(key, value, datatype) {
            let functionToExecute;
            switch (datatype) {
              case DATA_TYPES.BOOLEAN:
                functionToExecute = isBoolean;
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 4 hrs to fix
          modules/zmaticooBidAdapter.js on lines 262..283

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

          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

                    let bid = {
                      requestId: zetaBid.impid,
                      cpm: zetaBid.price,
                      currency: response.cur,
                      width: zetaBid.w,
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 2 hrs to fix
          modules/zetaBidAdapter.js on lines 141..151

          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 (bidderRequest.ortb2?.user?.geo) {
                  payload.user.geo = payload.device.geo = { ...payload.user.geo, ...bidderRequest.ortb2?.user.geo };
                }
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 1 hr to fix
          modules/zeta_global_sspBidAdapter.js on lines 157..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 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

                if (bidderRequest.ortb2?.device?.geo) {
                  payload.user.geo = payload.device.geo = { ...payload.user.geo, ...bidderRequest.ortb2?.device.geo };
                }
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 1 hr to fix
          modules/zeta_global_sspBidAdapter.js on lines 154..156

          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

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

                if (request.mediaTypes) {
                  for (const mediaType in request.mediaTypes) {
                    switch (mediaType) {
                      case BANNER:
                        impData.banner = buildBanner(request);
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 1 hr to fix
          modules/zmaticooBidAdapter.js on lines 93..104

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 72.

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

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

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

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

          Refactorings

          Further Reading

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

              if (bidderRequest && bidderRequest.gdprConsent) {
                deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString);
                deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0));
              }
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 4 other locations - About 1 hr to fix
          modules/adtrueBidAdapter.js on lines 520..523
          modules/distroscaleBidAdapter.js on lines 205..208
          modules/pubmaticBidAdapter.js on lines 1220..1223
          modules/pubwiseBidAdapter.js on lines 262..265

          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

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

              if (syncOptions.iframeEnabled) {
                return [{
                  type: 'iframe',
                  url: USER_SYNC_URL_IFRAME + syncurl
                }];
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 1 hr to fix
          modules/pubmaticBidAdapter.js on lines 1460..1470

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 55.

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

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

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

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

          Refactorings

          Further Reading

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

              if (gdprConsent) {
                syncurl += '&gdpr=' + (gdprConsent.gdprApplies ? 1 : 0);
                syncurl += '&gdpr_consent=' + encodeURIComponent(gdprConsent.consentString || '');
              }
          Severity: Major
          Found in modules/zeta_global_sspBidAdapter.js and 2 other locations - About 1 hr to fix
          modules/adyoulikeBidAdapter.js on lines 200..203
          modules/pubmaticBidAdapter.js on lines 1439..1442

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 55.

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

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

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

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

          Refactorings

          Further Reading

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

              if (response && response.seatbid && response.seatbid[0].bid && response.seatbid[0].bid.length) {
                response.seatbid.forEach(zetaSeatbid => {
                  const seat = zetaSeatbid.seat;
                  zetaSeatbid.bid.forEach(zetaBid => {
                    let bid = {
          Severity: Minor
          Found in modules/zeta_global_sspBidAdapter.js and 1 other location - About 35 mins to fix
          modules/automatadBidAdapter.js on lines 87..111

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 46.

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

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

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

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

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status