MailOnline/videojs-vast-vpaid

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

Summary

Maintainability
F
5 days
Test Coverage

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

'use strict';

describe("VASTResponse", function () {

  var Ad = require('ads/vast/Ad');
Severity: Minor
Found in test/ads/vast/VASTResponse.spec.js - About 7 hrs to fix

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

        describe("_addCustomClicks", function () {
          it("must not add any customClick unless you pass an array with them inside", function () {
            response._addCustomClicks();
            response._addCustomClicks({});
            response._addCustomClicks('');
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 4 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 224..244

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

    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

        describe("_addClickTrackings", function () {
          it("must not add any clickTracking if you don't pass an array of tracking urls", function () {
            response._addClickTrackings();
            response._addClickTrackings({});
            response._addClickTrackings('');
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 4 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 246..266

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 132.

    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 add the wrapper to the response if the passed ad has a wrapper", function(){
            var vastJTree = xml.toJXONTree('<VAST><Ad><Wrapper></Wrapper></Ad></VAST>');
            var ad = new Ad(vastJTree.ad);
            sinon.stub(response, '_addWrapper');
            response.addAd(ad);
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 120..126

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

          it("must add the InLine to the response if the passed ad has an InLine", function(){
            var vastJTree = xml.toJXONTree('<VAST><Ad><InLine></InLine></Ad></VAST>');
            var ad = new Ad(vastJTree.ad);
            sinon.stub(response, '_addInLine');
            response.addAd(ad);
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 128..134

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 90.

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

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

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

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

    Refactorings

    Further Reading

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

          it("must add the impressions to the response", function () {
            var wrapperXML = '<Wrapper>' +
              '<Impression id="1234"><![CDATA[http://Impression.url.track.com]]></Impression>' +
              '<Impression><![CDATA[http://Impression2.url.track.com]]></Impression>' +
              '<Impression id="1111"></Impression>' +
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 502..516

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 85.

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

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

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

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

    Refactorings

    Further Reading

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

          it("must add the impressions to the response", function () {
            var impressionXML = '<Inline>' +
              '<Impression id="1234"><![CDATA[http://Impression.url.track.com]]></Impression>' +
              '<Impression><![CDATA[http://Impression2.url.track.com]]></Impression>' +
              '<Impression id="1111"></Impression>' +
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 541..555

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 85.

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

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

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

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

    Refactorings

    Further Reading

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

            it("must add the trackingEvents", function(){
              var wrapperXML = '<Wrapper><Creatives><Creative><Linear><TrackingEvents>' +
                '<Tracking event="firstQuartile"><![CDATA[ http://www.tracking1.com ]]></Tracking>' +
                '</TrackingEvents></Linear></Creative></Creatives></Wrapper>';
    
    
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 422..429

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 82.

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

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

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

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

    Refactorings

    Further Reading

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

          it("must add the trackings to the response", function () {
            var linearXML = '<Linear><TrackingEvents>' +
              '<Tracking event="firstQuartile"><![CDATA[ http://www.tracking1.com ]]></Tracking>' +
              '</TrackingEvents></Linear>';
            var linear = new Linear(xml.toJXONTree(linearXML));
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 573..581

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 82.

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

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

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

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

    Refactorings

    Further Reading

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

          it("must add the clickTrackings to the response", function () {
            var videoClicksXML = '<VideoClicks>' +
              '<ClickTracking><![CDATA[ http://www.tracking1.com ]]></ClickTracking>' +
              '<ClickTracking><![CDATA[ http://www.tracking2.com ]]></ClickTracking>' +
              '</VideoClicks>';
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 362..375

    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 add the customClicks to the response", function () {
            var videoClicksXML = '<VideoClicks>' +
              '<CustomClick><![CDATA[ http://www.tracking1.com ]]></CustomClick>' +
              '<CustomClick><![CDATA[ http://www.tracking2.com ]]></CustomClick>' +
              '</VideoClicks>';
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 2 hrs to fix
    test/ads/vast/VASTResponse.spec.js on lines 347..360

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

          it("must not add anything to the response if you don't pass an instance of InLine", function () {
            response._addInLine();
            response._addInLine({});
            response._addInLine([]);
            response._addInLine('');
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 3 other locations - About 1 hr to fix
    test/ads/vast/VASTResponse.spec.js on lines 331..337
    test/ads/vast/VASTResponse.spec.js on lines 407..413
    test/ads/vast/VASTResponse.spec.js on lines 527..533

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

    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 add anything to the response if you don't pass an instance of Wrapper", function () {
            response._addWrapper();
            response._addWrapper({});
            response._addWrapper([]);
            response._addWrapper('');
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 3 other locations - About 1 hr to fix
    test/ads/vast/VASTResponse.spec.js on lines 331..337
    test/ads/vast/VASTResponse.spec.js on lines 407..413
    test/ads/vast/VASTResponse.spec.js on lines 481..487

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

    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 add anything to the response if you don't pass an instace of InLine", function () {
            response._addLinear();
            response._addLinear({});
            response._addLinear([]);
            response._addLinear('');
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 3 other locations - About 1 hr to fix
    test/ads/vast/VASTResponse.spec.js on lines 331..337
    test/ads/vast/VASTResponse.spec.js on lines 481..487
    test/ads/vast/VASTResponse.spec.js on lines 527..533

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

    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 add anything to the response if you don't pass an instace of InLine", function () {
            response._addVideoClicks();
            response._addVideoClicks({});
            response._addVideoClicks([]);
            response._addVideoClicks('');
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 3 other locations - About 1 hr to fix
    test/ads/vast/VASTResponse.spec.js on lines 407..413
    test/ads/vast/VASTResponse.spec.js on lines 481..487
    test/ads/vast/VASTResponse.spec.js on lines 527..533

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

    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 add the error url macro to the response", function () {
            var inLine = new InLine(xml.toJXONTree('<InLine><Error><![CDATA[http://errorUrl[ERRORCODE]]]></Error></InLine>'));
            response._addInLine(inLine);
            assert.deepEqual(response.errorURLMacros, ['http://errorUrl[ERRORCODE]']);
    
    
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 1 hr to fix
    test/ads/vast/VASTResponse.spec.js on lines 535..539

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

    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 add the error url macro to the response", function () {
            var wrapper = new Wrapper(xml.toJXONTree('<Wrapper><Error><![CDATA[http://errorUrl[ERRORCODE]]]></Error></Wrapper>'));
            response._addWrapper(wrapper);
            assert.deepEqual(response.errorURLMacros, ['http://errorUrl[ERRORCODE]']);
          });
    Severity: Major
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 1 hr to fix
    test/ads/vast/VASTResponse.spec.js on lines 495..500

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

    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 createTrackEvent(eventName, uri) {
            var trackingXML = '<Tracking event="' + eventName + '">' +
              '<![CDATA[' + uri + ']]>' +
              '</Tracking>';
            return new TrackingEvent(xml.toJXONTree(trackingXML));
    Severity: Major
    Found in test/ads/vast/VASTResponse.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/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

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

            var linearXML = '<?xml version="1.0" encoding="UTF-8"?>' +
              '<Linear>' +
              '<MediaFiles>' +
              '<MediaFile id="1" delivery="progressive" type="video/x-flv" bitrate="457" width="300" height="225">' +
              '<![CDATA[http://gcdn.2mdn.net/MotifFiles/html/2215309/PID_914438_1235753019000_dcrmvideo.flv]]>' +
    Severity: Minor
    Found in test/ads/vast/VASTResponse.spec.js and 1 other location - About 35 mins to fix
    test/ads/vast/Wrapper.spec.js on lines 43..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 47.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status