crowbar/crowbar-core

View on GitHub

Showing 6,062 of 6,062 total issues

Function markText has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function markText(from, to, className) {
      from = clipPos(from); to = clipPos(to);
      var accum = [];
      function add(line, from, to, className) {
        var line = lines[line], mark = line.addMark(from, to, className);

Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function propFilter( props, specialEasing ) {
    var index, name, easing, value, hooks;

    // camelCase, specialEasing and expand cssHook pass
    for ( index in props ) {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/jquery.js - About 1 hr to fix

Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        setup: function() {

            if ( rformElems.test( this.nodeName ) ) {
                // IE doesn't fire change on a check/radio until blur; trigger it on click
                // after a propertychange. Eat the blur-change in special.change.handle.
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/jquery.js - About 1 hr to fix

Function _updateVirtualBoundaries has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _updateVirtualBoundaries: function(forceAspectRatio) {
        var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
            o = this.options;

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

Function refresh has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    refresh: function() {
        //See #8237 & #8828
        var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );

        if ( isDisabled !== this.options.disabled ) {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function left has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        left: function( position, data ) {
            var within = data.within,
                withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
                outerWidth = within.width,
                collisionPosLeft = position.left - data.collisionPosition.marginLeft,
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function stop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    stop: function( event ) {
        var that = $(this).data("ui-resizable"),
            o = that.options,
            pr = that._proportionallyResizeElements,
            ista = pr.length && (/textarea/i).test(pr[0].nodeName),
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function getDimensions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getDimensions( elem ) {
    var raw = elem[0];
    if ( raw.nodeType === 9 ) {
        return {
            width: elem.width(),
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function top has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        top: function( position, data ) {
            var within = data.within,
                withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
                outerHeight = data.within.height,
                collisionPosTop = position.top - data.collisionPosition.marginTop,
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function updatePosition has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      updatePosition: function (x, y) {
        if (x === undefined) {
          if (this.mousex === undefined) {
            return;
          }
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 1 hr to fix

Function _setupHeightStyle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _setupHeightStyle: function( heightStyle ) {
        var maxHeight,
            parent = this.element.parent();

        if ( heightStyle === "fill" ) {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/ui.js - About 1 hr to fix

Function clean has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    jQuery.clean = function( elems, context, fragment, scripts ) {
        // Set context per 1.8 logic
        context = context || document;
        context = !context.nodeType && context[0] || context;
        context = context.ownerDocument || context;
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/jquery/migrate.js - About 1 hr to fix

Method new has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.new(nic)
    logstr=""
    if nic.is_a?(::Nic)
      return nic
    elsif o = @@interfaces[nic]
Severity: Minor
Found in chef/cookbooks/barclamp/libraries/nic.rb - About 1 hr to fix

Function __module0__ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
  "use strict";
  var __exports__;
  var Handlebars = __dependency1__;

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

Method registered_stylesheets has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def registered_stylesheets
    @registered_stylesheets ||= begin
      files = [
        "vendor",
        "application"
Severity: Minor
Found in crowbar_framework/app/helpers/application_helper.rb - About 1 hr to fix

Method option_default has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def option_default(options, item, scope = "")
    h = options.clone

    if h.nil?
      h = [
Severity: Minor
Found in crowbar_framework/app/helpers/form_helper.rb - About 1 hr to fix

Method registered_javascripts has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def registered_javascripts
    @registered_javascripts ||= begin
      files = [
        "vendor",
        "application"
Severity: Minor
Found in crowbar_framework/app/helpers/application_helper.rb - About 1 hr to fix

Method expand_nodes_for_all has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def expand_nodes_for_all(items)
    nodes = []
    failures = []

    items.each do |item|
Severity: Minor
Found in crowbar_framework/lib/crowbar_pacemaker_proxy.rb - About 1 hr to fix

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

            if (!this.containers[innermostIndex].containerCache.over) {
                this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
                this.containers[innermostIndex].containerCache.over = 1;
            }
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 4805..4808

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

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

        if ( jQuery.isFunction( html ) ) {
            return this.each(function(i) {
                jQuery(this).wrapAll( html.call(this, i) );
            });
        }
crowbar_framework/vendor/assets/javascripts/jquery/jquery.js on lines 9415..9419

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

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