crowbar/crowbar-core

View on GitHub

Showing 6,062 of 6,062 total issues

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

  DynamicTable.prototype.initialize = function() {
    this.prepareTemplate();
    this.prepareJson();
    this.registerEvents();
    this.renderEntries();
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 10411..10416

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

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

    _refresh: function() {
        this._createRange();
        this._createHandles();
        this._setupEvents();
        this._refreshValue();
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 1 other location - About 35 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 34..39

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

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

    describe "to update" do
      before do
        @node = Node.find_by_name("testing.crowbar.com")
      end

Severity: Minor
Found in crowbar_framework/spec/models/crowbar_service_spec.rb and 2 other locations - About 30 mins to fix
crowbar_framework/spec/models/crowbar_service_spec.rb on lines 100..108
crowbar_framework/spec/models/crowbar_service_spec.rb on lines 112..120

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

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

    describe "to hardware-updating" do
      before do
        @node = Node.find_by_name("testing.crowbar.com")
      end

Severity: Minor
Found in crowbar_framework/spec/models/crowbar_service_spec.rb and 2 other locations - About 30 mins to fix
crowbar_framework/spec/models/crowbar_service_spec.rb on lines 100..108
crowbar_framework/spec/models/crowbar_service_spec.rb on lines 124..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 33.

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

    describe "to hardware-installing" do
      before do
        @node = Node.find_by_name("testing.crowbar.com")
      end

Severity: Minor
Found in crowbar_framework/spec/models/crowbar_service_spec.rb and 2 other locations - About 30 mins to fix
crowbar_framework/spec/models/crowbar_service_spec.rb on lines 112..120
crowbar_framework/spec/models/crowbar_service_spec.rb on lines 124..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 33.

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

Avoid too many return statements within this function.
Open

    if (type == "variable") return cont(pushlex("stat"), maybelabel);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return changed ? "changed" : moved ? "moved" : false;
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/codemirror.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "function") return cont(functiondef);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

              return {from: reverse ? end : start, to: reverse ? start : end};
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/codemirror.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("comment", "comment");
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
                                         block, poplex, poplex);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        if (!anyMod && code == 13) {return;} // enter
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/codemirror.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return lexical.indented + (closing ? 0 : indentUnit);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return known ? ret(known.type, known.style, word) :
                     ret("variable", "variable", word);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("regexp", "string");
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == ".") return cont(property, maybeoperator);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        if (!anyMod && code == 9 && handleTab(e.e.shiftKey)) return e.stop(); // tab
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/codemirror.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else if (lexical.align) return lexical.column + (closing ? 0 : 1);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return cont();
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix
Severity
Category
Status
Source
Language