prebid/Prebid.js

View on GitHub
modules/advangelistsBidAdapter.js

Summary

Maintainability
F
1 wk
Test Coverage

File advangelistsBidAdapter.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {deepAccess, generateUUID, isEmpty, isFn, parseSizesInput, parseUrl} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {find, includes} from '../src/polyfill.js';

Severity: Minor
Found in modules/advangelistsBidAdapter.js - About 4 hrs to fix

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

    function createVideoRequestData(bid, bidderRequest) {
      let topLocation = getTopWindowLocation(bidderRequest);
      let topReferrer = getTopWindowReferrer(bidderRequest);
    
      let sizes = getVideoSizes(bid);
    Severity: Major
    Found in modules/advangelistsBidAdapter.js - About 2 hrs to fix

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

      function createBannerRequestData(bid, bidderRequest) {
        let topLocation = getTopWindowLocation(bidderRequest);
        let topReferrer = getTopWindowReferrer(bidderRequest);
      
        let sizes = getBannerSizes(bid);
      Severity: Major
      Found in modules/advangelistsBidAdapter.js - About 2 hrs to fix

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

        function createBannerRequestData(bid, bidderRequest) {
          let topLocation = getTopWindowLocation(bidderRequest);
          let topReferrer = getTopWindowReferrer(bidderRequest);
        
          let sizes = getBannerSizes(bid);
        Severity: Minor
        Found in modules/advangelistsBidAdapter.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 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/advangelistsBidAdapter.js - About 1 hr to fix

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

          function createVideoRequestData(bid, bidderRequest) {
            let topLocation = getTopWindowLocation(bidderRequest);
            let topReferrer = getTopWindowReferrer(bidderRequest);
          
            let sizes = getVideoSizes(bid);
          Severity: Minor
          Found in modules/advangelistsBidAdapter.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 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/advangelistsBidAdapter.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/advangelistsBidAdapter.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/advangelistsBidAdapter.js and 2 other locations - About 1 day to fix
          modules/beachfrontBidAdapter.js on lines 247..266
          modules/saambaaBidAdapter.js on lines 162..181

          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/advangelistsBidAdapter.js and 1 other location - About 1 day to fix
          modules/saambaaBidAdapter.js on lines 62..101

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 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/advangelistsBidAdapter.js and 1 other location - About 1 day to fix
          modules/saambaaBidAdapter.js on lines 32..57

          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/advangelistsBidAdapter.js and 2 other locations - About 7 hrs to fix
          modules/beachfrontBidAdapter.js on lines 350..364
          modules/saambaaBidAdapter.js on lines 213..227

          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/advangelistsBidAdapter.js and 1 other location - About 5 hrs to fix
          modules/saambaaBidAdapter.js on lines 293..311

          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/advangelistsBidAdapter.js and 1 other location - About 5 hrs to fix
          modules/saambaaBidAdapter.js on lines 389..407

          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/advangelistsBidAdapter.js and 1 other location - About 4 hrs to fix
          modules/saambaaBidAdapter.js on lines 76..83

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 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/advangelistsBidAdapter.js and 1 other location - About 3 hrs to fix
          modules/saambaaBidAdapter.js on lines 24..30

          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/advangelistsBidAdapter.js and 1 other location - About 2 hrs to fix
          modules/saambaaBidAdapter.js on lines 247..253

          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/advangelistsBidAdapter.js and 3 other locations - About 2 hrs to fix
          modules/advangelistsBidAdapter.js on lines 381..385
          modules/saambaaBidAdapter.js on lines 315..319
          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/advangelistsBidAdapter.js and 3 other locations - About 2 hrs to fix
          modules/advangelistsBidAdapter.js on lines 296..300
          modules/saambaaBidAdapter.js on lines 315..319
          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

          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/advangelistsBidAdapter.js and 1 other location - About 2 hrs to fix
          modules/saambaaBidAdapter.js on lines 345..350

          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/advangelistsBidAdapter.js and 2 other locations - About 2 hrs to fix
          modules/beachfrontBidAdapter.js on lines 229..237
          modules/saambaaBidAdapter.js on lines 187..195

          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 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/advangelistsBidAdapter.js and 3 other locations - About 1 hr to fix
          modules/advangelistsBidAdapter.js on lines 110..113
          modules/saambaaBidAdapter.js on lines 114..117
          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 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/advangelistsBidAdapter.js and 3 other locations - About 1 hr to fix
          modules/advangelistsBidAdapter.js on lines 115..118
          modules/saambaaBidAdapter.js on lines 114..117
          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

          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/advangelistsBidAdapter.js and 1 other location - About 1 hr to fix
          modules/saambaaBidAdapter.js on lines 152..160

          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/advangelistsBidAdapter.js and 3 other locations - About 1 hr to fix
          modules/beachfrontBidAdapter.js on lines 276..278
          modules/saambaaBidAdapter.js on lines 148..150
          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

          There are no issues that match your filters.

          Category
          Status