crowbar/crowbar-core

View on GitHub

Showing 6,062 of 6,062 total issues

Function _hideDatepicker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _hideDatepicker: function(input) {
        var showAnim, duration, postProcess, onClose,
            inst = this._curInst;

        if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function cancel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    cancel: function() {

        if(this.dragging) {

            this._mouseUp({ target: null });
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function _toggle has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _toggle: function( data ) {
        var toShow = data.newPanel,
            toHide = this.prevShow.length ? this.prevShow : data.oldPanel;

        // handle activating a panel during the animation for another activation
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function _resetButton has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _resetButton: function() {
        if ( this.type === "input" ) {
            if ( this.options.label ) {
                this.element.val( this.options.label );
            }
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function _mouseCapture has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _mouseCapture: function(event, overrideHandle) {
        var currentItem = null,
            validHandle = false,
            that = this;

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

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

    drag: function( event ) {

        var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;

        if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function _createTitlebar has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createTitlebar: function() {
        var uiDialogTitle;

        this.uiDialogTitlebar = $("<div>")
            .addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function pulsate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.effects.effect.pulsate = function( o, done ) {
    var elem = $( this ),
        mode = $.effects.setMode( elem, o.mode || "show" ),
        show = mode === "show",
        hide = mode === "hide",
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function effect has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    effect: function( /* effect, options, speed, callback */ ) {
        var args = _normalizeArguments.apply( this, arguments ),
            mode = args.mode,
            queue = args.queue,
            effectMethod = $.effects.effect[ args.effect ];
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function slide has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    // Create element
    var el = $( this ),
        props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function initUploadSuccess has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        initUploadSuccess: function (out, $thumb, allFiles) {
            var self = this, append, data, index, $newThumb, content, config, tags, i;
            if (!self.showPreview || typeof out !== 'object' || $.isEmptyObject(out)) {
                return;
            }
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/bootstrap/fileinput.js - About 1 hr to fix

Method noderepocheck has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def noderepocheck
        upgrade_status = ::Crowbar::UpgradeStatus.new
        upgrade_status.start_step(:repocheck_nodes)

        response = {}
Severity: Minor
Found in crowbar_framework/app/models/api/upgrade.rb - About 1 hr to fix

Method lock_nodes has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def lock_nodes(nodes, lock_owner, lock_reason)
    locks = []
    errors = {}

    return [locks, errors] if nodes.empty?
Severity: Minor
Found in crowbar_framework/app/models/service_object.rb - About 1 hr to fix

Method get_proposals_from_barclamps has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_proposals_from_barclamps(barclamps)
    modules = {}
    active = RoleObject.active
    barclamps.each do |name, details|
      modules[name] = {
Severity: Minor
Found in crowbar_framework/app/controllers/barclamp_controller.rb - About 1 hr to fix

Method node_link_list has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def node_link_list(node)
    link_list = [].tap do |result|
      if node.bmc_configured?
        path = node["crowbar_wall"]["ipmi"]["address"] rescue "none"

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

Method valid_restricted_transition? has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def valid_restricted_transition?(current, target)
        return true if current == target

        valid_restricted_transitions = {
          ## first, states related to discovery image / OS install
Severity: Minor
Found in crowbar_framework/lib/crowbar/state.rb - About 1 hr to fix

Method load! has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def load!
        # reset other cached values
        @admin_ip = nil
        @web_port = nil

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

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

        ne: function(event, dx, dy) {
            return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
        },
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 3365..3367
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 3368..3370
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 3374..3376

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

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

        se: function(event, dx, dy) {
            return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
        },
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 3368..3370
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 3371..3373
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 3374..3376

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

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

        nw: function(event, dx, dy) {
            return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
        }
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 3365..3367
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 3368..3370
crowbar_framework/vendor/assets/javascripts/jquery/ui.js on lines 3371..3373

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

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