Showing 337 of 2,376 total issues
Function StatusCheck
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function StatusCheck(el, options) {
this.$el = $(el);
this.defaults = {
content: this.$el.data('content'),
Function statusCircle
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.statusCircle = function(status, tooltip) {
if (tooltip === undefined) {
if (status == "ok") {
tooltip = __("OK");
} else if (status == "maintenance") {
Method edit
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def edit
if request.post?
fencing = params[:fencing]
fencing = fencing["fencing"] if fencing.is_a? Hash
fencing = [] if fencing.nil?
Method persist!
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def persist!
writer = {
crm_config: {},
rsc_defaults: {},
op_defaults: {},
File form_builder.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Hawk
class FormBuilder < ActionView::Helpers::FormBuilder
def fields_for(record_name, record_object = nil, args = {}, &block)
unless options.fetch(:bootstrap, true)
return super
Method shell_syntax
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def shell_syntax
[].tap do |cmd|
cmd.push "rsc_ticket #{id} #{ticket}:"
Util.map_value(resources).each do |set|
- 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 test_check_cluster_configuration
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def test_check_cluster_configuration(self, ssh):
print(f"TEST: test_check_cluster_configuration: Check crm options")
self.click_if_major_version("15", 'configuration')
self.check_and_click_by_xpath("Click on Cluster Configuration", [Xpath.HREF_CRM_CONFIG_EDIT])
- 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 merge_nvpairs
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def merge_nvpairs(list, attrs)
return if xml.nil?
if attrs.empty?
# No attributes to set, get rid of the list (if it exists)
xml.elements[list].remove if xml.elements[list]
- 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 mapping
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mapping
# TODO(must): Are other meta attributes for clone valid?
@mapping ||= begin
{
"is-managed" => {
File report.rb
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fileutils'
class Report
attr_accessor :id
attr_accessor :name
Method instantiate
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def instantiate(xml, state)
record = allocate
record.id = state[:id]
record.xml = xml
record.name = state[:name]
Function basicCreateBody
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
basicCreateBody: function() {
var s_hostname = __('Hostname');
var s_username = __('Username');
var s_password = __('Password');
var s_connect = __('Connect');
Function processCheck
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
MonitorCheck.prototype.processCheck = function() {
var self = this;
$('.circle').statusCircleFromCIB();
File basics.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
$(function() {
window.userIsNavigatingAway = false;
File recipientlist.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2016 Kristoffer Gronlund <kgronlund@suse.com>
// See COPYING for license.
;(function($) {
'use strict';
File application_helper.rb
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ApplicationHelper
def branding_config
@branding_config ||= begin
config = YAML.load_file(
Rails.root.join(
Method transitions
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def transitions(hb_report)
# TODO(fix this)
# Have to blow this away if it exists (i.e. is a cached report), else
# prior cibadmin calls on individual PE inputs will have wrecked their mtimes.
# FileUtils.remove_entry_secure(hb_report.path) if File.exist?(hb_report.path)
- 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 merge_nvpairs
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def merge_nvpairs(list, attrs)
if attrs.empty?
# No attributes to set, get rid of the list (if it exists)
xml.elements[list].remove if xml.elements[list]
else
- 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 show
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
respond_to do |format|
format.html do
cmd = "show"
cmd = "show xml" if params[:xml] == "true"
Method result
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def result
case params[:file]
when "info"
send_data File.new("#{Rails.root}/tmp/sim.info").read,
type: "text/plain", disposition: :inline