<commit_before>tenets:
  - name: empty-catch-block
    actions:
      codelingo/docs:
        title: Empty Catch Block
        body: |
          "Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem." - https://github.com/phpmd/phpmd/blob/master/src/site/rst/rules/index.rst#clean-code-rules
      codelingo/review:
        comment: This catch block doesn't handle anything and may supress important errors.
    query: |
      import codelingo/ast/php

      @review comment
      php.stmt_catch(depth = any):
        child_count == "1"<commit_msg>fix rule (#495)<commit_after>tenets:
  - name: empty-catch-block
    actions:
      codelingo/docs:
        title: Empty Catch Block
        body: |
          "Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem." - https://github.com/phpmd/phpmd/blob/master/src/site/rst/rules/index.rst#clean-code-rules
      codelingo/review:
        comment: This catch block doesn't handle anything and may supress important errors.
    query: |
      import codelingo/ast/php

      @review comment
      php.stmt_catch(depth = any):
        child_count == 1
{'fraction_non_alphanumeric': 0.0762081784386617, 'fraction_numerical': 0.0030978934324659233, 'mean_word_length': 2.9104116222760292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6536569', 'n_tokens_mistral': 461, 'n_tokens_neox': 437, 'n_words': 179}