old_test/common_test_methods.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method bootstrap_zebra_with_initial_records has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def bootstrap_zebra_with_initial_records(prime_records = false)
  # both of the silencers are need to supress the two types of messages Zebra
  # outputs to the console
  silence_stream(STDERR) do
    silence_stream(STDOUT) do
Severity: Minor
Found in old_test/common_test_methods.rb - About 1 hr 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

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

def item_for(zoom_class, options = {})
  if ATTACHABLE_CLASSES.include?(zoom_class)
    file_data =
      case zoom_class
      when 'AudioRecording'
Severity: Minor
Found in old_test/common_test_methods.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

Method set_constant has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def set_constant(constant, value)
  # Walter McGinnis, 2010-10-15
  # update to also update Kete object with value via redefining getter method
  Kete.define_reader_method_as(constant.to_s.downcase, value)

Severity: Minor
Found in old_test/common_test_methods.rb - About 35 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

There are no issues that match your filters.

Category
Status