prebid/Prebid.js

View on GitHub
modules/saambaaBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File saambaaBidAdapter.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// TODO: this adapter appears to have no tests

import {deepAccess, generateUUID, isEmpty, isFn, parseSizesInput, parseUrl} from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
Severity: Minor
Found in modules/saambaaBidAdapter.js - About 4 hrs to fix

    Function createVideoRequestData has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createVideoRequestData(bid, bidderRequest) {
      let topLocation = getTopWindowLocation(bidderRequest);
      let topReferrer = getTopWindowReferrer();
    
      // if size is explicitly given via adapter params
    Severity: Major
    Found in modules/saambaaBidAdapter.js - About 3 hrs to fix

      Function createBannerRequestData has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function createBannerRequestData(bid, bidderRequest) {
        let topLocation = getTopWindowLocation(bidderRequest);
        let topReferrer = getTopWindowReferrer();
      
        // if size is explicitly given via adapter params
      Severity: Major
      Found in modules/saambaaBidAdapter.js - About 3 hrs to fix

        Function createVideoRequestData has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        function createVideoRequestData(bid, bidderRequest) {
          let topLocation = getTopWindowLocation(bidderRequest);
          let topReferrer = getTopWindowReferrer();
        
          // if size is explicitly given via adapter params
        Severity: Minor
        Found in modules/saambaaBidAdapter.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 createBannerRequestData has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        function createBannerRequestData(bid, bidderRequest) {
          let topLocation = getTopWindowLocation(bidderRequest);
          let topReferrer = getTopWindowReferrer();
        
          // if size is explicitly given via adapter params
        Severity: Minor
        Found in modules/saambaaBidAdapter.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 interpretResponse has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          interpretResponse(serverResponse, {bidRequest}) {
            let response = serverResponse.body;
            if (response !== null && isEmpty(response) == false) {
              if (isVideoBid(bidRequest)) {
                let bidResponse = {
        Severity: Minor
        Found in modules/saambaaBidAdapter.js - About 1 hr to fix

          Function interpretResponse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            interpretResponse(serverResponse, {bidRequest}) {
              let response = serverResponse.body;
              if (response !== null && isEmpty(response) == false) {
                if (isVideoBid(bidRequest)) {
                  let bidResponse = {
          Severity: Minor
          Found in modules/saambaaBidAdapter.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 isBidRequestValid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            isBidRequestValid(bidRequest) {
              if (typeof bidRequest != 'undefined') {
                if (bidRequest.bidder !== BIDDER_CODE && typeof bidRequest.params === 'undefined') { return false; }
                if (bidRequest === '' || bidRequest.params.placement === '' || bidRequest.params.pubid === '') { return false; }
                return true;
          Severity: Minor
          Found in modules/saambaaBidAdapter.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

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

          function getOsVersion() {
            let clientStrings = [
              { s: 'Android', r: /Android/ },
              { s: 'iOS', r: /(iPhone|iPad|iPod)/ },
              { s: 'Mac OS X', r: /Mac OS X/ },
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 2 other locations - About 1 day to fix
          modules/advangelistsBidAdapter.js on lines 158..177
          modules/beachfrontBidAdapter.js on lines 247..266

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

          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 (isVideoBid(bidRequest)) {
                  let bidResponse = {
                    requestId: response.id,
                    cpm: response.seatbid[0].bid[0].price,
                    width: response.seatbid[0].bid[0].w,
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 1 day to fix
          modules/advangelistsBidAdapter.js on lines 58..97

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

          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

            buildRequests(bids, bidderRequest) {
              let requests = [];
              let videoBids = bids.filter(bid => isVideoBidValid(bid));
              let bannerBids = bids.filter(bid => isBannerBidValid(bid));
              videoBids.forEach(bid => {
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 1 day to fix
          modules/advangelistsBidAdapter.js on lines 29..53

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

          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

          function getVideoTargetingParams(bid) {
            const result = {};
            const excludeProps = ['playerSize', 'context', 'w', 'h'];
            Object.keys(Object(bid.mediaTypes.video))
              .filter(key => !includes(excludeProps, key))
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 2 other locations - About 7 hrs to fix
          modules/advangelistsBidAdapter.js on lines 205..219
          modules/beachfrontBidAdapter.js on lines 350..364

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

          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 j = 0; j < sizes.length; j++) {
              o.imp.push({
                'id': '' + j,
                'displaymanager': '' + BIDDER_CODE,
                'displaymanagerver': '' + ADAPTER_VERSION,
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 5 hrs to fix
          modules/advangelistsBidAdapter.js on lines 276..294

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 141.

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

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

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

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

          Refactorings

          Further Reading

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

            for (let j = 0; j < sizes.length; j++) {
              let size = sizes[j];
          
              o.imp.push({
                'id': '' + j,
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 5 hrs to fix
          modules/advangelistsBidAdapter.js on lines 361..379

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

          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.seatbid[0].bid[0].adm) {
                    bidResponse.vastXml = response.seatbid[0].bid[0].adm;
                    bidResponse.adResponse = {
                      content: response.seatbid[0].bid[0].adm
                    };
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 4 hrs to fix
          modules/advangelistsBidAdapter.js on lines 72..79

          Duplicated Code

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

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

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

          Tuning

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

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

            isBidRequestValid(bidRequest) {
              if (typeof bidRequest != 'undefined') {
                if (bidRequest.bidder !== BIDDER_CODE && typeof bidRequest.params === 'undefined') { return false; }
                if (bidRequest === '' || bidRequest.params.placement === '' || bidRequest.params.pubid === '') { return false; }
                return true;
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 3 hrs to fix
          modules/advangelistsBidAdapter.js on lines 21..27

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

          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

              'device': {
                'langauge': (global.navigator.language).split('-')[0],
                'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0),
                'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2,
                'js': 1,
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 2 hrs to fix
          modules/advangelistsBidAdapter.js on lines 230..236

          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

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

            if (bidderRequest && bidderRequest.gdprConsent) {
              let { gdprApplies, consentString } = bidderRequest.gdprConsent;
              o.regs.ext = {'gdpr': gdprApplies ? 1 : 0};
              o.user.ext = {'consent': consentString};
            }
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 3 other locations - About 2 hrs to fix
          modules/advangelistsBidAdapter.js on lines 296..300
          modules/advangelistsBidAdapter.js on lines 381..385
          modules/saambaaBidAdapter.js on lines 411..415

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

          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 4 locations. Consider refactoring.
          Open

            if (bidderRequest && bidderRequest.gdprConsent) {
              let { gdprApplies, consentString } = bidderRequest.gdprConsent;
              o.regs.ext = {'gdpr': gdprApplies ? 1 : 0};
              o.user.ext = {'consent': consentString};
            }
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 3 other locations - About 2 hrs to fix
          modules/advangelistsBidAdapter.js on lines 296..300
          modules/advangelistsBidAdapter.js on lines 381..385
          modules/saambaaBidAdapter.js on lines 315..319

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

          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

              'device': {
                'langauge': (global.navigator.language).split('-')[0],
                'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0),
                'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2,
                'js': 1
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 2 hrs to fix
          modules/advangelistsBidAdapter.js on lines 317..322

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

          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

          function parseSizes(sizes) {
            return parseSizesInput(sizes).map(size => {
              let [ width, height ] = size.split('x');
              return {
                w: parseInt(width, 10) || undefined,
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 2 other locations - About 2 hrs to fix
          modules/advangelistsBidAdapter.js on lines 183..191
          modules/beachfrontBidAdapter.js on lines 229..237

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

          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 4 locations. Consider refactoring.
          Open

          function getBannerBidFloor(bid) {
            let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'banner', size: '*' }) : {};
            return floorInfo.floor || getBannerBidParam(bid, 'bidfloor');
          }
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 3 other locations - About 1 hr to fix
          modules/advangelistsBidAdapter.js on lines 110..113
          modules/advangelistsBidAdapter.js on lines 115..118
          modules/saambaaBidAdapter.js on lines 119..122

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

          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 4 locations. Consider refactoring.
          Open

          function getVideoBidFloor(bid) {
            let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'video', size: '*' }) : {};
            return floorInfo.floor || getVideoBidParam(bid, 'bidfloor');
          }
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 3 other locations - About 1 hr to fix
          modules/advangelistsBidAdapter.js on lines 110..113
          modules/advangelistsBidAdapter.js on lines 115..118
          modules/saambaaBidAdapter.js on lines 114..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 71.

          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 findAndFillParam(o, key, value) {
            try {
              if (typeof value === 'function') {
                o[key] = value();
              } else {
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 1 other location - About 1 hr to fix
          modules/advangelistsBidAdapter.js on lines 148..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 67.

          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 4 locations. Consider refactoring.
          Open

          function getDoNotTrack() {
            return navigator.doNotTrack === '1' || window.doNotTrack === '1' || navigator.msDoNoTrack === '1' || navigator.doNotTrack === 'yes';
          }
          Severity: Major
          Found in modules/saambaaBidAdapter.js and 3 other locations - About 1 hr to fix
          modules/advangelistsBidAdapter.js on lines 144..146
          modules/beachfrontBidAdapter.js on lines 276..278
          src/utils.js on lines 771..773

          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 2 locations. Consider refactoring.
          Open

            if (typeof paramSize !== 'undefined' && paramSize != '') {
              sizes = parseSizes(paramSize);
            } else {
              sizes = getVideoSizes(bid);
            }
          Severity: Minor
          Found in modules/saambaaBidAdapter.js and 1 other location - About 35 mins to fix
          modules/saambaaBidAdapter.js on lines 337..341

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 47.

          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 paramSize !== 'undefined' && paramSize != '') {
              sizes = parseSizes(paramSize);
            } else {
              sizes = getBannerSizes(bid);
            }
          Severity: Minor
          Found in modules/saambaaBidAdapter.js and 1 other location - About 35 mins to fix
          modules/saambaaBidAdapter.js on lines 238..242

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

          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