mindreframer/callme

View on GitHub
lib/ext/vendored_activesupport.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Method class_attribute has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    def class_attribute(*attrs)
      options = attrs.extract_options!
      instance_reader = options.fetch(:instance_accessor, true) && options.fetch(:instance_reader, true)
      instance_writer = options.fetch(:instance_accessor, true) && options.fetch(:instance_writer, true)
      instance_predicate = options.fetch(:instance_predicate, true)
Severity: Minor
Found in lib/ext/vendored_activesupport.rb - About 4 hrs 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 class_attribute has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def class_attribute(*attrs)
      options = attrs.extract_options!
      instance_reader = options.fetch(:instance_accessor, true) && options.fetch(:instance_reader, true)
      instance_writer = options.fetch(:instance_accessor, true) && options.fetch(:instance_writer, true)
      instance_predicate = options.fetch(:instance_predicate, true)
Severity: Minor
Found in lib/ext/vendored_activesupport.rb - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status