crowbar/crowbar-core

View on GitHub

Showing 6,062 of 6,062 total issues

Function CodeMirror has a Cognitive Complexity of 1817 (exceeds 5 allowed). Consider refactoring.
Open

var CodeMirror = (function() {
  // This is the function that produces an editor instance. It's
  // closure is used to store the editor state.
  function CodeMirror(place, givenOptions) {
    // Determine effective options based on given values and defaults.

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File ui.js has 11714 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! jQuery UI - v1.10.3 - 2013-10-20
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */

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

File jquery.js has 6841 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.11.3
 * http://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/jquery/jquery.js - About 2 wks to fix

Function Handlebars has a Cognitive Complexity of 892 (exceeds 5 allowed). Consider refactoring.
Open

var Handlebars = (function() {
// handlebars/safe-string.js
var __module4__ = (function() {
  "use strict";
  var __exports__;
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/misc/handlebars.js - About 2 wks to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Handlebars has 1937 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Handlebars = (function() {
// handlebars/safe-string.js
var __module4__ = (function() {
  "use strict";
  var __exports__;
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/misc/handlebars.js - About 1 wk to fix

Function CodeMirror has 1835 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var CodeMirror = (function() {
  // This is the function that produces an editor instance. It's
  // closure is used to store the editor state.
  function CodeMirror(place, givenOptions) {
    // Determine effective options based on given values and defaults.

File fileinput.js has 2632 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2015
 * @version 4.2.8
 *
 * File input styled for Bootstrap 3.0 that utilizes HTML5 File Input's advanced 
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/bootstrap/fileinput.js - About 1 wk to fix

File sparkline.js has 2443 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 *
 * jquery.sparkline.js
 *
 * v2.1.2
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 6 days to fix

Function Sizzle has 1355 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function( window ) {

var i,
    support,
    Expr,
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/jquery/jquery.js - About 6 days to fix

Function CodeMirror has 1287 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function CodeMirror(place, givenOptions) {
    // Determine effective options based on given values and defaults.
    var options = {}, defaults = CodeMirror.defaults;
    for (var opt in defaults)
      if (defaults.hasOwnProperty(opt))
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/codemirror.js - About 6 days to fix

File handlebars.js has 1939 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!

 handlebars v1.1.2

Copyright (C) 2011 by Yehuda Katz
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/misc/handlebars.js - About 5 days to fix

File upgrade.rb has 1844 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "open3"

module Api
  class Upgrade < Tableless
    class << self
Severity: Major
Found in crowbar_framework/app/models/api/upgrade.rb - About 5 days to fix

File codemirror.js has 1837 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// All functions that need access to the editor's state live inside
// the CodeMirror function. Below that, at the bottom of the file,
// some utilities are defined.

// CodeMirror is the only global var we claim
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/codemirror.js - About 5 days to fix

Method apply_role has a Cognitive Complexity of 178 (exceeds 5 allowed). Consider refactoring.
Open

  def apply_role(role, inst, in_queue, bootstrap = false)
    Rails.logger.debug "apply_role(#{role.name}, #{inst}, #{in_queue}, #{bootstrap})"
    Rails.logger.progress("Starting to apply role #{role.name}")

    # Variables used in the global ensure
Severity: Minor
Found in crowbar_framework/app/models/service_object.rb - About 3 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File service_object.rb has 1352 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "pp"
require "chef"
require "json"
require "hash_only_merge"
require "securerandom"
Severity: Major
Found in crowbar_framework/app/models/service_object.rb - About 3 days to fix

File node.rb has 1319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "chef/mixin/deep_merge"
require "timeout"
require "open3"

class Node < ChefObject
Severity: Major
Found in crowbar_framework/app/models/node.rb - About 3 days to fix

Class Node has 160 methods (exceeds 20 allowed). Consider refactoring.
Open

class Node < ChefObject
  include Crowbar::ConduitResolver

  self.chef_type = "node"

Severity: Major
Found in crowbar_framework/app/models/node.rb - About 3 days to fix

Function __module11__ has 568 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var __module11__ = (function(__dependency1__) {
  "use strict";
  var __exports__;
  var COMPILER_REVISION = __dependency1__.COMPILER_REVISION;
  var REVISION_CHANGES = __dependency1__.REVISION_CHANGES;
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/misc/handlebars.js - About 2 days to fix

File barclamp_controller.rb has 1093 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "chef"
require "json"

class BarclampController < ApplicationController
  wrap_parameters false
Severity: Major
Found in crowbar_framework/app/controllers/barclamp_controller.rb - About 2 days to fix

File upgrade_spec.rb has 1092 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "spec_helper"

describe Api::Upgrade do
  let!(:prechecks) do
    JSON.parse(
Severity: Major
Found in crowbar_framework/spec/models/api/upgrade_spec.rb - About 2 days to fix
Severity
Category
Status
Source
Language