yahoo/pngjs-image

View on GitHub

Showing 256 of 322 total issues

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

        describe('Signature byte 1 MSBit reset to zero', function () {
            testGen.addDecodeTests({
                resourceGroup: 'corrupt',
                resourceFile: 'xs2n0g01',
                expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

        describe('added lf bytes', function () {
            testGen.addDecodeTests({
                resourceGroup: 'corrupt',
                resourceFile: 'xlfn0g04',
                expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

            describe('3', function () {
                testGen.addDecodeTests({
                    resourceGroup: 'corrupt',
                    resourceFile: 'xd3n2c08',
                    expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

var Interlace = function (headerChunk, options) {
    this._headerChunk = headerChunk;
    this._options = options || {};
};
Severity: Major
Found in lib/png/processor/interlace.js and 4 other locations - About 30 mins to fix
lib/png/processor/filter.js on lines 15..18
lib/png/processor/normalizer.js on lines 14..17
lib/png/processor/parser.js on lines 15..18
lib/png/processor/scaler.js on lines 14..17

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

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

        describe('Missing IDAT', function () {
            testGen.addDecodeTests({
                resourceGroup: 'corrupt',
                resourceFile: 'xdtn0g01',
                expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117

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

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

var Filter = function (headerChunk, options) {
    this._headerChunk = headerChunk;
    this._options = options || {};
};
Severity: Major
Found in lib/png/processor/filter.js and 4 other locations - About 30 mins to fix
lib/png/processor/interlace.js on lines 14..17
lib/png/processor/normalizer.js on lines 14..17
lib/png/processor/parser.js on lines 15..18
lib/png/processor/scaler.js on lines 14..17

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

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

            describe('0', function () {
                testGen.addDecodeTests({
                    resourceGroup: 'corrupt',
                    resourceFile: 'xd0n2c08',
                    expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

            describe('99', function () {
                testGen.addDecodeTests({
                    resourceGroup: 'corrupt',
                    resourceFile: 'xd9n2c08',
                    expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 123..130

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

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

var Parser = function (headerChunk, options) {
    this._headerChunk = headerChunk;
    this._options = options || {};
};
Severity: Major
Found in lib/png/processor/parser.js and 4 other locations - About 30 mins to fix
lib/png/processor/filter.js on lines 15..18
lib/png/processor/interlace.js on lines 14..17
lib/png/processor/normalizer.js on lines 14..17
lib/png/processor/scaler.js on lines 14..17

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

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

            describe('9', function () {
                testGen.addDecodeTests({
                    resourceGroup: 'corrupt',
                    resourceFile: 'xc9n2c08',
                    expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

        describe('Signature byte 4 lowercase', function () {
            testGen.addDecodeTests({
                resourceGroup: 'corrupt',
                resourceFile: 'xs4n0g01',
                expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

var Normalizer = function (headerChunk, options) {
    this._headerChunk = headerChunk;
    this._options = options || {};
};
Severity: Major
Found in lib/png/processor/normalizer.js and 4 other locations - About 30 mins to fix
lib/png/processor/filter.js on lines 15..18
lib/png/processor/interlace.js on lines 14..17
lib/png/processor/parser.js on lines 15..18
lib/png/processor/scaler.js on lines 14..17

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

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

            describe('1', function () {
                testGen.addDecodeTests({
                    resourceGroup: 'corrupt',
                    resourceFile: 'xc1n0g08',
                    expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

var Scaler = function (headerChunk, options) {
    this._headerChunk = headerChunk;
    this._options = options || {};
};
Severity: Major
Found in lib/png/processor/scaler.js and 4 other locations - About 30 mins to fix
lib/png/processor/filter.js on lines 15..18
lib/png/processor/interlace.js on lines 14..17
lib/png/processor/normalizer.js on lines 14..17
lib/png/processor/parser.js on lines 15..18

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

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

        describe('7th byte a space instead of control-Z', function () {
            testGen.addDecodeTests({
                resourceGroup: 'corrupt',
                resourceFile: 'xs7n0g01',
                expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 48..55
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

        describe('added cr bytes', function () {
            testGen.addDecodeTests({
                resourceGroup: 'corrupt',
                resourceFile: 'xcrn0g04',
                expectFailure: true,
Severity: Major
Found in test/png/decode/corrupt.js and 11 other locations - About 30 mins to fix
test/png/decode/corrupt.js on lines 12..19
test/png/decode/corrupt.js on lines 21..28
test/png/decode/corrupt.js on lines 30..37
test/png/decode/corrupt.js on lines 39..46
test/png/decode/corrupt.js on lines 57..64
test/png/decode/corrupt.js on lines 71..78
test/png/decode/corrupt.js on lines 80..87
test/png/decode/corrupt.js on lines 92..99
test/png/decode/corrupt.js on lines 101..108
test/png/decode/corrupt.js on lines 110..117
test/png/decode/corrupt.js on lines 123..130

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

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

Severity
Category
Status
Source
Language