airbug/bugcore

View on GitHub

Showing 357 of 357 total issues

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

        remove: function(value) {
            if (this.contains(value)) {
                var index = this.indexOfFirst(value);
                this.removeAt(index);
                return true;
Severity: Major
Found in libraries/bugcore/js/src/data/List.js and 3 other locations - About 1 hr to fix
libraries/bugcore/js/src/data/Queue.js on lines 125..132
libraries/bugcore/js/src/data/Stack.js on lines 132..139
libraries/bugcore/js/src/observable/data/ObservableList.js on lines 99..106

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

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

        remove: function(value) {
            if (this.contains(value)) {
                var index = this.indexOfLast(value);
                this.removeAt(index);
                return true;
Severity: Major
Found in libraries/bugcore/js/src/data/Stack.js and 3 other locations - About 1 hr to fix
libraries/bugcore/js/src/data/List.js on lines 144..151
libraries/bugcore/js/src/data/Queue.js on lines 125..132
libraries/bugcore/js/src/observable/data/ObservableList.js on lines 99..106

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

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 iterate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ObjectUtil.iterate = function(object, iteratee, options) {
        if (!TypeUtil.isObjectLike(object)) {
            throw new TypeError("'object' must be Object like");
        }
        if (!iteratee || (iteratee && !iteratee.call)) {
Severity: Minor
Found in libraries/bugcore/js/src/util/ObjectUtil.js - About 1 hr to fix

    Function clone has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Obj.clone = function(value, deep) {
            var clone = null;
            if (TypeUtil.isDate(value)) {
                clone = new Date();
                clone.setTime(value.getTime());
    Severity: Minor
    Found in libraries/bugcore/js/src/core/Obj.js - About 1 hr to fix

      Function resolveValueAsObject has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              resolveValueAsObject: function(object, fulfilledCallback, rejectedCallback) {
                  var _this = this;
                  try {
                      var then = object.then;
                      if (TypeUtil.isFunction(then)) {
      Severity: Minor
      Found in libraries/bugcore/js/src/promise/resolvers/ValuesResolver.js - About 1 hr to fix

        Function sortBugpackRequires has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var sortBugpackRequires = function(fileContents) {
            var lines   = generateLines(fileContents);
            lines.sort(function(a, b) {
                var resultsA = a.line.match(/^\s*var \w+\s+=\s+bugpack\.require\(('|")((?:\w|\.)*)\1\);\s*$/);
                var resultsB = b.line.match(/^\s*var \w+\s+=\s+bugpack\.require\(('|")((?:\w|\.)*)\1\);\s*$/);
        Severity: Minor
        Found in lintbug.js - About 1 hr to fix

          Function sortRequireAnnotations has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var sortRequireAnnotations = function(fileContents) {
              var lines   = generateLines(fileContents);
              lines.sort(function(a, b) {
                  var resultsA = a.line.match(/^\s*\/\/\s*@Require\(('|")((?:\w|\.)*)\1\)\s*$/);
                  var resultsB = b.line.match(/^\s*\/\/\s*@Require\(('|")((?:\w|\.)*)\1\)\s*$/);
          Severity: Minor
          Found in lintbug.js - About 1 hr to fix

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

                    processThrowable: function(throwable) {
                        if (!this.exception) {
                            this.exception = Throwables.parallelException();
                        }
                        this.exception.addCause(throwable);
            Severity: Major
            Found in libraries/bugcore/js/src/flow/flows/Parallel.js and 1 other location - About 1 hr to fix
            libraries/bugcore/js/src/flow/flows/WhileParallel.js on lines 164..169

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

            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

                    nextKeyValuePair: function() {
                        var key     = this.nextKey();
                        var value   = this.reflectObject.getProperty(key);
                        return {
                            key: key,
            libraries/bugcore/js/src/data/iterators/HashTableIterator.js on lines 167..174
            libraries/bugcore/js/src/data/iterators/WeightedListIterator.js on lines 153..160
            libraries/bugcore/js/src/reflect/iterators/ReflectArrayIterator.js on lines 178..185

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

            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

                    nextKeyValuePair: function() {
                        var key     = this.nextKey();
                        var value   = this.hashTable.get(key);
                        return {
                            key: key,
            libraries/bugcore/js/src/data/iterators/WeightedListIterator.js on lines 153..160
            libraries/bugcore/js/src/reflect/iterators/ReflectArrayIterator.js on lines 178..185
            libraries/bugcore/js/src/reflect/iterators/ReflectObjectIterator.js on lines 217..224

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

            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

                    nextIndexValuePair: function() {
                        var index = this.nextIndex();
                        var value = this.weightedList.getAt(index);
                        return {
                            index: index,
            libraries/bugcore/js/src/data/iterators/HashTableIterator.js on lines 167..174
            libraries/bugcore/js/src/reflect/iterators/ReflectArrayIterator.js on lines 178..185
            libraries/bugcore/js/src/reflect/iterators/ReflectObjectIterator.js on lines 217..224

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

            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

                    nextIndexValuePair: function() {
                        var index = this.nextIndex();
                        var value = this.reflectArray.getAt(index);
                        return {
                            index: index,
            libraries/bugcore/js/src/data/iterators/HashTableIterator.js on lines 167..174
            libraries/bugcore/js/src/data/iterators/WeightedListIterator.js on lines 153..160
            libraries/bugcore/js/src/reflect/iterators/ReflectObjectIterator.js on lines 217..224

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

            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

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

                    processThrowable: function(throwable) {
                        if (!this.exception) {
                            this.exception = Throwables.parallelException();
                        }
                        this.exception.addCause(throwable);
            Severity: Major
            Found in libraries/bugcore/js/src/flow/flows/WhileParallel.js and 1 other location - About 1 hr to fix
            libraries/bugcore/js/src/flow/flows/Parallel.js on lines 159..164

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

            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

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

                                if (TypeUtil.isUndefined(result)) {
                                    this.getForwardPromise().resolve([]);
                                } else {
                                    this.getForwardPromise().resolve([result]);
                                }
            libraries/bugcore/js/src/promise/handlers/CallbackHandler.js on lines 100..104

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

            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

                StringUtil.ltrim = function(value, chars) {
                    chars = chars || "\\s";
                    return value.replace(new RegExp("^[" + chars + "]+", "g"), "");
                };
            Severity: Major
            Found in libraries/bugcore/js/src/util/StringUtil.js and 1 other location - About 1 hr to fix
            libraries/bugcore/js/src/util/StringUtil.js on lines 234..237

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

            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

                    equals: function(value) {
                        if (Class.doesExtend(value, WeightedListNode)) {
                            return Obj.equals(value.getValue(), this.value);
                        }
                        return false;
            Severity: Major
            Found in libraries/bugcore/js/src/data/WeightedListNode.js and 1 other location - About 1 hr to fix
            libraries/bugcore/js/src/data/GraphNode.js on lines 90..95

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

            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

                            this.causes.forEach(function(cause) {
                                count++;
                                stack += _this.type + " cause " + count + ":\n";
                                stack += cause.message + "\n";
                                stack += cause.stack;
            Severity: Major
            Found in libraries/bugcore/js/src/throwable/Throwable.js and 1 other location - About 1 hr to fix
            libraries/bugcore/js/src/throwable/MappedParallelException.js on lines 154..159

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

            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

                StringUtil.rtrim = function(value, chars) {
                    chars = chars || "\\s";
                    return value.replace(new RegExp("[" + chars + "]+$", "g"), "");
                };
            Severity: Major
            Found in libraries/bugcore/js/src/util/StringUtil.js and 1 other location - About 1 hr to fix
            libraries/bugcore/js/src/util/StringUtil.js on lines 164..167

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

            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

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

                                if (TypeUtil.isUndefined(result)) {
                                    this.getForwardPromise().resolve([]);
                                } else {
                                    this.getForwardPromise().resolve([result]);
                                }
            libraries/bugcore/js/src/promise/handlers/CallbackHandler.js on lines 128..132

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

            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

                    equals: function(value) {
                        if (Class.doesExtend(value, GraphNode)) {
                            return Obj.equals(value.getValue(), this.value);
                        }
                        return false;
            Severity: Major
            Found in libraries/bugcore/js/src/data/GraphNode.js and 1 other location - About 1 hr to fix
            libraries/bugcore/js/src/data/WeightedListNode.js on lines 104..109

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

            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