MailOnline/videojs-vast-vpaid

View on GitHub
test/plugin/videojs.vast.spec.js

Summary

Maintainability
F
1 wk
Test Coverage

File videojs.vast.spec.js has 750 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var MediaFile = require('ads/vast/MediaFile');
var VASTClient = require('ads/vast/VASTClient');
var VASTError = require('ads/vast/VASTError');
var VASTIntegrator = require('ads/vast/VASTIntegrator');
var VASTResponse = require('ads/vast/VASTResponse');
Severity: Major
Found in test/plugin/videojs.vast.spec.js - About 1 day to fix

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

        it("must not prevent the manual progress after the ad has ended", function(){
          var response = new VASTResponse();
          response._addMediaFiles([
            createMediaFile('http://fakeVideoFile', 'video/mp4')
          ]);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 1 day to fix
    test/plugin/videojs.vast.spec.js on lines 655..672

    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

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

        it("must not prevent the manual progress after the ad has been canceled", function(){
          var response = new VASTResponse();
          response._addMediaFiles([
            createMediaFile('http://fakeVideoFile', 'video/mp4')
          ]);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 1 day to fix
    test/plugin/videojs.vast.spec.js on lines 636..653

    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

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

           it("must remove the adUnit but not restore the video content on 'vast.reset' evt", function(){
            player.vast.adUnit = {
              type: 'FAKE',
              pauseAd: utilities.noop,
              resumeAd: utilities.noop,
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 4 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 442..454

    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 remove the adUnit and restore the video content on 'vast.adsCancel' evt", function(){
            player.vast.adUnit = {
              type: 'FAKE',
              pauseAd: utilities.noop,
              resumeAd: utilities.noop,
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 4 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 456..468

    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 be removed if ads are canceled while trying to play the ad", function(){
              player.trigger('vast.firstPlay');
              clock.tick();
              assert.isTrue(dom.hasClass(player.el(), 'vjs-vast-ad-loading'));
              player.trigger('vast.adsCancel');
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 295..302

    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

            it("must be removed on vast ad start", function(){
              player.trigger('vast.firstPlay');
              clock.tick();
              assert.isTrue(dom.hasClass(player.el(), 'vjs-vast-ad-loading'));
              player.trigger('vast.adStart');
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 304..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 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 3 locations. Consider refactoring.
    Open

        it("must NOT add the adsLabel component if the ad gets canceled. (i.e. vast.adstart)", function () {
          var response = new VASTResponse();
          response._addMediaFiles([
            createMediaFile('http://fakeVideoFile', 'video/mp4')
          ]);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 2 other locations - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 697..707
    test/plugin/videojs.vast.spec.js on lines 737..747

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

    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 add the adsLabel component if there is an error in the player. (i.e. vast.adstart)", function () {
          var response = new VASTResponse();
          response._addMediaFiles([
            createMediaFile('http://fakeVideoFile', 'video/mp4')
          ]);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 2 other locations - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 685..695
    test/plugin/videojs.vast.spec.js on lines 737..747

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

    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 ad the adsLabel if the ad has finished playing", function(){
          var response = new VASTResponse();
          response._addMediaFiles([
            createMediaFile('http://fakeVideoFile', 'video/mp4')
          ]);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 2 other locations - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 685..695
    test/plugin/videojs.vast.spec.js on lines 697..707

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

    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("set to true, must reset plugin 'vast.firstPlay' event", function () {
          player.vastClient({
            adTagUrl: utilities.echoFn('/fake.ad.url'),
            playAdAlways: true
          });
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 155..166

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

    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("set to false, must try not play a new ad every time the user replays the ad", function () {
          player.vastClient({
            adTagUrl: utilities.echoFn('/fake.ad.url'),
            playAdAlways: false
          });
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 143..153

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

    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 trigger vast.contentEnd if there is a vast.reset while playing the content", function(){
            player.trigger('playing');
            sinon.assert.calledOnce(contentStartSpy);
            sinon.assert.notCalled(contentEndedSpy);
            player.trigger('vast.reset');
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 2 other locations - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 359..366
    test/plugin/videojs.vast.spec.js on lines 409..416

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

    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 be triggered on content playing and content end", function(){
            player.trigger('playing');
            sinon.assert.calledOnce(contentStartSpy);
            sinon.assert.notCalled(contentEndedSpy);
            player.trigger('ended');
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 2 other locations - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 400..407
    test/plugin/videojs.vast.spec.js on lines 409..416

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

    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 trigger vast.contentEnd if there is a vast.firstPlay while playing the content", function(){
            player.trigger('playing');
            sinon.assert.calledOnce(contentStartSpy);
            sinon.assert.notCalled(contentEndedSpy);
            player.trigger('vast.firstPlay');
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 2 other locations - About 3 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 359..366
    test/plugin/videojs.vast.spec.js on lines 400..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 95.

    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 not cancel the ads", function(){
            var adsCanceled = sinon.spy();
            player.on('vast.adsCancel', adsCanceled);
            player.vast.enable();
            player.trigger('vast.firstPlay');
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 2 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 221..228

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

    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 cancel the ads if the ads are not enabled", function(){
          var adsCanceled = sinon.spy();
          player.on('vast.adsCancel', adsCanceled);
          player.vast.disable();
          player.trigger('vast.firstPlay');
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 1 other location - About 2 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 273..281

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

    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

          it("must not be triggered if there is an vast.firstPlay after restoring the content", function(){
            player.trigger('vast.firstPlay');
            player.trigger('playing');
            player.trigger('ended');
            sinon.assert.notCalled(contentStartSpy);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 3 other locations - About 2 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 368..374
    test/plugin/videojs.vast.spec.js on lines 384..390
    test/plugin/videojs.vast.spec.js on lines 392..398

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

    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

          it("must not trigger vast.contentEnd if there is a vast.reset after restoring the content", function(){
            player.trigger('playing');
            player.trigger('vast.reset');
            player.trigger('ended');
            sinon.assert.calledOnce(contentStartSpy);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 3 other locations - About 2 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 368..374
    test/plugin/videojs.vast.spec.js on lines 376..382
    test/plugin/videojs.vast.spec.js on lines 392..398

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

    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

          it("must not trigger vast.contentEnd if there is a vast.firstPlay after restoring the content", function(){
            player.trigger('playing');
            player.trigger('vast.firstPlay');
            player.trigger('ended');
            sinon.assert.calledOnce(contentStartSpy);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 3 other locations - About 2 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 368..374
    test/plugin/videojs.vast.spec.js on lines 376..382
    test/plugin/videojs.vast.spec.js on lines 384..390

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

    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

          it("must not be triggered if there is an vast.reset after restoring the content", function(){
            player.trigger('vast.reset');
            player.trigger('playing');
            player.trigger('ended');
            sinon.assert.notCalled(contentStartSpy);
    Severity: Major
    Found in test/plugin/videojs.vast.spec.js and 3 other locations - About 2 hrs to fix
    test/plugin/videojs.vast.spec.js on lines 376..382
    test/plugin/videojs.vast.spec.js on lines 384..390
    test/plugin/videojs.vast.spec.js on lines 392..398

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

    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 + '" codec="video/mpeg-generic" bitrate="457" width="300" height="225">' +
          '<![CDATA[' + url + ']]>' +
          '</MediaFile>';
        return new MediaFile(xml.toJXONTree(xmlStr));
    Severity: Major
    Found in test/plugin/videojs.vast.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/ads/vpaid/VPAIDIntegrator.spec.js on lines 112..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 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

    There are no issues that match your filters.

    Category
    Status