rayepps/dynamof

View on GitHub

Showing 10 of 10 total issues

File dynamo.py has 577 lines of code (exceeds 250 allowed). Consider refactoring.
Open

def get_safe_alias(attr_name):
    return DYNAMO_RESERVED_WORDS.get(attr_name.upper(), attr_name)

DYNAMO_RESERVED_WORDS = {
    'ABORT': '#abort',
Severity: Major
Found in dynofunc/core/dynamo.py - About 1 day to fix

    Function builder has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def builder(
    Severity: Major
    Found in dynofunc/core/builder.py - About 1 hr to fix

      Function RequestTree has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def RequestTree(attributes, table_name, index_name, hash_key, range_key, conditions, gsi, lsi):
      Severity: Major
      Found in dynofunc/core/model.py - About 1 hr to fix

        Function strip_Decimals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def strip_Decimals(obj):
        
            if isinstance(obj, list):
                return [strip_Decimals(item) for item in obj]
            if isinstance(obj, dict):
        Severity: Minor
        Found in dynofunc/core/utils.py - 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

        Function Attr has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def Attr(equals, gt, lt, lt_or_eq, gt_or_eq, between, begins_with):
        Severity: Major
        Found in dynofunc/core/model.py - About 50 mins to fix

          Function create has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def create(table_name: str, hash_key: str, range_key: str = None, gsi: str = None, lsi: str = None):
          Severity: Minor
          Found in dynofunc/operations/create.py - About 35 mins to fix

            Function Attribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def Attribute(original, key, value, alias, func):
            Severity: Minor
            Found in dynofunc/core/model.py - About 35 mins to fix

              Function builder has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def builder(
                  table_name,
                  index_name=None,
                  key=None,
                  attributes=None,
              Severity: Minor
              Found in dynofunc/core/builder.py - 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

              Avoid too many return statements within this function.
              Open

                  return obj
              Severity: Major
              Found in dynofunc/core/utils.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return UnknownDatabaseException(boto_client_err)
                Severity: Major
                Found in dynofunc/core/exceptions.py - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language