Showing 2,376 of 2,376 total issues
Assignment Branch Condition size for popen3 is too high. [51.12/15] Open
def popen3(user, *cmd)
raise SecurityError, "Util::popen3 called with < 2 args" if cmd.length < 2
pw = IO::pipe # pipe[0] for read, pipe[1] for write
pr = IO::pipe
pe = IO::pipe
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
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
Method has too many lines. [62/30] Open
def instantiate(xml)
record = allocate
record.resources = [].tap do |resources|
if xml.attributes["rsc"]
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for create is too high. [47.72/15] Open
def create
@session = Session.new params[:session].permit!
respond_to do |format|
if @session.valid?
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create is too high. [47.76/15] Open
def create
normalize_params! params[:primitive].permit!
@title = _("Create Primitive")
@primitive = Primitive.new params[:primitive].permit!
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for show is too high. [47.6/15] Open
def show
respond_to do |format|
format.html do
cmd = "show"
cmd = "show xml" if params[:xml] == "true"
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [62/30] Open
def select(field, choices = nil, args = {}, html = {})
unless options.fetch(:bootstrap, true)
return super
end
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
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();
Method has too many lines. [60/30] Open
define_method method_name.to_sym do |field, *args|
unless options.fetch(:bootstrap, true)
return super
end
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
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');
Assignment Branch Condition size for get_parameters_from is too high. [44.55/15] Open
def get_parameters_from(crm_config, cmd)
#todo: this doesn't work with safe_x. research why.
REXML::Document.new(%x[#{cmd} 2>/dev/null]).tap do |xml|
return unless xml.root
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for shell_syntax is too high. [44.18/15] Open
def shell_syntax
[].tap do |cmd|
cmd.push "alert #{id} #{path.shellescape}"
unless params.empty?
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for check_drbd_status is too high. [44.15/15] 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
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [59/30] Open
def run
if current_cib.id == "live"
head :bad_request
return
end
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [58/30] Open
def edit
if request.post?
fencing = params[:fencing]
fencing = fencing["fencing"] if fencing.is_a? Hash
fencing = [] if fencing.nil?
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.