Showing 1,006 of 6,062 total issues
Function __module3__
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var __module3__ = (function(__dependency1__) {
"use strict";
var __exports__ = {};
var SafeString = __dependency1__;
- Create a ticketCreate a ticket
File modal.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* ========================================================================
* Bootstrap: modal.js v3.4.1
* https://getbootstrap.com/docs/3.4/javascript/#modals
* ========================================================================
* Copyright 2011-2019 Twitter, Inc.
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if new_group == "os_install" && !admin_data_net.nil?
# This eventually needs to be configurable on a per-node basis
# We select the os based on the target platform specified.
os = mnode[:target_platform]
if os.nil? || os.empty?
- Create a ticketCreate a ticket
Class Backup
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Api::Backup < ActiveRecord::Base
belongs_to :crowbar
attr_accessor :file
- Create a ticketCreate a ticket
Function _generatePosition
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_generatePosition: function(event) {
var containment, co, top, left,
o = this.options,
scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
- Create a ticketCreate a ticket
Method restore_files
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def restore_files
[
[
"root/.gnupg",
"/root/.gnupg"
- Create a ticketCreate a ticket
Function equalOrMatchVersion
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NodeList.prototype.equalOrMatchVersion = function(value, maybe_regexp) {
var to_version = function(version) {
var match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
if (match) {
return [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])];
- Create a ticketCreate a ticket
Function keydown
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function( event ) {
/*jshint maxcomplexity:25*/
var allowed, curVal, newVal, step,
index = $( event.target ).data( "ui-slider-handle-index" );
- Create a ticketCreate a ticket
File provisioner_service.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class ProvisionerService < ServiceObject
include Crowbar::SSHKeyParser
def initialize(thelogger = nil)
super
- Create a ticketCreate a ticket
Method node_ip_list
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def node_ip_list(ips)
entries = [].tap do |result|
ips.each do |network, addresses|
unless network == "~notconnected" and addresses.nil?
network_list = if ["[not managed]", "[dhcp]"].include? network
- 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
Method save_node
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def save_node
if params[:group] and params[:group] != "" and !(params[:group] =~ /^[a-zA-Z][a-zA-Z0-9._:-]+$/)
flash[:alert] = t("nodes.list.group_error", failed: @node.name)
return false
end
- 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
Function ajaxConvert
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
- Create a ticketCreate a ticket
Function _generateMonthYearHeader
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
secondary, monthNames, monthNamesShort) {
var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
changeMonth = this._get(inst, "changeMonth"),
- Create a ticketCreate a ticket
Function renderRegion
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderRegion: function (valuenum, highlight) {
var vals = this.values[valuenum],
options = this.options,
xaxisOffset = this.xaxisOffset,
result = [],
- Create a ticketCreate a ticket
Function createWrapper
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createWrapper: function( element ) {
// if the element is already wrapped, return it
if ( element.parent().is( ".ui-effects-wrapper" )) {
return element.parent();
- Create a ticketCreate a ticket
Function _mouseStart
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseStart: function(event) {
var that = this,
options = this.options;
this.opos = [event.pageX, event.pageY];
- Create a ticketCreate a ticket
Function show
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
- Create a ticketCreate a ticket
Method evacuate_network_node
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def evacuate_network_node(controller, network_node, delete_namespaces = false)
save_node_action("evacuating dhcp networks")
hostname = network_node["hostname"]
migrated_file = "/var/lib/crowbar/upgrade/crowbar-network-evacuated"
if network_node.file_exist? migrated_file
- Create a ticketCreate a ticket
Method apply_role_pre_chef_call
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def apply_role_pre_chef_call(old_role, role, all_nodes)
Rails.logger.debug("DNS apply_role_pre_chef_call: entering #{all_nodes.inspect}")
return if all_nodes.empty?
tnodes = role.override_attributes["dns"]["elements"]["dns-server"]
- Create a ticketCreate a ticket