> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Correctness

<AccordionGroup>
  <Accordion title="pytest-assert_match-after-path-patch">
    snapshot.assert\_match makes use of pathlib to create files. Patching \$METHOD may result in unexpected snapshot behavior
  </Accordion>

  <Accordion title="sync-sleep-in-async-code">
    Synchronous time.sleep in async code will block the event loop and not allow other tasks to execute. Use asyncio.sleep() instead.
  </Accordion>

  <Accordion title="unchecked-subprocess-call">
    This is not checking the return value of this subprocess call; if it fails no exception will be raised. Consider subprocess.check\_call() instead
  </Accordion>

  <Accordion title="baseclass-attribute-override">
    Class $C inherits from both `$A`and`$B` which both have a method named `$F\`; one of these methods will be overwritten.
  </Accordion>

  <Accordion title="file-object-redefined-before-close">
    Detected a file object that is redefined and never closed. This could leak file descriptors and unnecessarily consume system resources.
  </Accordion>

  <Accordion title="uncaught-executor-exceptions">
    Values returned by thread pool map must be read in order to raise exceptions. Consider using `for _ in $EXECUTOR.map(...): pass`.
  </Accordion>

  <Accordion title="return-in-init">
    `return` should never appear inside a class **init** function. This will cause a runtime error.
  </Accordion>

  <Accordion title="yield-in-init">
    `yield` should never appear inside a class **init** function. This will cause a runtime error.
  </Accordion>

  <Accordion title="list-modify-while-iterate">
    It appears that `$LIST` is a list that is being modified while in a for loop. This will likely cause a runtime error or an infinite loop.
  </Accordion>

  <Accordion title="use-sys-exit">
    Detected use of `exit`. Use `sys.exit` over the python shell `exit` built-in. `exit` is a helper for the interactive shell and may not be available on all Python implementations.
  </Accordion>

  <Accordion title="writing-to-file-in-read-mode">
    The file object '\$FD' was opened in read mode, but is being written to. This will cause a runtime error.
  </Accordion>

  <Accordion title="no-strings-as-booleans">
    Using strings as booleans in Python has unexpected results. `"one" and "two"` will return "two". `"one" or "two"` will return "one". In Python, strings are truthy, and strings with a non-zero length evaluate to True.
  </Accordion>

  <Accordion title="test-is-missing-assert">
    Comparison without assertion. The result of this comparison is not used. Perhaps this expression is missing an `assert` keyword.
  </Accordion>

  <Accordion title="dict-del-while-iterate">
    It appears that `$DICT[$KEY]` is a dict with items being deleted while in a for loop. This is usually a bad idea and will likely lead to a RuntimeError: dictionary changed size during iteration
  </Accordion>

  <Accordion title="cannot-cache-generators">
    Generators can only be consumed once, so in most cases, caching them will cause an error when the already-consumed generator is retrieved from cache.
  </Accordion>

  <Accordion title="pdb-remove">
    pdb is an interactive debugging tool and you may have forgotten to remove it before committing your code
  </Accordion>

  <Accordion title="useless-eqeq">
    This expression is always True: `$X == $X` or `$X != $X`. If testing for floating point NaN, use `math.isnan($X)`, or `cmath.isnan($X)` if the number is complex.
  </Accordion>
</AccordionGroup>
