crowbar/crowbar-core

View on GitHub

Showing 6,062 of 6,062 total issues

Function each has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    each: function( obj, callback, args ) {
        var value,
            i = 0,
            length = obj.length,
            isArray = isArraylike( obj );
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/jquery.js - About 1 hr to fix

Function patchDisplay has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function patchDisplay(updates) {
      // Slightly different algorithm for IE (badInnerHTML), since
      // there .innerHTML on PRE nodes is dumb, and discards
      // whitespace.
      var sfrom = sel.from.line, sto = sel.to.line, off = 0,

Function _on has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _on: function( suppressDisabledCheck, element, handlers ) {
        var delegateElement,
            instance = this;

        // no suppressDisabledCheck flag, shuffle arguments
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function parseValue has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  DynamicTable.prototype.parseValue = function(type, value) {
    switch (type) {
      case 'string':
        return value.toString();
        break;
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/dynamicTable.js - About 1 hr to fix

Function render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      render: function (fieldset, lookups, options) {
        var self = this,
          fields = fieldset,
          match, token, lookupkey, fieldvalue, prec;
        return this.format.replace(this.fre, function () {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 1 hr to fix

Function clear has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        clear: function () {
            var self = this, cap;
            self.$btnUpload.removeAttr('disabled');
            self.getThumbs().find('video,audio,img').each(function () {
                self.cleanMemory($(this));
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/bootstrap/fileinput.js - About 1 hr to fix

Function activate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Tab.prototype.activate = function (element, container, callback) {
    var $active    = container.find('> .active')
    var transition = callback
      && $.support.transition
      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/bootstrap/tab.js - About 1 hr to fix

Function previewFile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        previewFile: function (i, file, theFile, previewId, data) {
            if (!this.showPreview) {
                return;
            }
            var self = this, cat = self.parseFileType(file), fname = file ? file.name : '', caption = self.slug(fname),
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/bootstrap/fileinput.js - About 1 hr to fix

Function createFunctionContext has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    createFunctionContext: function(asObject) {
      var locals = this.stackVars.concat(this.registers.list);

      if(locals.length > 0) {
        this.source[1] = this.source[1] + ", " + locals.join(", ");
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/misc/handlebars.js - About 1 hr to fix

Method status has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def status
    @result = {
      nodes: {},
      groups: {}
    }.tap do |result|
Severity: Minor
Found in crowbar_framework/app/controllers/nodes_controller.rb - About 1 hr to fix

Method validate_proposal_after_save has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def validate_proposal_after_save proposal
    super

    errors = []

Severity: Minor
Found in crowbar_framework/app/models/nfs_client_service.rb - About 1 hr to fix

Method upgrade_knife_files_1_9 has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def upgrade_knife_files_1_9
      Rails.logger.debug "Upgrading chef backup files"
      @data.join("knife", "databags", "barclamps").rmtree
      knife_path = @data.join("knife")

Severity: Minor
Found in crowbar_framework/lib/crowbar/upgrade.rb - About 1 hr to fix

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

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

      if (!data[current_namespace]) {
        data[current_namespace] = {};
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 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

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

                    var p1 = $.extend(self.getOutData({}, {}, files), {id: previewId, index: index}),
                        p2 = {id: previewId, index: index, file: file, files: files};
crowbar_framework/vendor/assets/javascripts/bootstrap/fileinput.js on lines 2205..2206

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

        switch ( origin[ 1 ] ) {
            case "left": x = 0; break;
            case "center": x = 0.5; break;
            case "right": x = 1; break;
            default: x = origin[ 1 ] / original.width;
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 13642..13647

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[ 0 ] === "right" ) {
            position.left -= elemWidth;
        } else if ( options.my[ 0 ] === "center" ) {
            position.left -= elemWidth / 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 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 112..120
crowbar_framework/vendor/assets/javascripts/jquery/jsonAttribute.js on lines 135..143

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

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

                    var p1 = $.extend(self.getOutData({}, {}, files), {id: previewId, index: index}),
                        p2 = {id: previewId, index: index, file: file, files: files};
crowbar_framework/vendor/assets/javascripts/bootstrap/fileinput.js on lines 2022..2023

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

Severity
Category
Status
Source
Language