Showing 11 of 13 total issues
Method populate_banners
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
def populate_banners
ret = []
ret << <<-'END'
_________ .__ .__ __
Function NavbarBuilder
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function NavbarBuilder() {
function renderDropdownMenu(item){
var i, ref;
ref = $(item).find('ul li a');
Function NavbarBuilder
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function NavbarBuilder() {
function renderDropdownMenu(item){
var i, ref;
ref = $(item).find('ul li 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 find_users
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def find_users(args)
return [] if args.empty?
limit = args.delete(:limit)
fields = args.keys
- 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 custom_tls_options
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def custom_tls_options
return {} unless options['tls_options']
# Dup so we don't overwrite the original value
custom_options = options['tls_options'].dup.delete_if { |_, value| value.nil? || value.blank? }
- 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 tls_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def tls_options
return @tls_options if defined?(@tls_options)
method = translate_method
return unless 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 role_select
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def role_select(opts = {})
collection = Chaltron.roles.map { |role| [role, I18n.translate("roles.#{role}")] }
checked = @object.nil?? false : @object.roles
html = inputs_collection(:roles, collection, :first, :last, checked: checked) do |name, value, options|
options[:multiple] = true
- 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 ldap_search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ldap_search(*args)
results = ldap.search(*args)
if results.nil?
response = ldap.get_operation_result
unless response.code.zero?
- 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 display_username
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def display_username(user, link = true)
capture do
if link
concat link_to(user.username, user)
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 find_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_options
department = params[:department]
name = params[:lastname]
limit = params[:limit].to_i
- 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 find_or_create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_or_create(auth, create)
@auth = auth
if uid.blank? || email.blank? || username.blank?
raise_error('Account must provide a dn, uid and email address')
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"