Showing 337 of 2,376 total issues
Method get_resource
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_resource(elem, is_managed = true, maintenance = false, clone_max = nil, is_ms = false)
res = {
id: elem.attributes['id'],
object_type: elem.name,
attributes: {},
- 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 instantiate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def instantiate(xml)
record = allocate
record.resources = [].tap do |resources|
if xml.attributes["rsc"]
- 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"
Further reading
Method update_resource_state
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def update_resource_state(resource, node, instance, state, substate, failed_ops)
# m/s slave state hack (*sigh*)
state = :slave if resource[:is_ms] && state == :started
instances = resource[:instances]
- 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 ApplicationController
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
include FastGettext::Translation
protect_from_forgery with: :exception
helper :all
Method mapping
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mapping
# TODO(must): Are other meta attributes for clone valid?
@mapping ||= begin
{
"is-managed" => {
Method create
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def create
normalize_params! params[:primitive].permit!
@title = _("Create Primitive")
@primitive = Primitive.new params[:primitive].permit!
- 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 result
has a Cognitive Complexity of 20 (exceeds 5 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
- 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 installed_docs
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def installed_docs
[
{
title: "SLE HA Administration Guide",
html: docs_path.join(
Class Report
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Report
attr_accessor :id
attr_accessor :name
attr_accessor :archive
attr_accessor :from_time
Method ops
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def ops
invars = params[:id].split(",", 2)
if invars.length == 1
rsc = invars[0]
node = "*"
- 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 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatter: function(value, row, index) {
var operations = [];
var dropdowns = [];
var add_operation = function(dest, path, path_class, icon_class, text) {
File tickets.js
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.
$(function() {
$('#tickets #middle table.tickets')
Function init
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
rulesList.prototype.init = function() {
var self = this;
var content = {
prefix: self.prefixes,
Method instantiate
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def instantiate(xml)
record = allocate
record.resources = [].tap do |resources|
if xml.attributes["rsc"]
Method select
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def select(field, choices = nil, args = {}, html = {})
unless options.fetch(:bootstrap, true)
return super
end
Method shell_syntax
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def shell_syntax
[].tap do |cmd|
cmd.push "order #{id} #{score}:"
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
Method run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def run(params, rootpw=nil)
# TODO: live-update frontend
@params = params
@actions = []
@errors = []
- 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 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
if current_cib.id == "live"
head :bad_request
return
end
Class ResourcesController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ResourcesController < ApplicationController
before_action :login_required
before_action :set_title
before_action :set_cib