MailOnline/videojs-vast-vpaid

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

Summary

Maintainability
B
6 hrs
Test Coverage

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

    it("must returns false if it contains a non supported linear", function(){
      creative.linear = {
        isSupported: function(){
          return false;
        }
Severity: Major
Found in test/ads/vast/Creative.spec.js and 1 other location - About 1 hr to fix
test/ads/vast/Creative.spec.js on lines 91..98

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

    it("must returns true if it contains a supported linear", function(){
      creative.linear = {
        isSupported: function(){
          return true;
        }
Severity: Major
Found in test/ads/vast/Creative.spec.js and 1 other location - About 1 hr to fix
test/ads/vast/Creative.spec.js on lines 82..89

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

  it("must set the sequence if set", function(){
    var creativeXML = '<Creative id="8455" sequence="1"></Creative>';
    var creative = new Creative(xml.toJXONTree(creativeXML));
    assert.equal(creative.sequence, 1);
  });
Severity: Major
Found in test/ads/vast/Creative.spec.js and 5 other locations - About 1 hr to fix
test/ads/vast/Creative.spec.js on lines 27..31
test/ads/vast/Linear.spec.js on lines 19..23
test/ads/vast/Linear.spec.js on lines 115..119
test/ads/vast/Linear.spec.js on lines 121..125
test/ads/vast/Linear.spec.js on lines 127..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 55.

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

  it("must set the the ad id if set", function(){
    var creativeXML = '<Creative adId="8455"></Creative>';
    var creative = new Creative(xml.toJXONTree(creativeXML));
    assert.equal(creative.adId, 8455);
  });
Severity: Major
Found in test/ads/vast/Creative.spec.js and 5 other locations - About 1 hr to fix
test/ads/vast/Creative.spec.js on lines 21..25
test/ads/vast/Linear.spec.js on lines 19..23
test/ads/vast/Linear.spec.js on lines 115..119
test/ads/vast/Linear.spec.js on lines 121..125
test/ads/vast/Linear.spec.js on lines 127..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 55.

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 set the id if passed", function(){
    var creativeXML = '<Creative id="8455"></Creative>';
    var creative = new Creative(xml.toJXONTree(creativeXML));
    assert.equal(creative.id, '8455');
  });
Severity: Major
Found in test/ads/vast/Creative.spec.js and 1 other location - About 1 hr to fix
test/ads/vast/Creative.spec.js on lines 33..37

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

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 set the the apiFramework if set", function(){
    var creativeXML = '<Creative apiFramework="fooFramework"></Creative>';
    var creative = new Creative(xml.toJXONTree(creativeXML));
    assert.equal(creative.apiFramework, "fooFramework");
  });
Severity: Major
Found in test/ads/vast/Creative.spec.js and 1 other location - About 1 hr to fix
test/ads/vast/Creative.spec.js on lines 15..19

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

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