prebid/Prebid.js

View on GitHub

Showing 3,230 of 5,407 total issues

Function setMockCategories has 1249 lines of code (exceeds 25 allowed). Consider refactoring.
Open

prebidTestUtils.setMockCategories = function () {
  const key = 'iabToFwMappingkey';
  const keyPub = 'iabToFwMappingkeyPub';
  const keyBidder = 'appnexus';
  const currTime = new Date().getTime();
Severity: Major
Found in integrationExamples/longform/longformTestUtils.js - About 6 days to fix

    File ixBidAdapter.js has 1580 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      contains,
      deepAccess,
      deepClone,
      deepSetValue,
    Severity: Major
    Found in modules/ixBidAdapter.js - About 4 days to fix

      File longformTestUtils.js has 1313 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var prebidTestUtils = prebidTestUtils || {};
      
      function getIndustry(id) {
        var mapping = window.localStorage.getItem('iabToFwMappingkey');
        if (mapping) {
      Severity: Major
      Found in integrationExamples/longform/longformTestUtils.js - About 3 days to fix

        File pubmaticBidAdapter.js has 1175 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { getBidRequest, logWarn, isBoolean, isStr, isArray, inIframe, mergeDeep, deepAccess, isNumber, deepSetValue, logInfo, logError, deepClone, uniques, isPlainObject, isInteger, generateUUID } from '../src/utils.js';
        import { registerBidder } from '../src/adapters/bidderFactory.js';
        import { BANNER, VIDEO, NATIVE, ADPOD } from '../src/mediaTypes.js';
        import { config } from '../src/config.js';
        import { Renderer } from '../src/Renderer.js';
        Severity: Major
        Found in modules/pubmaticBidAdapter.js - About 3 days to fix

          Function nobidBuildRequests has a Cognitive Complexity of 144 (exceeds 5 allowed). Consider refactoring.
          Open

          function nobidBuildRequests(bids, bidderRequest) {
            var serializeState = function(divIds, siteId, adunits) {
              var filterAdUnitsByIds = function(divIds, adUnits) {
                var filtered = [];
                if (!divIds.length) {
          Severity: Minor
          Found in modules/nobidBidAdapter.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 appnexusBidAdapter.js has 1067 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

              File rubiconBidAdapter.js has 1027 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

                  Function _createNativeRequest has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function _createNativeRequest(params) {
                    var nativeRequestObject = {
                      assets: []
                    };
                    for (var key in params) {
                  Severity: Minor
                  Found in modules/pubwiseBidAdapter.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 goldbachBidAdapter.js has 924 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {Renderer} from '../src/Renderer.js';
                  import {
                    createTrackPixelHtml,
                    deepAccess,
                    deepClone,
                  Severity: Major
                  Found in modules/goldbachBidAdapter.js - About 2 days to fix

                    File mediafuseBidAdapter.js has 910 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

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

                        buildRequests(validBidRequests, bidderRequest) {
                          this.loadWhitelabelData(validBidRequests[0]);
                          this.propertyBag.buildRequestsStart = new Date().getTime();
                          let whitelabelBidder = this.propertyBag.whitelabel.bidder; // by default = ozone
                          let whitelabelPrefix = this.propertyBag.whitelabel.keyPrefix;
                      Severity: Minor
                      Found in modules/ozoneBidAdapter.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

                      Function createNativeRequest has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function createNativeRequest(params) {
                        let nativeRequestObject = {
                          plcmtcnt: 1,
                          assets: []
                        };
                      Severity: Minor
                      Found in modules/mgidBidAdapter.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 magniteAnalyticsAdapter.js has 867 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import {
                        debugTurnedOn,
                        deepAccess,
                        deepClone,
                        deepSetValue,
                      Severity: Major
                      Found in modules/magniteAnalyticsAdapter.js - About 2 days to fix

                        Function JWPlayerProvider has 413 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function JWPlayerProvider(config, jwplayer_, adState_, timeState_, callbackStorage_, utils, sharedUtils) {
                          const jwplayer = jwplayer_;
                          let player = null;
                          let playerVersion = null;
                          const playerConfig = config.playerConfig;
                        Severity: Major
                        Found in modules/jwplayerVideoProvider.js - About 2 days to fix

                          Function VideojsProvider has 404 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function VideojsProvider(providerConfig, vjs_, adState_, timeState_, callbackStorage_, utils) {
                            let vjs = vjs_;
                            // Supplied callbacks are typically wrapped by handlers
                            // we use this dict to keep track of these pairings
                            const callbackToHandler = {};
                          Severity: Major
                          Found in modules/videojsVideoProvider.js - About 2 days to fix

                            File pubwiseBidAdapter.js has 836 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            
                            import { _each, isBoolean, isEmptyStr, isNumber, isStr, deepClone, isArray, deepSetValue, inIframe, mergeDeep, deepAccess, logMessage, logInfo, logWarn, logError } from '../src/utils.js';
                            import { registerBidder } from '../src/adapters/bidderFactory.js';
                            import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
                            import { config } from '../src/config.js';
                            Severity: Major
                            Found in modules/pubwiseBidAdapter.js - About 2 days to fix

                              Function newTargeting has 401 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function newTargeting(auctionManager) {
                                let targeting = {};
                                let latestAuctionForAdUnit = {};
                              
                                targeting.setLatestAuctionForAdUnit = function(adUnitCode, auctionId) {
                              Severity: Major
                              Found in src/targeting.js - About 2 days to fix
                                Severity
                                Category
                                Status
                                Source
                                Language