MailOnline/videojs-vast-vpaid

View on GitHub
test/ads/vpaid/VPAIDIntegrator.spec.js

Summary

Maintainability
F
1 wk
Test Coverage

File VPAIDIntegrator.spec.js has 911 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var VPAIDAdUnitWrapper = require('ads/vpaid/VPAIDAdUnitWrapper');
var VPAIDIntegrator = require('ads/vpaid/VPAIDIntegrator');
var VPAIDFlashTech = require('ads/vpaid/VPAIDFlashTech');
var VPAIDHTML5Tech = require('ads/vpaid/VPAIDHTML5Tech');

Severity: Major
Found in test/ads/vpaid/VPAIDIntegrator.spec.js - About 2 days to fix

    Function FakeAdUnit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function FakeAdUnit() {
        var events = {};
        this.options = {
          src: 'fakeSrc'
        };
    Severity: Minor
    Found in test/ads/vpaid/VPAIDIntegrator.spec.js - About 1 hr to fix

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

            it("must pass an error to the callback if the VPAID version is bigger than 2.x.x", function () {
              vpaidIntegrator._handshake(adUnitWrapper, response, next);
              sinon.assert.calledWith(vpaidAdUnit.handshakeVersion, '2.0');
              var respond = testUtils.secondArg(vpaidAdUnit.handshakeVersion);
              respond(null, '3.0.0');
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 391..400

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

      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

            it("must pass an error to the callback if the VPAID version is smaller than 1.0", function () {
              vpaidIntegrator._handshake(adUnitWrapper, response, next);
              sinon.assert.calledWith(vpaidAdUnit.handshakeVersion, '2.0');
              var respond = testUtils.secondArg(vpaidAdUnit.handshakeVersion);
              respond(null, '0.0.0');
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 402..411

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

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

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

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

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

      Refactorings

      Further Reading

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

            it("on 'AdPlaying' event, must track resume, resume the adUnit and trigger 'play' evt", function(){
                var playSpy = sinon.spy();
                player.on('play', playSpy);
                vpaidIntegrator._adUnit = {
                  isPaused: utilities.echoFn(true)
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 536..547
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 549..559

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 124.

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

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

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

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

      Refactorings

      Further Reading

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

            it("on 'AdVideoStart' event, must track start, resume the adUnit and trigger 'play' evt", function(){
              var playSpy = sinon.spy();
              player.on('play', playSpy);
              vpaidIntegrator._adUnit = {
                isPaused: utilities.echoFn(true)
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 549..559
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 650..661

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

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

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

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

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

      Refactorings

      Further Reading

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

            it("on 'AdStarted' event, must track creativeView, resume the adUnit and trigger 'play' evt", function(){
              var playSpy = sinon.spy();
              player.on('play', playSpy);
              vpaidIntegrator._adUnit = {
                isPaused: utilities.echoFn(true)
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 536..547
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 650..661

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

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

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

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

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

      Refactorings

      Further Reading

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

              it("must track mute if the volume was not 0 but gets updated to 0", function(){
                player.volume.returns(10);
                adUnit.setVolume(0);
                adUnit.trigger('AdVolumeChange');
                this.clock.tick();
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 692..700
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 701..709

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

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

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

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

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

      Refactorings

      Further Reading

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

              it("must tack unmute if the volume was 0 and changes to not cero", function(){
                player.volume.returns(0);
                adUnit.setVolume(10);
                adUnit.trigger('AdVolumeChange');
                this.clock.tick();
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 673..681
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 701..709

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

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

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

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

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

      Refactorings

      Further Reading

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

              it("must not tack unmute if the volume was not 0 and changes to not cero", function(){
                player.volume.returns(5);
                adUnit.setVolume(10);
                adUnit.trigger('AdVolumeChange');
                this.clock.tick();
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 4 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 673..681
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 692..700

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

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

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

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

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

      Refactorings

      Further Reading

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

              it("must remove the skip button if the adUnit is no longer skippable", function(){
                adUnit.isSkippable = true;
                adUnit.trigger('AdSkippableStateChange');
                this.clock.tick();
                adUnit.isSkippable = false;
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 3 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 794..802
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 804..812

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

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

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

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

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

      Refactorings

      Further Reading

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

              it("must remove the adUnit on 'vast.adsCancel' event", function(){
                adUnit.isSkippable = true;
                adUnit.trigger('AdSkippableStateChange');
                this.clock.tick();
                adUnit.isSkippable = false;
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 3 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 773..782
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 794..802

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

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

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

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

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

      Refactorings

      Further Reading

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

              it("must remove the adUnit on 'vast.adEnd' event", function(){
                adUnit.isSkippable = true;
                adUnit.trigger('AdSkippableStateChange');
                this.clock.tick();
                adUnit.isSkippable = false;
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 3 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 773..782
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 804..812

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

      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

          it("must destroy adUnit when AdStopped", function() {
            var vpaidIntegrator = new VPAIDIntegrator(player, {autoResize: true});
            var adUnit = new FakeAdUnit();
            var spy = sinon.spy();
            vpaidIntegrator._finishPlaying(adUnit, new VASTResponse(), spy);
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 2 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 1081..1088

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

      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

          it("must destroy adUnit when AdStopped", function() {
            var vpaidIntegrator = new VPAIDIntegrator(player, {autoResize: true});
            var adUnit = new FakeAdUnit();
            var spy = sinon.spy();
            vpaidIntegrator._finishPlaying(adUnit, new VASTResponse(), spy);
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 2 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 1072..1079

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

      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

          it("must handle window orientation change", function() {
            var vpaidIntegrator = new VPAIDIntegrator(player, {autoResize: true});
            var adUnit = new FakeAdUnit();
            vpaidIntegrator._setupEvents(adUnit, new VASTResponse(), utilities.noop);
            dom.dispatchEvent(window, new Event('orientationchange'));
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 2 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 1028..1034

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

      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

          it("must handle window resize", function() {
            var vpaidIntegrator = new VPAIDIntegrator(player, {autoResize: true});
            var adUnit = new FakeAdUnit();
            vpaidIntegrator._setupEvents(adUnit, new VASTResponse(), utilities.noop);
            dom.dispatchEvent(window, new Event('resize'));
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 2 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 1036..1042

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

      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

            it("must return preferred tech if supported and available", function () {
              var settings = {preferredTech: 'html5'};
              var vastResponse = new VASTResponse();
              vastResponse._addMediaFiles([createMediaFile('http://fakeVideoFile', FLASH_APP_MIME), createMediaFile('http://anotherFakeVideoFile', JS_APP_MIME)]);
              assert.instanceOf(vpaidIntegrator._findSupportedTech(vastResponse, settings), VPAIDHTML5Tech);
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 2 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 889..894

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 81.

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

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

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

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

      Refactorings

      Further Reading

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

            it("must return preferred tech if supported and available", function () {
              var settings = {preferredTech: 'flash'};
              var vastResponse = new VASTResponse();
              vastResponse._addMediaFiles([createMediaFile('http://fakeVideoFile', FLASH_APP_MIME), createMediaFile('http://anotherFakeVideoFile', JS_APP_MIME)]);
              assert.instanceOf(vpaidIntegrator._findSupportedTech(vastResponse, settings), VPAIDFlashTech);
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 2 hrs to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 882..887

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 81.

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

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

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

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

      Refactorings

      Further Reading

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

            it("on 'AdUserAcceptInvitation' event, must track acceptInvitation", function(){
              adUnit.trigger('AdUserAcceptInvitation');
              sinon.assert.calledOnce(tracker.trackAcceptInvitation);
              sinon.assert.calledOnce(tracker.trackAcceptInvitationLinear);
            });
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 1 hr to fix
      test/ads/vast/VASTIntegrator.spec.js on lines 258..262
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 623..627

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

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

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

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

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

      Refactorings

      Further Reading

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

            it("on 'AdUserClose' event, must track close", function(){
              adUnit.trigger('AdUserClose');
              sinon.assert.calledOnce(tracker.trackClose);
              sinon.assert.calledOnce(tracker.trackCloseLinear);
            });
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 2 other locations - About 1 hr to fix
      test/ads/vast/VASTIntegrator.spec.js on lines 258..262
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 617..621

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

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

          function createMediaFile(url, type) {
            var xmlStr = '<MediaFile delivery="progressive" type="' + type + '" apiFramework="VPAID">' +
              '<![CDATA[' + url + ']]>' +
              '</MediaFile>';
            return new MediaFile(xml.toJXONTree(xmlStr));
      Severity: Major
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 5 other locations - About 1 hr to fix
      test/ads/vast/VASTClient.spec.js on lines 61..66
      test/ads/vast/VASTIntegrator.spec.js on lines 31..36
      test/ads/vast/VASTResponse.spec.js on lines 269..274
      test/ads/vast/VASTTracker.spec.js on lines 16..21
      test/plugin/videojs.vast.spec.js on lines 37..42

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

      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

          this.getAdSkippableState = function(fn) {
            var skippable = this.isSkippable;
            window.setTimeout(function() {
              fn(null, skippable);
            }, 0);
      Severity: Minor
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 55 mins to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 35..41

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

      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

          this.getAdVolume = function(fn) {
            var vol = this.volume;
            window.setTimeout(function() {
              fn(null, vol);
            }, 0);
      Severity: Minor
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 55 mins to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 51..56

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

      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

              sinon.assert.calledWithExactly(adUnitWrapper.initAd, 720, 480, 'normal', -1, sinon.match({AdParameters: 'some params'}), sinon.match.func);
      Severity: Minor
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 40 mins to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 453..453

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

      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

              sinon.assert.calledWithExactly(adUnitWrapper.initAd, 720, 480, 'normal', -1, sinon.match({AdParameters: ''}), sinon.match.func);
      Severity: Minor
      Found in test/ads/vpaid/VPAIDIntegrator.spec.js and 1 other location - About 40 mins to fix
      test/ads/vpaid/VPAIDIntegrator.spec.js on lines 460..460

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

      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