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

        switch ( origin[ 0 ] ) {
            case "top": y = 0; break;
            case "middle": y = 0.5; break;
            case "bottom": y = 1; break;
            default: y = origin[ 0 ] / original.height;
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 1 other location - About 1 hr to fix
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 13648..13653

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

      while (namespace.length > 1) {
        var current_namespace = namespace.shift();

        if (!data[current_namespace]) {
          data[current_namespace] = {};
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 80..88
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 215..223
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 260..268
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 305..313
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 378..386
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 112..120
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 135..143
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 164..172

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

    if ( options.at[ 1 ] === "bottom" ) {
        basePosition.top += targetHeight;
    } else if ( options.at[ 1 ] === "center" ) {
        basePosition.top += targetHeight / 2;
    }
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 3 other locations - About 1 hr to fix
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1152..1156
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1180..1184
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1186..1190

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

    while (keys.length > 1) {
      var part = keys.shift();

      if (!data[part]) {
        data[part] = {};
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 80..88
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 215..223
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 260..268
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 305..313
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 336..344
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 378..386
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 135..143
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 164..172

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

      while (namespace.length > 1) {
        var current_namespace = namespace.shift();

        if (!data[current_namespace]) {
          data[current_namespace] = {};
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 80..88
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 260..268
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 305..313
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 336..344
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 378..386
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 112..120
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 135..143
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 164..172

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

    if ( options.at[ 0 ] === "right" ) {
        basePosition.left += targetWidth;
    } else if ( options.at[ 0 ] === "center" ) {
        basePosition.left += targetWidth / 2;
    }
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 3 other locations - About 1 hr to fix
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1158..1162
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1180..1184
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1186..1190

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

        if ( options.my[ 1 ] === "bottom" ) {
            position.top -= elemHeight;
        } else if ( options.my[ 1 ] === "center" ) {
            position.top -= elemHeight / 2;
        }
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js and 3 other locations - About 1 hr to fix
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1152..1156
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1158..1162
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 1180..1184

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

      while (keys.length > 1) {
        var part = keys.shift();

        if (!data[part]) {
          data[part] = {};
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 80..88
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 215..223
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 260..268
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 305..313
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 336..344
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 378..386
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 112..120
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 164..172

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

    while (namespace.length > 1) {
      var current_namespace = namespace.shift();

      if (!data[current_namespace]) {
        data[current_namespace] = {};
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 80..88
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 215..223
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 260..268
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 305..313
crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js on lines 336..344
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 112..120
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 135..143
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 164..172

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

  def save_config_to_databag(old_role, role)
    if role.nil?
      config = nil
    else
      server_nodes_names = role.override_attributes["logging"]["elements"]["logging-server"]
Severity: Major
Found in crowbar_framework/app/models/logging_service.rb and 1 other location - About 1 hr to fix
crowbar_framework/app/models/ntp_service.rb on lines 92..112

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

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

  def save_config_to_databag(old_role, role)
    if role.nil?
      config = nil
    else
      server_nodes_names = role.override_attributes["ntp"]["elements"]["ntp-server"]
Severity: Major
Found in crowbar_framework/app/models/ntp_service.rb and 1 other location - About 1 hr to fix
crowbar_framework/app/models/logging_service.rb on lines 82..102

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

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

function ajaxHandleResponses( s, jqXHR, responses ) {
    var firstDataType, ct, finalDataType, type,
        contents = s.contents,
        dataTypes = s.dataTypes;

Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/jquery.js - About 1 hr to fix

Function matchBrackets has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function matchBrackets(autoclear) {
      var head = sel.inverted ? sel.from : sel.to, line = lines[head.line], pos = head.ch - 1;
      var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
      if (!match) return;
      var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles;

Function _respectSize has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _respectSize: function( data ) {

        var o = this._vBoundaries,
            a = this.axis,
            ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function _possibleChars has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _possibleChars: function (format) {
        var iFormat,
            chars = "",
            literal = false,
            // Check whether a format character is doubled
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function drag has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    drag: function(draggable, event) {

        //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
        if(draggable.options.refreshPositions) {
            $.ui.ddmanager.prepareOffsets(draggable, event);
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function _mouseDown has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _mouseDown: function(event) {
        // don't let more than one widget handle mouseStart
        if( mouseHandled ) { return; }

        // we may have missed mouseup (out of window)
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function _createPlaceholder has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createPlaceholder: function(that) {
        that = that || this;
        var className,
            o = that.options;

Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function remove has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function remove(el, opts) {
            var count;
            var full = (el == window);
            var $el = $(el);
            var data = $el.data('blockUI.history');
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/blockui.js - About 1 hr to fix

Function drop has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.effects.effect.drop = function( o, done ) {

    var el = $( this ),
        props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
        mode = $.effects.setMode( el, o.mode || "hide" ),
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix
Severity
Category
Status
Source
Language