Showing 329 of 2,363 total issues
Method merge_operations
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def merge_operations(attrs)
if attrs.empty?
# No operations to set, get rid of the list (if it exists)
xml.elements['operations'].remove if xml.elements['operations']
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
File nodes.js
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
$(function() {
var rowStyleFn = function(row, index) {
File reports_controller.rb
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ReportsController < ApplicationController
before_action :login_required
before_action :set_title
before_action :set_record, only: [:show, :destroy, :download, :cache]
before_action :set_transition, only: [:display, :detail, :graph, :logs, :diff, :pefile, :status, :cib]
Method persist!
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def persist!
writer = {
crm_config: {},
rsc_defaults: {},
op_defaults: {},
- 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 fix_clone_instances
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def fix_clone_instances(rsclist)
rsclist.each do |res|
if res[:clone_max]
# There'll be a stale default instance lying around if the resource was
# started before it was cloned (bnc#711180), so ditch it. This is all
- 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 oplist.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
// ops and values is:
//
File util.rb
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Util
# From http://mentalized.net/journal/2011/04/14/ruby_how_to_check_if_a_string_is_numeric/
def numeric?(n)
Float(n) != nil rescue false
Method check_drbd_status
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def check_drbd_status
# if there are any running drbd resources on this node and a drbdadm command,
# check drbdadm status
# do we need sudo to do it?
me = Socket.gethostname
- 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
Class ReportsController
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class ReportsController < ApplicationController
before_action :login_required
before_action :set_title
before_action :set_record, only: [:show, :destroy, :download, :cache]
before_action :set_transition, only: [:display, :detail, :graph, :logs, :diff, :pefile, :status, :cib]
Function AttrList
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AttrList(el, options) {
this.$el = $(el);
this.values = this.$el.data('attrlist');
Function WizAttrList
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function WizAttrList(el, options) {
this.$el = $(el);
this.values = this.$el.data('wizattrlist');
this.targets = this.$el.data('wizattrlist-target');
Function ConstraintList
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ConstraintList(el, options) {
this.$el = $(el);
this.values = this.$el.data('constraints');
Method instantiate
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def instantiate(xml, state)
record = allocate
record.id = state[:id]
record.xml = xml
record.name = state[:name]
- 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 verify
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def verify(params)
@params = params
@actions = []
@errors = []
CrmScript.run ["verify", @name, params], nil do |action, err|
- 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 executeNodeSelectionAction
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
function executeNodeSelectionAction(context, message, defaultmsg) {
var html = [
'<div class="modal fade" id="nodeSelectionDialog" role="dialog" tabindex="-1" aria-hidden="true">',
'<div class="modal-dialog">',
'<div class="modal-content">',
Function RecipientList
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
function RecipientList(el, options) {
this.$el = $(el);
// defined actions: [{name, interval, ...}]
this.values = this.$el.data('recipients');
Class Cib
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Cib
extend ActiveModel::Naming
include ActiveModel::Conversion
include FastGettext::Translation
include Rails.application.routes.url_helpers # needed for routes
Function success
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function(data) {
if (data == null || !("resource_agent" in data)) {
data = { resource_agent: {
shortdesc: agent,
longdesc: "",
Method shell_syntax
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def shell_syntax
[].tap do |cmd|
cmd.push "location #{id}"
if resources.length == 1
- 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 formatter
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatter: function(value, row, index) {
var operations = [];
var dropdowns = [];
var op_destination = "button";