MailOnline/videojs-vast-vpaid

View on GitHub
test/ads/vast/VASTIntegrator.spec.js

Summary

Maintainability
F
5 days
Test Coverage

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

'use strict';

describe("VASTIntegrator", function () {

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

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

          it("must not call the callback if the ad was canceled before the ended evt", function () {
            var spy = sinon.spy();
            player.on('vast.adStart', spy);
            vastIntegrator._playSelectedAd(mediaFile, response, callback);
            player.trigger('durationchange');
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 2 other locations - About 4 hrs to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 460..470
    test/ads/vast/VASTIntegrator.spec.js on lines 484..494

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

    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.adStart or call the callback if the ad was canceled before the playing evt", function () {
            var spy = sinon.spy();
            player.on('vast.adStart', spy);
            vastIntegrator._playSelectedAd(mediaFile, response, callback);
            player.trigger('durationchange');
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 2 other locations - About 4 hrs to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 472..482
    test/ads/vast/VASTIntegrator.spec.js on lines 484..494

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

    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 call the callback if the ad was canceled before the durationchange evt", function () {
            var spy = sinon.spy();
            player.on('vast.adStart', spy);
            vastIntegrator._playSelectedAd(mediaFile, response, callback);
            player.trigger('vast.adsCancel');
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 2 other locations - About 4 hrs to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 460..470
    test/ads/vast/VASTIntegrator.spec.js on lines 472..482

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

    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 assertError(callback, msg, code) {
        var error = testUtils.firstArg(callback);
        assert.instanceOf(error, VASTError);
        assert.equal(error.message, "VAST Error: " + msg);
        if (code) {
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTClient.spec.js on lines 18..25

    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 be able to resume the adUnit", function(){
              var adUnit = vastIntegrator.playAd(new VASTResponse(), utilities.noop);
              sinon.spy(player, 'play');
              adUnit.resumeAd();
              sinon.assert.calledOnce(player.play);
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 145..150

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

    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 able to pause the adUnit", function(){
              var adUnit = vastIntegrator.playAd(new VASTResponse(), utilities.noop);
              sinon.spy(player, 'pause');
              adUnit.pauseAd();
              sinon.assert.calledOnce(player.pause);
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 152..157

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

    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 anchor on ad cancel", function(){
            vastIntegrator._addClickThrough(mediaFile, tracker, response, callback);
            assert.isNotNull(clickThroughAnchor(player));
            player.trigger('vast.adsCancel');
            assert.isNull(clickThroughAnchor(player));
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 1 hr to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 703..708

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

    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 anchor when the ad ends", function(){
            vastIntegrator._addClickThrough(mediaFile, tracker, response, callback);
            assert.isNotNull(clickThroughAnchor(player));
            player.trigger('vast.adEnd');
            assert.isNull(clickThroughAnchor(player));
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 1 hr to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 710..715

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

    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 track resume event if the ad ends while being paused", function(){
            player.trigger('pause');
            player.trigger('vast.adEnd');
            player.trigger('play');
            sinon.assert.notCalled(tracker.trackResume);
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 1 hr to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 284..289

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

    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 track resume event if the ad gets canceled while paused", function(){
            player.trigger('pause');
            player.trigger('vast.adsCancel');
            player.trigger('play');
            sinon.assert.notCalled(tracker.trackResume);
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 1 hr to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 293..298

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

    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 impressions and creativeView on adsStart", function () {
            player.trigger('vast.adStart');
            sinon.assert.calledOnce(tracker.trackImpressions);
            sinon.assert.calledOnce(tracker.trackCreativeView);
          });
    Severity: Major
    Found in test/ads/vast/VASTIntegrator.spec.js and 2 other locations - About 1 hr to fix
    test/ads/vpaid/VPAIDIntegrator.spec.js on lines 617..621
    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 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/ads/vast/VASTIntegrator.spec.js and 5 other locations - About 1 hr to fix
    test/ads/vast/VASTClient.spec.js on lines 61..66
    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
    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

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

        function assertVASTTrackRequest(URLs, variables) {
          URLs = utilities.isArray(URLs) ? URLs : [URLs];
          sinon.assert.calledWithExactly(vastUtil.track, URLs, variables);
        }
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 55 mins to fix
    test/ads/vast/VASTTracker.spec.js on lines 50..53

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 54.

    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 track complete evt on 'vast.adCancel'", function(){
            player.trigger('vast.adsCancel');
            player.trigger('vast.adEnd');
            sinon.assert.notCalled(tracker.trackComplete);
          });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 55 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 330..334

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

    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 track complete evt on 'vast.adSkip'", function(){
            player.trigger('vast.adSkip');
            player.trigger('vast.adEnd');
            sinon.assert.notCalled(tracker.trackComplete);
          });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 55 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 324..328

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

    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 skip button if the ad gets canceled", function () {
              vastIntegrator._addSkipButton(mediaFile, tracker, response, callback);
              player.trigger('vast.adsCancel');
              assert.isNull(skipButton(player));
            });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 55 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 533..537

    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

            it("must remove the skip button once the ad finish playing", function () {
              vastIntegrator._addSkipButton(mediaFile, tracker, response, callback);
              player.trigger('vast.adEnd');
              assert.isNull(skipButton(player));
            });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 55 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 539..543

    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

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

          beforeEach(function () {
            response = new VASTResponse();
            mediaFile = createMediaFile('http://foo.video.url.mp4', 'video/mp4');
            tracker = sinon.createStubInstance(VASTTracker);
          });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 40 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 614..618

    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

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

          beforeEach(function () {
            response = new VASTResponse();
            mediaFile = createMediaFile('http://foo.video.url.mp4', 'video/mp4');
            tracker = sinon.createStubInstance(VASTTracker);
          });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 40 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 506..510

    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

          it("must call the callback with the source, the tracker and the response", function () {
            vastIntegrator._addSkipButton(mediaFile, tracker, response, callback);
            sinon.assert.calledWithExactly(callback, null, mediaFile, tracker, response);
          });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 35 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 620..623

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

    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 call the callback with the source, the tracker and the response", function () {
            vastIntegrator._addClickThrough(mediaFile, tracker, response, callback);
            sinon.assert.calledWithExactly(callback, null, mediaFile, tracker, response);
          });
    Severity: Minor
    Found in test/ads/vast/VASTIntegrator.spec.js and 1 other location - About 35 mins to fix
    test/ads/vast/VASTIntegrator.spec.js on lines 512..515

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

    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