Method initialize_available_filters
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize_available_filters
add_available_filter "spent_on", :type => :date_past
add_available_filter(
"project_id",
:type => :list, :values => lambda {project_values}
Class TimeEntryQuery
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class TimeEntryQuery < Query
self.queried_class = TimeEntry
self.view_permission = :view_time_entries
self.available_columns = [
Method joins_for_order_statement
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def joins_for_order_statement(order_options)
joins = [super]
if order_options
if order_options.include?('issue_statuses')
- 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 sql_for_issue_parent_id_field
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def sql_for_issue_parent_id_field(field, operator, value)
case operator
when "="
# accepts a comma separated list of ids
parent_ids = value.first.to_s.scan(/\d+/).map(&:to_i).uniq
- 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 initialize_available_filters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize_available_filters
add_available_filter "spent_on", :type => :date_past
add_available_filter(
"project_id",
:type => :list, :values => lambda {project_values}
- 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 sql_for_issue_fixed_version_id_field
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sql_for_issue_fixed_version_id_field(field, operator, value)
issue_ids = Issue.where(:fixed_version_id => value.map(&:to_i)).pluck(:id)
case operator
when "="
if issue_ids.any?
- 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"