crowbar/crowbar-core

View on GitHub

Showing 6,062 of 6,062 total issues

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

    _makeDraggable: function() {
        var that = this,
            options = this.options;

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

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

    _createButtons: function() {
        var that = this,
            buttons = this.options.buttons;

        // if we already have a button pane, remove it
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

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

    refreshPositions: function(fast) {

        //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
        if(this.offsetParent && this.helper) {
            this.offset.parent = this._getParentOffset();
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

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

    _mouseStart: function(event) {

        var curleft, curtop, cursor,
            o = this.options,
            iniPos = this.element.position(),
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

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

    _determineButtonType: function() {
        var ancestor, labelSelector, checked;

        if ( this.element.is("[type=checkbox]") ) {
            this.type = "checkbox";
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

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

        $.growlUI = function(title, message, timeout, onClose) {
            var $m = $('<div class="growlUI"></div>');
            if (title) $m.append('<h1>'+title+'</h1>');
            if (message) $m.append('<h2>'+message+'</h2>');
            if (timeout === undefined) timeout = 3000;
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/blockui.js - About 1 hr to fix

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

    open: function( event ) {
        var that = this,
            target = $( event ? event.target : this.element )
                // we need closest here due to mouseover bubbling,
                // but always pointing at the same event target
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

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

spaces.hsla.to = function ( rgba ) {
    if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
        return [ null, null, null, rgba[ 3 ] ];
    }
    var r = rgba[ 0 ] / 255,
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

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

    close: function( event ) {
        var that = this,
            target = $( event ? event.currentTarget : this.element ),
            tooltip = this._find( target );

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

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

  Tab.prototype.show = function () {
    var $this    = this.element
    var $ul      = $this.closest('ul:not(.dropdown-menu)')
    var selector = $this.data('target')

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

Method upgradable_elements_of_proposals has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def upgradable_elements_of_proposals(proposals)
        to_upgrade = []

        # First find out the nodes with compute role, for later checks
        compute_nodes = {}
Severity: Minor
Found in crowbar_framework/app/models/api/upgrade.rb - About 1 hr to fix

Method delete_upgrade_scripts has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def delete_upgrade_scripts(node)
        return if node.admin?

        scripts_to_delete = [
          "prepare-repositories",
Severity: Minor
Found in crowbar_framework/app/models/api/upgrade.rb - About 1 hr to fix

Method upgrade_first_cluster_node has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def upgrade_first_cluster_node(node, other_node)
        return true if node.upgraded?
        node_api = Api::Node.new node.name
        other_node_api = Api::Node.new other_node.name
        node_api.save_node_state("controller", "upgrading")
Severity: Minor
Found in crowbar_framework/app/models/api/upgrade.rb - About 1 hr to fix

Method skip_unchanged_node? has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def skip_unchanged_node?(node_name, old_role, new_role)
    # if old_role is nil, then we are applying the barclamp for the first time
    return false if old_role.nil?

    # if the servers have changed, we need to apply
Severity: Minor
Found in crowbar_framework/app/models/provisioner_service.rb - About 1 hr to fix

Method process_proposal! has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def process_proposal!(proposal)
      {}.tap do |result|
        result[:barclamp] = proposal.barclamp

        unless proposal.name == "default"
Severity: Minor
Found in crowbar_framework/app/models/batch/export.rb - About 1 hr to fix

Method enable_repository has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def enable_repository(platform, arch, repo)
    repo_object = Crowbar::Repository.where(platform: platform, arch: arch, repo: repo).first
    if repo_object.nil?
      message = "#{repo} repository for #{platform} / #{arch} does not exist."
      Rails.logger.debug(message)
Severity: Minor
Found in crowbar_framework/app/models/provisioner_service.rb - About 1 hr to fix

Method prepare_nodes_for_crowbar_upgrade has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def prepare_nodes_for_crowbar_upgrade
    proposal = Proposal.find_by(barclamp: "crowbar", name: "default")

    # To all nodes, add a new role which prepares them for the upgrade
    nodes_to_upgrade = []
Severity: Minor
Found in crowbar_framework/app/models/crowbar_service.rb - About 1 hr to fix

Method hit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def hit
    name = params[:name] || params[:id]
    machine = Node.find_by_name(name)

    respond_to do |format|
Severity: Minor
Found in crowbar_framework/app/controllers/nodes_controller.rb - About 1 hr to fix

Method save_archive has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def save_archive
    if file.nil?
      errors.add_on_blank :file
      return false
    end
Severity: Minor
Found in crowbar_framework/app/models/api/backup.rb - About 1 hr to fix

Method restarts_post has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def restarts_post
    params.require(:node)

    node_name = params[:node]
    cookbook = params[:cookbook]
Severity
Category
Status
Source
Language