rules:
  - id: useless-inner-function
    patterns:
      - pattern-not-inside: |
          def $F(...):
              ...
              def $FF(...):
                 ...
              ...
              <... $FF ...>
      - pattern-not-inside: |
          def $F(...):
              ...
              class $CLAZZ(...):
                ...
      - pattern-inside: |
          def $F(...):
            ...
            def $FF(...):
               ...
            ...
      - pattern: |
          def $FF(...):
            ...
      - pattern-not: |
          @$DECORATOR
          def $FF(...):
            ...
    message: function `$FF` is defined inside a function but never used
    languages:
      - python
    severity: ERROR
    metadata:
      category: maintainability
      technology:
        - python
