thomis/db_meta

View on GitHub
lib/db_meta/oracle/objects.rb

Summary

Maintainability
B
5 hrs
Test Coverage
F
22%

Method handle_table_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

      def handle_table_data(args)
        Log.info("Handling table data...")

        @exclude_data = args[:exclude_data] if args[:exclude_data]
        @include_data = args[:include_data] if args[:include_data]
Severity: Minor
Found in lib/db_meta/oracle/objects.rb - About 2 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 default_each has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def default_each
        @data.keys.sort_by { |type| type_sequence(type) }.each do |type|
          @data[type].keys.sort.each do |name|
            object = @data[type][name]
            next if object.system_object?
Severity: Minor
Found in lib/db_meta/oracle/objects.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 reverse_default_each has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def reverse_default_each
        @data.keys.sort_by { |type| type_sequence(type) }.reverse_each do |type|
          @data[type].keys.sort.each do |name|
            object = @data[type][name]
            next if object.system_object?
Severity: Minor
Found in lib/db_meta/oracle/objects.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 detect_system_objects has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def detect_system_objects
        Log.info("Detecting system objects...")

        # detect materialized view tables
        @data["MATERIALZIED VIEW"].values.each do |object|
Severity: Minor
Found in lib/db_meta/oracle/objects.rb - About 45 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 fetch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def fetch(args = {})
        # fetch details in parallel
        # number of threads = physical connections / 2 to prevent application locking
        worker = (1..Connection.instance.worker / 2).map {
          Thread.new do
Severity: Minor
Found in lib/db_meta/oracle/objects.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