MailOnline/videojs-vast-vpaid

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

Summary

Maintainability
B
5 hrs
Test Coverage

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

  describe("allowMultipleAds", function () {
    it("must be set if the attr is present on the wrapper tag", function () {
      var wrapperXML = '<Wrapper allowMultipleAds="false"></Wrapper>';
      var wrapper = new Wrapper(xml.toJXONTree(wrapperXML));
      assert.isFalse(wrapper.allowMultipleAds);
Severity: Major
Found in test/ads/vast/Wrapper.spec.js and 1 other location - About 1 hr to fix
test/ads/vast/Wrapper.spec.js on lines 133..139

Duplicated Code

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

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

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

Tuning

This issue has a mass of 67.

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

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

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

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

Refactorings

Further Reading

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

  describe("fallbackOnNoAd", function () {
    it("must be set if the attr is present on the wrapper tag", function () {
      var wrapperXML = '<Wrapper fallbackOnNoAd="false"></Wrapper>';
      var wrapper = new Wrapper(xml.toJXONTree(wrapperXML));
      assert.isFalse(wrapper.fallbackOnNoAd);
Severity: Major
Found in test/ads/vast/Wrapper.spec.js and 1 other location - About 1 hr to fix
test/ads/vast/Wrapper.spec.js on lines 125..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 67.

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

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

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

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

Refactorings

Further Reading

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

    it("must be undefined if not set", function () {
      var wrapper = new Wrapper(xml.toJXONTree('<Wrapper></Wrapper>'));
      assert.isUndefined(wrapper.extensions);
    });
Severity: Major
Found in test/ads/vast/Wrapper.spec.js and 4 other locations - About 35 mins to fix
test/ads/vast/Ad.spec.js on lines 24..27
test/ads/vast/Ad.spec.js on lines 29..32
test/ads/vast/Wrapper.spec.js on lines 18..21
test/ads/vast/Wrapper.spec.js on lines 113..116

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

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

    it("must be true by default", function () {
      var wrapper = new Wrapper(xml.toJXONTree('<Wrapper></Wrapper>'));
      assert.isTrue(wrapper.followAdditionalWrappers);
    });
Severity: Major
Found in test/ads/vast/Wrapper.spec.js and 4 other locations - About 35 mins to fix
test/ads/vast/Ad.spec.js on lines 24..27
test/ads/vast/Ad.spec.js on lines 29..32
test/ads/vast/Wrapper.spec.js on lines 18..21
test/ads/vast/Wrapper.spec.js on lines 80..83

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

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

    it("must be an array", function () {
      var wrapper = new Wrapper(xml.toJXONTree('<Wrapper></Wrapper>'));
      assert.isArray(wrapper.impressions);
    });
Severity: Major
Found in test/ads/vast/Wrapper.spec.js and 4 other locations - About 35 mins to fix
test/ads/vast/Ad.spec.js on lines 24..27
test/ads/vast/Ad.spec.js on lines 29..32
test/ads/vast/Wrapper.spec.js on lines 80..83
test/ads/vast/Wrapper.spec.js on lines 113..116

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

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

      var wrapperXML = '<Wrapper>' +
        '<Impression id="DART">' +
        '<![CDATA[http://ad.doubleclick.net/imp;v7;x;223626102;0-0;0;47414672;0/0;30477563/30495440/1;;~aopt=0/0/ff/0;~cs=j%3fhttp://s0.2mdn.net/dot.gif]]>' +
        '</Impression>' +
        '<Impression id="ThirdParty">' +
Severity: Minor
Found in test/ads/vast/Wrapper.spec.js and 1 other location - About 35 mins to fix
test/ads/vast/VASTResponse.spec.js on lines 388..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 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