Method join_conditions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def join_conditions(tables, current_user)
result = []
errors = []
result_hash = self.sql_codes(current_user)
sql_open = result_hash[:open]
- 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 table_columns
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def table_columns(current_user, table, page = 1, per_page = -1, filter_unmapped = false, search = '')
Method user_has_action?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def user_has_action?(current_user, action)
return true if current_user.all_sources.include?(self)
result = false
blocked = false
self.rules.each do |rule|
- 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 table_columns
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def table_columns(current_user, table, page = 1, per_page = -1, filter_unmapped = false, search = '')
result_hash = Aqueduct::Builder.wrapper(self, current_user).table_columns(table)
columns = result_hash[:columns]
error = result_hash[:error]
- 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"