Showing 1,006 of 6,062 total issues
Function _open
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_open: function( event, target, content ) {
var tooltip, events, delayedShow,
positionOption = $.extend( {}, this.options.position );
if ( !content ) {
- Create a ticketCreate a ticket
Method transition
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def transition(inst, name, state)
Rails.logger.debug("Network transition: entering: #{name} for #{state}")
# we need one state before "installed" (and after allocation) because we
# need the node to have the admin network fully defined for
- Create a ticketCreate a ticket
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
- Create a ticketCreate a ticket
Function sparkline
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.sparkline = function (userValues, userOptions) {
return this.each(function () {
var options = new $.fn.sparkline.options(this, userOptions),
$this = $(this),
render, i;
- Create a ticketCreate a ticket
File role_object.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "ostruct"
class RoleObject < ChefObject
self.chef_type = "role"
- Create a ticketCreate a ticket
Method node_architectures
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def node_architectures
{}.tap do |ret|
::Node.all.each do |node|
arch = node.architecture
ret["os"] ||= []
- Read upRead up
- Create a ticketCreate a ticket
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 application.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
//= require_self
jQuery(document).ready(function($) {
$('textarea.editor').each(function() {
var cm = CodeMirror.fromTextArea(this, {
- Create a ticketCreate a ticket
File ip.rb
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class IP
include Comparable
protected
# Translate a CIDR subnet specification into a bitfield
- Create a ticketCreate a ticket
Function bounce
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.effect.bounce = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
// defaults:
- Create a ticketCreate a ticket
Function template
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function template(templateSpec, env) {
if (!env) {
throw new Error("No environment passed to template");
}
- Create a ticketCreate a ticket
Method make_zone
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def make_zone(zone)
# copy over SOA records that we have not overridden
populate_soa zone
zonefile_entries=Array.new
Chef::Log.debug "Processing zone: #{zone.inspect}"
- Create a ticketCreate a ticket
Method switch
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def switch
@port_start = 1
@sum = 0
@vports = {}
@groups = {}
- Create a ticketCreate a ticket
Function updateLinesNoUndo
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
var recomputeMaxLength = false, maxLineLength = maxLine.length;
for (var i = from.line; i <= to.line; ++i) {
if (lines[i].text.length == maxLineLength) {recomputeMaxLength = true; break;}
}
- Create a ticketCreate a ticket
Function SearchCursor
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SearchCursor(query, pos, caseFold) {
this.atOccurrence = false;
if (caseFold == null) caseFold = typeof query == "string" && query == query.toLowerCase();
if (pos && typeof pos == "object") pos = clipPos(pos);
- Create a ticketCreate a ticket
Function getHTML
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getHTML: function(sfrom, sto, includePre, endAt) {
var html = [];
if (includePre)
html.push(this.className ? '<pre class="' + this.className + '">': "<pre>");
function span(text, style) {
- Create a ticketCreate a ticket
Method node_role_list
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def node_role_list(node)
all_roles = RoleObject.all
all_proposals = Proposal.all
list_items = ActiveSupport::OrderedHash.new.tap do |listing|
- Create a ticketCreate a ticket
File service_object_spec.rb
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "spec_helper"
describe ServiceObject do
let(:service_object) { so = ServiceObject.new(Logger.new("/dev/null")); so.bc_name = "crowbar"; so }
let(:proposal) { Proposal.where(barclamp: "crowbar", name:"default").first_or_create(barclamp: "crowbar", name: "default") }
- Create a ticketCreate a ticket
Class UcsController
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class UcsController < ApplicationController
CREDENTIALS_XML_PATH = "/etc/crowbar/cisco-ucs/credentials.xml"
COMPUTE_SERVICE_PROFILE = "suse-cloud-compute"
STORAGE_SERVICE_PROFILE = "suse-cloud-storage"
- Create a ticketCreate a ticket
Class Upload
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Upload
def initialize
@checked_dependencies = Array.new
end
- Create a ticketCreate a ticket
Function handleRemote
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleRemote: function(element) {
var method, url, data, elCrossDomain, crossDomain, withCredentials, dataType, options;
if (rails.fire(element, 'ajax:before')) {
elCrossDomain = element.data('cross-domain');
- Create a ticketCreate a ticket