randytarampi/ios-splash

View on GitHub
test.js

Summary

Maintainability
A
0 mins
Test Coverage

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

test('returns storyboard image for width 2732, prioritizing over size', function (t) {
  t.plan(3)
  var image = splash({ size: 'Default@2x~universal~anyany', width: 2732 })
  t.equal(image.name, 'Default@2x~universal~anyany.png', 'image has correct name')
  t.equal(image.width, 2732, 'image has correct width')
Severity: Major
Found in test.js and 1 other location - About 3 hrs to fix
test.js on lines 85..91

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

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

test('returns splash image for width 320, prioritizing over size', function (t) {
  t.plan(3)
  var image = splash({ size: '@2x~iphone.png', width: 320 })
  t.equal(image.name, 'Default~iphone.png', 'image has correct name')
  t.equal(image.width, 320, 'image has correct width')
Severity: Major
Found in test.js and 1 other location - About 3 hrs to fix
test.js on lines 93..99

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

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

test('cli returns correct image for width 320 as csv', function (t) {
  t.plan(1)
  var expected = 'Default~iphone.png,320,480\n'
  exec('./bin/ios-splash.js --width 320', function (error, stdout, stderr) {
    var err = error || stderr
Severity: Major
Found in test.js and 1 other location - About 2 hrs to fix
test.js on lines 113..123

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

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

test('cli returns all splash images as csv', function (t) {
  t.plan(1)
  var expected = 'Default~iphone.png,320,480\nDefault@2x~iphone.png,640,960\nDefault-Portrait~ipad.png,768,1024\nDefault-Portrait@2x~ipad.png,1536,2048\nDefault-Landscape~ipad.png,1024,768\nDefault-Landscape@2x~ipad.png,2048,1536\nDefault-568h@2x~iphone.png,640,1136\nDefault-667h.png,750,1334\nDefault-Landscape-667h.png,1334,750\nDefault-736h.png,1242,2208\nDefault-Landscape-736h.png,2208,1242\nDefault@2x~universal~anyany.png,2732,2732\nDefault-812h.png,1125,2436\nDefault-Landscape-812h.png,2436,1125\nDefault-896h.png,828,1792\nDefault-Landscape-896h.png,1792,828\nDefault-896h@3x.png,1242,2688\nDefault-Landscape-896h@3x.png,2688,1242\nDefault-1112h.png,1668,2224\nDefault-Landscape-1112h.png,2224,1668\nDefault-1194h.png,1668,2388\nDefault-Landscape-1194h.png,2388,1668\nDefault-1366h.png,2048,2732\nDefault-Landscape-1366h.png,2732,2048\n'
  exec('./bin/ios-splash.js', function (error, stdout, stderr) {
    var err = error || stderr
Severity: Major
Found in test.js and 1 other location - About 2 hrs to fix
test.js on lines 125..135

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

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

test('returns splash image for height 1136 as String', function (t) {
  t.plan(3)
  var image = splash({ height: '1136' })
  t.equal(image.name, 'Default-568h@2x~iphone.png', 'image has correct name')
  t.equal(image.width, 640, 'image has correct width')
Severity: Major
Found in test.js and 6 other locations - About 2 hrs to fix
test.js on lines 21..27
test.js on lines 37..43
test.js on lines 45..51
test.js on lines 61..67
test.js on lines 69..75
test.js on lines 77..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 93.

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

test('returns splash image for size 667h', function (t) {
  t.plan(3)
  var image = splash({ size: '667h' })
  t.equal(image.name, 'Default-667h.png', 'image has correct name')
  t.equal(image.width, 750, 'image has correct width')
Severity: Major
Found in test.js and 6 other locations - About 2 hrs to fix
test.js on lines 21..27
test.js on lines 37..43
test.js on lines 45..51
test.js on lines 53..59
test.js on lines 69..75
test.js on lines 77..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 93.

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

test('returns splash image for size @2x~iphone', function (t) {
  t.plan(3)
  var image = splash({ size: '@2x~iphone' })
  t.equal(image.name, 'Default@2x~iphone.png', 'image has correct name')
  t.equal(image.width, 640, 'image has correct width')
Severity: Major
Found in test.js and 6 other locations - About 2 hrs to fix
test.js on lines 21..27
test.js on lines 37..43
test.js on lines 45..51
test.js on lines 53..59
test.js on lines 61..67
test.js on lines 69..75

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

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

test('returns splash image for size 1024 as String', function (t) {
  t.plan(3)
  var image = splash({ size: '1024' })
  t.equal(image.name, 'Default-Landscape~ipad.png', 'image has correct name')
  t.equal(image.width, 1024, 'image has correct width')
Severity: Major
Found in test.js and 6 other locations - About 2 hrs to fix
test.js on lines 21..27
test.js on lines 45..51
test.js on lines 53..59
test.js on lines 61..67
test.js on lines 69..75
test.js on lines 77..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 93.

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

test('returns splash image for height 1024 as Number', function (t) {
  t.plan(3)
  var image = splash({ height: 1024 })
  t.equal(image.name, 'Default-Portrait~ipad.png', 'image has correct name')
  t.equal(image.width, 768, 'image has correct width')
Severity: Major
Found in test.js and 1 other location - About 2 hrs to fix
test.js on lines 13..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 93.

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

test('returns splash image for size Landscape-736h', function (t) {
  t.plan(3)
  var image = splash({ size: 'Landscape-736h' })
  t.equal(image.name, 'Default-Landscape-736h.png', 'image has correct name')
  t.equal(image.width, 2208, 'image has correct width')
Severity: Major
Found in test.js and 6 other locations - About 2 hrs to fix
test.js on lines 21..27
test.js on lines 37..43
test.js on lines 45..51
test.js on lines 53..59
test.js on lines 61..67
test.js on lines 77..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 93.

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

test('returns splash image for width 640 as Number', function (t) {
  t.plan(3)
  var image = splash({ width: '640' })
  t.equal(image.name, 'Default@2x~iphone.png', 'image has correct name')
  t.equal(image.width, 640, 'image has correct width')
Severity: Major
Found in test.js and 6 other locations - About 2 hrs to fix
test.js on lines 37..43
test.js on lines 45..51
test.js on lines 53..59
test.js on lines 61..67
test.js on lines 69..75
test.js on lines 77..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 93.

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

test('returns splash image for width 2048 as String', function (t) {
  t.plan(3)
  var image = splash({ width: '2048' })
  t.equal(image.name, 'Default-Landscape@2x~ipad.png', 'image has correct name')
  t.equal(image.width, 2048, 'image has correct width')
Severity: Major
Found in test.js and 6 other locations - About 2 hrs to fix
test.js on lines 21..27
test.js on lines 37..43
test.js on lines 53..59
test.js on lines 61..67
test.js on lines 69..75
test.js on lines 77..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 93.

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

test('returns splash image for size 320 as Number', function (t) {
  t.plan(3)
  var image = splash({ size: 320 })
  t.equal(image.name, 'Default~iphone.png', 'image has correct name')
  t.equal(image.width, 320, 'image has correct width')
Severity: Major
Found in test.js and 1 other location - About 2 hrs to fix
test.js on lines 29..35

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

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