Method show
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def show
set_current_title group.title
set_current_navable group
set_current_tab :contacts
- 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 show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
set_current_title group.title
set_current_navable group
set_current_tab :contacts
Method fill_small_map_address_fields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fill_small_map_address_fields
# On collection groups, e.g. the corporations_parent group, only the
# groups should be shown on the map. These groups have a lot of
# child groups with address profile fields.
#
- 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 permitted_group_attributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def permitted_group_attributes
permitted_keys = []
permitted_keys += [:name, :extensive_name] if can? :rename, @group
permitted_keys += [:token] if can? :change_token, @group
permitted_keys += [:internal_token] if can? :change_internal_token, @group
- 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"