ruprict/oriented

View on GitHub

Showing 23 of 27 total issues

Method unregister_hook_class has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def unregister_hook_class(hook_class)
      return hook_classes unless hook_classes.include?(hook_class)
      hook_classes.delete(hook_class)
      return unless connection.java_connection

Severity: Minor
Found in lib/oriented/connection.rb - About 25 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 converter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def converter(type = nil, enforce_type = true)
        return DefaultConverter unless type
        @converters ||= begin
                          Oriented::TypeConverters.constants.find_all do |c|
                            Oriented::TypeConverters.const_get(c).respond_to?(:convert?)
Severity: Minor
Found in lib/oriented/type_converters.rb - About 25 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 has_one has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def has_one(rel_label, options={})
        method_name = rel_label.downcase
        unless method_defined?(method_name)
          class_eval <<-RUBY, __FILE__, __LINE__
            def #{method_name} 
Severity: Minor
Found in lib/oriented/relationships.rb - About 25 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

Severity
Category
Status
Source
Language