CodeAnt AI home pagelight logodark logo
  • Support
  • Dashboard
  • Dashboard
Documentation
API Reference
Start Here
  • What is CodeAnt?
  • Join Community
Setup
  • Github
  • Bitbucket
  • Gitlab
  • Azure Devops
Pull Request Review
  • Features
  • Customize Review
  • Quality Gates
  • Integrations
Scan center
  • Code Security
  • Code Quality
  • Cloud Security
  • Engineering Productivity
Integrations
  • Jira
  • Test Coverage
  • CI/CD
IDE
  • Setup
  • Review
  • Enhancements
Rule Reference
  • Compliance
  • Anti-Patterns
  • Code Governance
  • Infrastructure Security Database
  • Application Security Database
    • Apex
    • Bash
    • C
    • Clojure
    • Cpp
    • Csharp
    • Dockerfile
    • Elixir
    • Fingerprints
    • Generic
    • Go
    • Html
    • Java
    • Javascript
    • Json
    • Kotlin
    • Ocaml
    • Php
    • Problem-based-packs
    • Python
      • Airflow
      • Attr
      • Aws-lambda
      • Bokeh
      • Boto3
      • Cassandra
      • Click
      • Correctness
      • Couchbase
      • Cryptography
      • Distributed
      • Django
      • Docker
      • Elasticsearch
      • Fastapi
      • Flask
      • Jinja2
      • Jwt
      • Lang
        • Best practice
        • Code
        • Compatibility
        • Correctness
        • Correctness
        • Deserialization
        • File
        • Hardcoded
        • Maintainability
        • Os
        • Security
        • Security
      • Ldap3
      • Mariadb
      • Mysql
      • Mysqlclient
      • Neo4j
      • Openai
      • Peewee
      • Pg8000
      • Psycopg2
      • Pycryptodome
      • Pyjwt
      • Pymongo
      • Pymssql
      • Pymysql
      • Pyramid
      • Redis
      • Requests
      • Sh
      • Sqlalchemy
      • Tormysql
      • Urllib3
      • Webrepl
      • Wtforms
    • Ruby
    • Rust
    • Scala
    • Solidity
    • Swift
    • Terraform
    • Typescript
    • Yaml
Resources
  • Open Source
  • Blogs
Lang

Best practice

manual-defaultdict-dict-create

manually creating a defaultdict - use collections.defaultdict(dict)

manual-defaultdict-set-create

manually creating a defaultdict - use collections.defaultdict(set)

manual-defaultdict-list-create

manually creating a defaultdict - use collections.defaultdict(list)

manual-counter-create

manually creating a counter - use collections.Counter

hardcoded-tmp-path

Detected hardcoded temp directory. Consider using ‘tempfile.TemporaryFile’ instead.

missing-hash-with-eq

Class $A has defined __eq__ which means it should also have defined __hash__;

pass-body-fn

pass is the body of function $X. Consider removing this or raise NotImplementedError() if this is a TODO

pass-body-range

pass is the body of for XinX in XinY. Consider removing this or raise NotImplementedError() if this is a TODO

arbitrary-sleep

time.sleep() call; did you mean to leave this in?

unspecified-open-encoding

Missing ‘encoding’ parameter. ‘open()’ uses device locale encodings by default, corrupting files with special characters. Specify the encoding to ensure cross-platform support when opening files in text mode (e.g. encoding=“utf-8”).

open-never-closed

file object opened without corresponding close

python-debugger-found

Importing the python debugger; did you mean to leave this in?

logging-error-without-handling

Errors should only be logged when handled. The code logs the error and propogates the exception, consider reducing the level to warning or info.
AuditTainted code stdlib
twitterlinkedin
Powered by Mintlify
Assistant
Responses are generated using AI and may contain mistakes.