Method package_existence_consistency_check
has a Cognitive Complexity of 35 (exceeds 8 allowed). Consider refactoring. Wontfix
def package_existence_consistency_check(project, fix = nil)
errors = ''
begin
project.reload
rescue ActiveRecord::RecordNotFound
- 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 package_existence_consistency_check
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
def package_existence_consistency_check(project, fix = nil)
errors = ''
begin
project.reload
rescue ActiveRecord::RecordNotFound
Method hash_diff
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Wontfix
def hash_diff(a, b)
# ignore the order inside of the hash
(a.keys | b.keys).sort!.each_with_object({}) do |diff, k|
a_ = a[k]
b_ = b[k]
- 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 project_existence_consistency_check
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Wontfix
def project_existence_consistency_check(fix = nil)
errors = ''
# compare projects
project_list_api = Project.order(:name).pluck(:name)
begin
- 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 project_existence_consistency_check
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
def project_existence_consistency_check(fix = nil)
errors = ''
# compare projects
project_list_api = Project.order(:name).pluck(:name)
begin