Showing 17 of 23 total issues
Method prehook
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def prehook(*args)
cmd, opts, *etc = args
case cmd
when :search
# This parameter is Red Hat Extension
- 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 posthook
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def posthook(*args)
cmd, opts, *etc = args
case cmd
when :search
if opts.include?('bugs')
- 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 prehook
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prehook(*args)
cmd, opts, *etc = args
case cmd
when :search
# This parameter is Red Hat Extension
Method get_bugs
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def get_bugs(bugs, fields = FIELDS_SUMMARY)
params = {}
params['ids'] = case bugs
when Array
- 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 _get
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _get(cmd, ids, *_args)
# This is still in experimental and apparently the behavior was changed since 4.2.
# We don't keep the backward-compatibility and just require the proper version here.
requires_version(cmd, 4.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
Method _create
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _create(cmd, *args)
raise ArgumentError, 'Invalid parameters' unless args[0].is_a?(Hash)
required_fields = %i[product component summary version]
defaulted_fields = %i[description op_sys platform priority severity]
- 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 posthook
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def posthook(*args)
cmd, opts, *etc = args
case cmd
when :search
if opts.include?('bugs')
Method _get
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _get(cmd, _args)
requires_version(cmd, 4.4)
params = {}
# TODO
- 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 get_userinfo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_userinfo(user)
p = {}
ids = []
names = []
- 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 get_bugs
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_bugs(bugs, fields = FIELDS_SUMMARY)
params = {}
params['ids'] = case bugs
when Array
Method call
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def call(cmd, params = {}, user = nil, password = nil)
params = {} if params.nil?
params['Bugzilla_login'] = user unless user.nil? || password.nil?
params['Bugzilla_password'] = password unless user.nil? || password.nil?
params['Bugzilla_token'] = @token unless @token.nil?
- 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 get_comments
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_comments(bugs)
params = {}
# TODO
# this construction should be refactored to a method
- 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 session
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def session(user, password)
key, fname = authentication_method
# TODO
# make those variables available
- 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 get_proxy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_proxy(info)
uri = info[:Proxy] || ENV['http_proxy']
proxy_uri = uri.nil? ? nil : URI.parse(uri)
proxy_host = proxy_uri.nil? ? nil : proxy_uri.host
proxy_port = proxy_uri.nil? ? nil : proxy_uri.port
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def run(hook, host, *args)
@@plugins.each do |k|
i = k.new
next unless i.hostname == host || host.nil?
- 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 _fields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _fields(cmd, *args)
requires_version(cmd, 3.6)
params = {}
a = args[0]
case a
- 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 read_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def read_config(opts)
fname = opts[:config].nil? ? @defaultyamlfile : opts[:config]
begin
# TODO: fix config file
# Psych doesnt allow Symbol as class
- 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"