app/actions/revision_resolver.rb
Method update_app_revision
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def update_app_revision(app, user_audit_info)
return nil unless app.revisions_enabled && app.droplet_guid.present?
latest_revision = app.latest_revision
if latest_revision.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 list_process_command_changes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def list_process_command_changes(commands_by_process_type_a, commands_by_process_type_b)
commands_differences = Hashdiff.diff(commands_by_process_type_a, commands_by_process_type_b)
commands_differences.map do |change_type, process_type, *command_change|
if change_type == '+'
- 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"