Showing 340 of 2,379 total issues
Method initialize
has a Cognitive Complexity of 281 (exceeds 5 allowed). Consider refactoring. Open
def initialize(id, user, pass, use_file = false, stonithwarning = false)
Rails.logger.debug "Cib.initialize #{id}, #{user}, #{use_file}"
if use_file
cib_path = id
- 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 initialize
has 545 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(id, user, pass, use_file = false, stonithwarning = false)
Rails.logger.debug "Cib.initialize #{id}, #{user}, #{use_file}"
if use_file
cib_path = id
File cib.rb
has 1042 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'util'
require 'cibtools'
require 'string'
require 'rexml/document' unless defined? REXML::Document
require 'rexml/xpath' unless defined? REXML::XPath
File resources.js
has 775 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
$(function() {
function executeAction(context, confirmMsg) {
File hawk_test_driver.py
has 641 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python3
# Copyright (C) 2019 SUSE LLC
"""Define Selenium driver related functions and classes to test the HAWK GUI"""
import ipaddress
File statustable.js
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2015-2016 Kristoffer Gronlund <kgronlund@suse.com>
// Copyright (c) 2016 Ayoub Belarbi <abelarbi@suse.com>
// See COPYING for license.
// This module is a table-based visualization for cluster status (Using JsRender). To use this module:
File reports.js
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
$(function() {
var time_format_string = 'YYYY-MM-DD HH:mm:ss ZZ';
Function init
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
OpList.prototype.init = function() {
var self = this;
var content = {
labels: self.options.labels,
Method fix_resource_states
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def fix_resource_states(rsclist)
prio = {
unknown: 0,
stopped: 1,
started: 2,
- 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 build_tabs
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
var build_tabs = function() {
$('#reports #report-running').addClass('hidden');
$('#reports #report-tabs').removeClass('hidden');
var controls = $("#reports #report-controls");
Function init
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
RecipientList.prototype.init = function() {
var self = this;
var content = {
labels: self.options.labels,
Function afterDisplay
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
function afterDisplay(self) {
var data = $('#reports #transition-data');
var report = data.data('report');
var transitions = $.parseJSON(data.text());
Function rulesList
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
function rulesList(el, options) {
this.$el = $(el);
this.values = this.$el.data('locations');
this.targets = this.$el.data('locations-target');
Method rsc_state_from_lrm_rsc_op
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def rsc_state_from_lrm_rsc_op(xml, node_uname, rsc_id)
xml.elements.each("cib/status/node_state[@uname='#{node_uname}']/lrm/lrm_resources/lrm_resource[@id='#{rsc_id}']") do |lrm_resource|
# logic derived somewhat from pacemaker/lib/pengine/unpack.c:unpack_rsc_op()
state = :unknown
ops = []
- 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 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
ConstraintList.prototype.init = function() {
var self = this;
$.each(self.values, function(outer, parent) {
$.each(parent.resources, function(inner, group) {
Method instantiate
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def instantiate(xml)
record = allocate
record.clazz = xml.attributes["class"] || ""
record.provider = xml.attributes["provider"] || ""
record.type = xml.attributes["type"] || ""
- 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 primitives.js
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
$(function() {
// Some craziness to avoid duplicating this stuff for both
Function render_attrlists
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
var render_attrlists = function($template, $clazz, $provider, $type) {
var new_resource = $('form#new_primitive, form#new_template').length > 0;
var agent = null;
if ($template.length > 0 && $template.val() != "") {
agent = "@" + $template.val();
Function OpList
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
function OpList(el, options) {
this.$el = $(el);
// defined actions: [{name, interval, ...}]
this.values = this.$el.data('oplist');
Method shell_syntax
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def shell_syntax
[].tap do |cmd|
cmd.push "colocation #{@id} #{@score}:"
- 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"