Sage/dynamodb_framework

View on GitHub
lib/dynamodb_framework/dynamodb_repository.rb

Summary

Maintainability
C
1 day
Test Coverage
A
94%

Method query has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def query(partition_key_name, partition_key_value, range_key_name = nil, range_key_value = nil, expression = nil, expression_params = nil, index_name = nil, limit = nil, count = false)

      params = {
          table_name: table_name
      }
Severity: Minor
Found in lib/dynamodb_framework/dynamodb_repository.rb - About 1 hr to fix

    Method query has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def query(partition_key_name, partition_key_value, range_key_name = nil, range_key_value = nil, expression = nil, expression_params = nil, index_name = nil, limit = nil, count = false)
    
          params = {
              table_name: table_name
          }
    Severity: Minor
    Found in lib/dynamodb_framework/dynamodb_repository.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 scan has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def scan(expression, expression_params, limit = nil, count = false)
    
          params = {
              :table_name => table_name
          }
    Severity: Minor
    Found in lib/dynamodb_framework/dynamodb_repository.rb - About 1 hr to fix

      Method scan has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def scan(expression, expression_params, limit = nil, count = false)
      
            params = {
                :table_name => table_name
            }
      Severity: Minor
      Found in lib/dynamodb_framework/dynamodb_repository.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 clean_hash has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def clean_hash(hash)
            hash.each do |key, value|
              if value == ''
                hash[key] = nil
              elsif value.is_a?(Array)
      Severity: Minor
      Found in lib/dynamodb_framework/dynamodb_repository.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 query has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def query(partition_key_name, partition_key_value, range_key_name = nil, range_key_value = nil, expression = nil, expression_params = nil, index_name = nil, limit = nil, count = false)
      Severity: Major
      Found in lib/dynamodb_framework/dynamodb_repository.rb - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status