Showing 329 of 2,363 total issues
Function show_operation_modal
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
var show_operation_modal = function(edit_mode, id, name) {
var submit_text = (edit_mode == MODAL_MODE_CREATE) ? content.labels.add : content.labels.apply;
if (!name)
name = id;
var attrmapping = self.attr_mapping;
Function formatter
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatter: function(value, row, index) {
var operations = [];
switch(row.object_type) {
case "location":
Function init
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
WizAttrList.prototype.init = function() {
var self = this;
$.each(Object.keys(self.values), function(index, value) {
var found = null;
Function expandResourcesHandler
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
var expandResourcesHandler = function (index, row, detail) {
var columns = statesResourcesColumns.slice(0);
var datasource = [];
if (row.children || row.child || row.refs) {
var datasource = [];
Function clusterRefresh
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
clusterRefresh: function() {
var that = this;
that.ajaxQuery({
url: that.baseUrl() + "/cib/live?format=json",
type: "GET",
statusTable
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
var statusTable = {
tableData: [], // An Array that contains JSON data fetched from the cib, see cacheData()
// List of options(passed to init function) and their types:
// clusterId: string,
// clusterType: string,
Method options
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def options
Rails.cache.fetch(:crm_ra_classes, expires_in: 2.hours) do
{}.tap do |result|
clazzes = Util.safe_x('/usr/sbin/crm', 'ra', 'classes').split(/\n/)
clazzes.delete("heartbeat") unless File.directory?("/etc/ha.d/resource.d")
- Read upRead up
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 location.js
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
;(function($) {
'use strict';
HawkTestDriver
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class HawkTestDriver:
def __init__(self, addr='localhost', port='7630', browser='firefox', headless=False, version='15-SP5'):
self.addr = addr
self.port = port
self.driver = None
Class Resource
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Resource < Record
class CommandError < StandardError
end
attribute :object_type, Symbol
Method instantiate
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def instantiate(xml)
record = allocate
record.clazz = xml.attributes["class"] || ""
record.provider = xml.attributes["provider"] || ""
record.type = xml.attributes["type"] || ""
Method edit
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def edit
if request.post?
fencing = params[:fencing]
fencing = fencing["fencing"] if fencing.is_a? Hash
fencing = [] if fencing.nil?
- Read upRead up
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 build_scriptparams
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def build_scriptparams(params)
sp = build_stepmap({}, @wizard)
id = @wizard.id
params.select { |k, _v| k.start_with?("#{id}.") }.each do |k, v|
next if v.empty?
- Read upRead up
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 run
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def run
if current_cib.id == "live"
head :bad_request
return
end
- Read upRead up
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 init
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
AttrList.prototype.init = function() {
var self = this;
if (!self.freeform) {
$.each(Object.keys(self.values), function(index, value) {
Function show_modal
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
var show_modal = function(edit_mode, id, recipient) {
var modal = $('#modal');
var modalinput = {
id: id,
value: recipient.value,
File template.rb
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'invoker'
class Template < Resource
attribute :clazz, String, default: "ocf"
attribute :provider, String
Function clusterConnectionError
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
clusterConnectionError: function(xhr, status, error, cb) {
var that = this;
if (window.userIsNavigatingAway)
return;
var msg = "";
Function clusterConnectionError
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
clusterConnectionError: function(xhr, status, error, cb) {
var that = this;
if (window.userIsNavigatingAway)
return;
var msg = "";
- Read upRead up
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 graph
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def graph
respond_to do |format|
format.html do
render layout: false
end
- Read upRead up
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"