cequel/cequel

View on GitHub
lib/cequel/spec_support/preparation.rb

Summary

Maintainability
A
55 mins
Test Coverage

Method sync_schema has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def sync_schema
        record_classes.each do |record_class|
          begin
            record_class.synchronize_schema
            unless options[:quiet]
Severity: Minor
Found in lib/cequel/spec_support/preparation.rb - About 55 mins to fix

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

Do not use parallel assignment.
Open

        @model_dirs, @options = model_dirs, options

Checks for simple usages of parallel assignment. This will only complain when the number of variables being assigned matched the number of assigning variables.

Example:

# bad
a, b, c = 1, 2, 3
a, b, c = [1, 2, 3]

# good
one, two = *foo
a, b = foo()
a, b = b, a

a = 1
b = 2
c = 3

There are no issues that match your filters.

Category
Status