yahoo/kobold-core

View on GitHub

Showing 36 of 36 total issues

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

        getBuildScreen: function (name) {
            return this.getPromise().then(function () {
                return this._readImage(path.join(this._getBuildPath(), name + '.png'));
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/fileStorageAdapter.js and 2 other locations - About 2 hrs to fix
lib/storageAdapter/fileStorageAdapter.js on lines 275..279
lib/storageAdapter/fileStorageAdapter.js on lines 394..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 75.

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

        getBuildScreenNames: function () {
            return this.getPromise().then(function () {
                return this._connection.getBucketKeys(this._getBuildScreenBucket());
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/keyValueStorageAdapter.js and 3 other locations - About 1 hr to fix
lib/storageAdapter/keyValueStorageAdapter.js on lines 297..301
lib/storageAdapter/keyValueStorageAdapter.js on lines 341..345
lib/storageAdapter/keyValueStorageAdapter.js on lines 429..433

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

        getCurrentApprovedScreenNames: function () {
            return this.getPromise().then(function () {
                return this._connection.getBucketKeys(this._getCurrentApprovedScreenBucket());
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/keyValueStorageAdapter.js and 3 other locations - About 1 hr to fix
lib/storageAdapter/keyValueStorageAdapter.js on lines 341..345
lib/storageAdapter/keyValueStorageAdapter.js on lines 385..389
lib/storageAdapter/keyValueStorageAdapter.js on lines 429..433

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

        getHighlightScreenNames: function () {
            return this.getPromise().then(function () {
                return this._connection.getBucketKeys(this._getHighlightScreenBucket());
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/keyValueStorageAdapter.js and 3 other locations - About 1 hr to fix
lib/storageAdapter/keyValueStorageAdapter.js on lines 297..301
lib/storageAdapter/keyValueStorageAdapter.js on lines 341..345
lib/storageAdapter/keyValueStorageAdapter.js on lines 385..389

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

        getApprovedScreenNames: function () {
            return this.getPromise().then(function () {
                return this._connection.getBucketKeys(this._getApprovedScreenBucket());
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/keyValueStorageAdapter.js and 3 other locations - About 1 hr to fix
lib/storageAdapter/keyValueStorageAdapter.js on lines 297..301
lib/storageAdapter/keyValueStorageAdapter.js on lines 385..389
lib/storageAdapter/keyValueStorageAdapter.js on lines 429..433

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

        getCurrentApprovedScreenNames: function () {
            return this.getPromise().then(function () {
                return this._readDirAndFilter(this._getApprovedPath());
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/fileStorageAdapter.js and 2 other locations - About 1 hr to fix
lib/storageAdapter/fileStorageAdapter.js on lines 341..345
lib/storageAdapter/fileStorageAdapter.js on lines 381..385

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

        getBuildScreenNames: function () {
            return this.getPromise().then(function () {
                return this._readDirAndFilter(this._getBuildPath());
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/fileStorageAdapter.js and 2 other locations - About 1 hr to fix
lib/storageAdapter/fileStorageAdapter.js on lines 262..266
lib/storageAdapter/fileStorageAdapter.js on lines 381..385

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

        getHighlightScreenNames: function () {
            return this.getPromise().then(function () {
                return this._readDirAndFilter(this._getHighlightPath());
            }.bind(this));
        },
Severity: Major
Found in lib/storageAdapter/fileStorageAdapter.js and 2 other locations - About 1 hr to fix
lib/storageAdapter/fileStorageAdapter.js on lines 262..266
lib/storageAdapter/fileStorageAdapter.js on lines 341..345

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

Function _prepareBucket has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        _prepareBucket: function (bucketName, key, initialValue, failWhenExist) {

            return this.getPromise().then(function () {

                return this._connection.hasBucket(bucketName).then(function (hasBucket) {
Severity: Minor
Found in lib/storageAdapter/keyValueStorageAdapter.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        run : function () {
            return new Promise(function (resolve, reject) {

                var imageA = this.getImageA(),
                    pathA,
Severity: Minor
Found in lib/comparisonAdapter/shellAdapter.js - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        if (typeof type == 'string') {
            AdapterClass = core.comparisonAdapters[type.toLowerCase()];
            return new AdapterClass(adapterOptions);
        } else {
            return type; // Use as instance instead
Severity: Minor
Found in index.js and 1 other location - About 50 mins to fix
index.js on lines 133..138

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

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

        if (typeof type == 'string') {
            AdapterClass = core.connectionAdapters[type.toLowerCase()];
            return new AdapterClass(adapterOptions);
        } else {
            return type; // Use as instance instead
Severity: Minor
Found in index.js and 1 other location - About 50 mins to fix
index.js on lines 45..50

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

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

                return this._request({
                    method: 'GET',
                    url: this._getUrlWithPath('/buckets/' + encodeURIComponent(bucket) + '/keys/' + encodeURIComponent(key))
                }).then(function (response) {
Severity: Minor
Found in lib/connectionAdapter/riakConnectionAdapter.js and 1 other location - About 40 mins to fix
lib/connectionAdapter/riakConnectionAdapter.js on lines 211..214

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

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

                return this._request({
                    method: 'DELETE',
                    url: this._getUrlWithPath('/buckets/' + encodeURIComponent(bucket) + '/keys/' + encodeURIComponent(key))
                });
Severity: Minor
Found in lib/connectionAdapter/riakConnectionAdapter.js and 1 other location - About 40 mins to fix
lib/connectionAdapter/riakConnectionAdapter.js on lines 139..142

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

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

Function _evaluateResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        _evaluateResult: function (err, result, blinkDiff, resolve, reject) {
Severity: Minor
Found in lib/comparisonAdapter/blinkDiffAdapter.js - About 35 mins to fix

Function _evaluateResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        _evaluateResult: function (err, result, diff, resolve, reject) {
Severity: Minor
Found in lib/comparisonAdapter/perceptualDiffAdapter.js - About 35 mins to fix
Severity
Category
Status
Source
Language