prebid/Prebid.js

View on GitHub

Showing 5,479 of 5,479 total issues

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

export const utiqSubmodule = {
  /**
   * Used to link submodule with config
   * @type {string}
   */
Severity: Major
Found in modules/utiqSystem.js and 1 other location - About 2 days to fix
modules/utiqMtpIdSystem.js on lines 59..136

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

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 const utiqMtpIdSubmodule = {
  /**
   * Used to link submodule with config
   * @type {string}
   */
Severity: Major
Found in modules/utiqMtpIdSystem.js and 1 other location - About 2 days to fix
modules/utiqSystem.js on lines 59..136

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

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

  getUserSyncs: function (syncOptions, serverResponses, gdprConsent, uspConsent) {
    const syncs = [];
    let gdprApplies = false;
    let consentString = '';
    let uspConsentString = '';
Severity: Major
Found in modules/gamoshiBidAdapter.js and 1 other location - About 2 days to fix
modules/cleanmedianetBidAdapter.js on lines 250..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 477.

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

  getUserSyncs: function (syncOptions, serverResponses, gdprConsent, uspConsent) {
    const syncs = [];
    let gdprApplies = false;
    let consentString = '';
    let uspConsentString = '';
Severity: Major
Found in modules/cleanmedianetBidAdapter.js and 1 other location - About 2 days to fix
modules/gamoshiBidAdapter.js on lines 250..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 477.

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

File appnexusBidAdapter.js has 1077 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  createTrackPixelHtml,
  deepAccess,
  deepClone,
  getBidRequest,
Severity: Major
Found in modules/appnexusBidAdapter.js - About 2 days to fix

    Function MarsmediaAdapter has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
    Open

    function MarsmediaAdapter() {
      this.code = 'marsmedia';
      this.aliases = ['mars'];
      this.supportedMediaTypes = [VIDEO, BANNER];
    
    
    Severity: Minor
    Found in modules/marsmediaBidAdapter.js - About 2 days 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 ozoneBidAdapter.js has 1046 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      logInfo,
      logError,
      deepAccess,
      logWarn,
    Severity: Major
    Found in modules/ozoneBidAdapter.js - About 2 days to fix

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

        if (rtbBid.rtb.video) {
          // shared video properties used for all 3 contexts
          Object.assign(bid, {
            width: rtbBid.rtb.video.player_width,
            height: rtbBid.rtb.video.player_height,
      Severity: Major
      Found in modules/goldbachBidAdapter.js and 1 other location - About 2 days to fix
      modules/mediafuseBidAdapter.js on lines 601..708

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

      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 (rtbBid.rtb.video) {
          // shared video properties used for all 3 contexts
          Object.assign(bid, {
            width: rtbBid.rtb.video.player_width,
            height: rtbBid.rtb.video.player_height,
      Severity: Major
      Found in modules/mediafuseBidAdapter.js and 1 other location - About 2 days to fix
      modules/goldbachBidAdapter.js on lines 616..721

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

      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 _createBannerRequest(bid) {
        var sizes = bid.mediaTypes.banner.sizes;
        var format = [];
        var bannerObj;
        if (sizes !== UNDEFINED && isArray(sizes)) {
      Severity: Major
      Found in modules/pubmaticBidAdapter.js and 1 other location - About 2 days to fix
      modules/adtrueBidAdapter.js on lines 275..314

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

      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 _createBannerRequest(bid) {
        var sizes = bid.mediaTypes.banner.sizes;
        var format = [];
        var bannerObj;
        if (sizes !== UNDEFINED && isArray(sizes)) {
      Severity: Major
      Found in modules/adtrueBidAdapter.js and 1 other location - About 2 days to fix
      modules/pubmaticBidAdapter.js on lines 520..559

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

      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

      File rubiconBidAdapter.js has 1035 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { ortbConverter } from '../libraries/ortbConverter/converter.js';
      import { pbsExtensions } from '../libraries/pbsExtensions/pbsExtensions.js';
      import { registerBidder } from '../src/adapters/bidderFactory.js';
      import { config } from '../src/config.js';
      import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
      Severity: Major
      Found in modules/rubiconBidAdapter.js - About 2 days to fix

        File adagioBidAdapter.js has 1001 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {find} from '../src/polyfill.js';
        import {
          cleanObj,
          deepAccess,
          deepClone,
        Severity: Major
        Found in modules/adagioBidAdapter.js - About 2 days to fix

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

            interpretResponse: function (serverResponse, bidRequest) {
              const response = serverResponse && serverResponse.body;
              if (!response) {
                logError('empty response');
                return [];
          Severity: Major
          Found in modules/gamoshiBidAdapter.js and 1 other location - About 2 days to fix
          modules/cleanmedianetBidAdapter.js on lines 205..248

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

          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

            interpretResponse: function (serverResponse, bidRequest) {
              const response = serverResponse && serverResponse.body;
              if (!response) {
                logError('empty response');
                return [];
          Severity: Major
          Found in modules/cleanmedianetBidAdapter.js and 1 other location - About 2 days to fix
          modules/gamoshiBidAdapter.js on lines 205..248

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

          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 (videoMediaType) {
              tag.video = tag.video || {};
              Object.keys(videoMediaType)
                .filter(param => includes(VIDEO_RTB_TARGETING, param))
                .forEach(param => {
          Severity: Major
          Found in modules/goldbachBidAdapter.js and 1 other location - About 2 days to fix
          modules/mediafuseBidAdapter.js on lines 820..862

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

          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 (videoMediaType) {
              tag.video = tag.video || {};
              Object.keys(videoMediaType)
                .filter(param => includes(VIDEO_RTB_TARGETING, param))
                .forEach(param => {
          Severity: Major
          Found in modules/mediafuseBidAdapter.js and 1 other location - About 2 days to fix
          modules/goldbachBidAdapter.js on lines 832..874

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

          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

            } else if (rtbBid.rtb[NATIVE]) {
              const nativeAd = rtbBid.rtb[NATIVE];
          
              // setting up the jsTracker:
              // we put it as a data-src attribute so that the tracker isn't called
          Severity: Major
          Found in modules/adrelevantisBidAdapter.js and 2 other locations - About 2 days to fix
          modules/goldbachBidAdapter.js on lines 654..721
          modules/mediafuseBidAdapter.js on lines 639..708

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

          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

            } else if (rtbBid.rtb[NATIVE]) {
              const nativeAd = rtbBid.rtb[NATIVE];
          
              // setting up the jsTracker:
              // we put it as a data-src attribute so that the tracker isn't called
          Severity: Major
          Found in modules/goldbachBidAdapter.js and 2 other locations - About 2 days to fix
          modules/adrelevantisBidAdapter.js on lines 355..420
          modules/mediafuseBidAdapter.js on lines 639..708

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

          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

            } else if (rtbBid.rtb[NATIVE]) {
              const nativeAd = rtbBid.rtb[NATIVE];
          
              // setting up the jsTracker:
              // we put it as a data-src attribute so that the tracker isn't called
          Severity: Major
          Found in modules/mediafuseBidAdapter.js and 2 other locations - About 2 days to fix
          modules/adrelevantisBidAdapter.js on lines 355..420
          modules/goldbachBidAdapter.js on lines 654..721

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

          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

          Severity
          Category
          Status
          Source
          Language