Python/Python

[Python] Linter 비교

상쾌한기분 2022. 10. 31. 22:37
반응형

Python Linter

Linter 종류와 개요

구 분 flake8 pylint bandit
종 류 linter linter security linter
Star 2.3K 4.2K 4.5K
특 징 코드 스타일, 오류 복잡성 검사 코드 스타일, code smell, 오류 등을 검사 unsafe coding 검사
장 점 간단함, 많은 플러그인이 있음 세팅 비용이 flake8 비해 높음  
단 점 많은 플러그인을 있음 린트 통과가 flake8 비해 까다로움  

다른 개발자들은 어떻게 사용할까 (from Reddit, StackShare)

  • flake8 + pylint 사용하는 경우
  • flake8 + pylint + bandit 사용하는 경우
  • (flake8 or pylint) + bandit 사용하는 경우
  • 전자들과 추가적으로 black, isort, yapf 같이 사용 하는 경우 등

flake8 (linter)

코드 스타일, 오류, 복잡성 검사 해주며 아래를 패키지를 wrapper 하고 있다.

pylint (linter)

코드 스타일, code smell, 유형 오류 등을 검사. (복잡성은 플리그인 설치 필요)
flake8 보다 린트 통과가 까다롭다.

bandit (security linter)

unsafe coding (exec, assert debug=True) 등 검사
AWS에서 bandit 기반의 보안 탐지 같은 서비스가 있음

추가 정보

Linter 실행 결과

에러를 잡기 위해서 일부러 에러 코드 작성

flake8

실행
pip install flake8

# .flake8 설정 파일 생성
[flake8]
exclude =
    venv/,
    venv_2/,
    .git,
    .gitignore,
    *.pot,
    *.py[co],
    __pycache__,
    .env,
    django_graphql/


ignore =
    E501,
    E251,
    E402
결과
flake8 .

./app/printers/tests/test_printer.py:97:13: F841 local variable 'output' is assigned to but never used
./app/authentication/apps.py:6:30: E999 SyntaxError: EOL while scanning string literal
./app/authentication/queries.py:3:1: F401 'graphene_django.filter.DjangoFilterConnectionFieldSomething' imported but unused
./app/authentication/queries.py:17:13: F821 undefined name 'DjangoFilterConnectionField'
./app/authentication/tests/test_users.py:99:5: F841 local variable 'user_count' is assigned to but never used
./app/authentication/tests/test_users.py:100:5: F841 local variable 'user_count_2' is assigned to but never used
./app/authentication/tests/test_users.py:109:13: F841 local variable 'user' is assigned to but never used

pylint

실행
pip install pylint

pylint app
결과
************* Module app.authentication.apps
app/authentication/apps.py:6:31: E0001: Parsing failed: 'EOL while scanning string literal (<unknown>, line 6)' (syntax-error)
************* Module app.core.base_connections
app/core/base_connections.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/core/base_connections.py:4:0: C0115: Missing class docstring (missing-class-docstring)
app/core/base_connections.py:5:4: C0115: Missing class docstring (missing-class-docstring)
app/core/base_connections.py:5:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/core/base_connections.py:12:4: C0116: Missing function or method docstring (missing-function-docstring)
app/core/base_connections.py:12:39: W0613: Unused argument 'info' (unused-argument)
app/core/base_connections.py:12:0: W0613: Unused argument 'kwargs' (unused-argument)
************* Module app.core.colorful
app/core/colorful.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/core/colorful.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)
app/core/colorful.py:4:24: C0103: Argument name "c" doesn't conform to snake_case naming style (invalid-name)
app/core/colorful.py:9:0: C0116: Missing function or method docstring (missing-function-docstring)
app/core/colorful.py:13:0: C0116: Missing function or method docstring (missing-function-docstring)
app/core/colorful.py:17:0: C0116: Missing function or method docstring (missing-function-docstring)
app/core/colorful.py:21:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module app.core.middlewares
app/core/middlewares.py:21:0: C0301: Line too long (130/100) (line-too-long)
app/core/middlewares.py:23:0: C0301: Line too long (128/100) (line-too-long)
app/core/middlewares.py:39:0: C0301: Line too long (104/100) (line-too-long)
app/core/middlewares.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/core/middlewares.py:32:0: E0611: No name 'UserType' in module 'app.articles.types' (no-name-in-module)
app/core/middlewares.py:35:0: C0115: Missing class docstring (missing-class-docstring)
app/core/middlewares.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods)
app/core/middlewares.py:42:0: C0115: Missing class docstring (missing-class-docstring)
app/core/middlewares.py:44:4: C0116: Missing function or method docstring (missing-function-docstring)
app/core/middlewares.py:44:22: W0622: Redefining built-in 'next' (redefined-builtin)
app/core/middlewares.py:42:0: R0903: Too few public methods (1/2) (too-few-public-methods)
************* Module app.core.graphen_utils
app/core/graphen_utils.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/core/graphen_utils.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)
app/core/graphen_utils.py:7:11: W0703: Catching too general exception Exception (broad-except)
app/core/graphen_utils.py:8:8: C0415: Import outside toplevel (app.core.colorful.red) (import-outside-toplevel)
app/core/graphen_utils.py:14:0: C0116: Missing function or method docstring (missing-function-docstring)
app/core/graphen_utils.py:14:26: C0103: Argument name "id" doesn't conform to snake_case naming style (invalid-name)
app/core/graphen_utils.py:14:20: W0622: Redefining built-in 'type' (redefined-builtin)
app/core/graphen_utils.py:14:26: W0622: Redefining built-in 'id' (redefined-builtin)
app/core/graphen_utils.py:17:11: W0703: Catching too general exception Exception (broad-except)
app/core/graphen_utils.py:18:8: C0415: Import outside toplevel (app.core.colorful.red) (import-outside-toplevel)
************* Module app.articles.services
app/articles/services.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/services.py:6:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/services.py:8:11: R1719: The if expression can be replaced with 'test' (simplifiable-if-expression)
************* Module app.articles.models
app/articles/models.py:32:0: C0301: Line too long (105/100) (line-too-long)
app/articles/models.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/models.py:8:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/models.py:10:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/models.py:13:15: E1101: Class 'User' has no 'DoesNotExist' member (no-member)
app/articles/models.py:14:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise User.DoesNotExist(f'this user not exist: {creator_id}') from exc' (raise-missing-from)
app/articles/models.py:14:18: E1101: Class 'User' has no 'DoesNotExist' member (no-member)
app/articles/models.py:8:0: R0903: Too few public methods (1/2) (too-few-public-methods)
app/articles/models.py:25:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/models.py:37:4: E0307: __str__ does not return str (invalid-str-returned)
app/articles/models.py:43:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
app/articles/models.py:46:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/models.py:47:46: E1101: Instance of 'Article' has no 'id' member; maybe 'gid'? (no-member)
app/articles/models.py:50:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/models.py:51:15: E1101: Instance of 'Article' has no 'comments' member (no-member)
app/articles/models.py:54:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/models.py:58:46: E1101: Instance of 'ForeignKey' has no 'username' member (no-member)
app/articles/models.py:63:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/models.py:65:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/models.py:69:15: E1101: Class 'Article' has no 'DoesNotExist' member (no-member)
app/articles/models.py:70:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise Article.DoesNotExist(f'this article not exist: {article_id}') from exc' (raise-missing-from)
app/articles/models.py:70:18: E1101: Class 'Article' has no 'DoesNotExist' member (no-member)
app/articles/models.py:71:15: E1101: Class 'User' has no 'DoesNotExist' member (no-member)
app/articles/models.py:72:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise User.DoesNotExist(f'this user not exist: {user_id}') from exc' (raise-missing-from)
app/articles/models.py:72:18: E1101: Class 'User' has no 'DoesNotExist' member (no-member)
app/articles/models.py:63:0: R0903: Too few public methods (1/2) (too-few-public-methods)
app/articles/models.py:83:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/models.py:98:4: E0307: __str__ does not return str (invalid-str-returned)
************* Module app.articles.mutations
app/articles/mutations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/mutations.py:18:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:23:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:27:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:28:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:28:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/mutations.py:34:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/mutations.py:34:32: W0622: Redefining built-in 'input' (redefined-builtin)
app/articles/mutations.py:34:20: W0613: Unused argument 'root' (unused-argument)
app/articles/mutations.py:34:26: W0613: Unused argument 'info' (unused-argument)
app/articles/mutations.py:43:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:44:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:44:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/mutations.py:51:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/mutations.py:51:49: W0622: Redefining built-in 'input' (redefined-builtin)
app/articles/mutations.py:57:15: E1101: Class 'Article' has no 'DoesNotExist' member (no-member)
app/articles/mutations.py:58:12: W0707: Consider explicitly re-raising using 'except Exception as exc' and 'raise Article.DoesNotExist(f'this article not exist: {article_id}') from exc' (raise-missing-from)
app/articles/mutations.py:58:18: E1101: Class 'Article' has no 'DoesNotExist' member (no-member)
app/articles/mutations.py:51:20: W0613: Unused argument 'root' (unused-argument)
app/articles/mutations.py:51:26: W0613: Unused argument 'info' (unused-argument)
app/articles/mutations.py:63:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:64:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:64:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/mutations.py:70:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/mutations.py:73:18: E1101: Class 'Article' has no 'DoesNotExist' member (no-member)
app/articles/mutations.py:70:20: W0613: Unused argument 'root' (unused-argument)
app/articles/mutations.py:70:26: W0613: Unused argument 'info' (unused-argument)
app/articles/mutations.py:79:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:83:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:84:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:84:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/mutations.py:87:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:87:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/mutations.py:93:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/mutations.py:93:32: W0622: Redefining built-in 'input' (redefined-builtin)
app/articles/mutations.py:97:15: E1101: Class 'User' has no 'DoesNotExist' member (no-member)
app/articles/mutations.py:93:20: W0613: Unused argument 'root' (unused-argument)
app/articles/mutations.py:93:26: W0613: Unused argument 'info' (unused-argument)
app/articles/mutations.py:101:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:105:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:110:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:111:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/mutations.py:111:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/mutations.py:117:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/mutations.py:117:32: W0622: Redefining built-in 'input' (redefined-builtin)
app/articles/mutations.py:117:20: W0613: Unused argument 'root' (unused-argument)
app/articles/mutations.py:117:26: W0613: Unused argument 'info' (unused-argument)
************* Module app.articles.serializers
app/articles/serializers.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/serializers.py:6:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/serializers.py:9:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/serializers.py:9:4: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module app.articles.loaders
app/articles/loaders.py:54:0: C0301: Line too long (109/100) (line-too-long)
app/articles/loaders.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/loaders.py:13:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/loaders.py:15:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:15:4: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
app/articles/loaders.py:24:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/loaders.py:25:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:25:4: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
app/articles/loaders.py:34:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:35:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/loaders.py:36:8: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:36:8: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
app/articles/loaders.py:49:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:73:8: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:73:8: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
app/articles/loaders.py:86:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:107:4: W0621: Redefining name 'ArticleLoader' from outer scope (line 13) (redefined-outer-name)
app/articles/loaders.py:99:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/loaders.py:101:8: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:101:8: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
app/articles/loaders.py:107:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/loaders.py:109:8: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:109:8: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
app/articles/loaders.py:115:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/loaders.py:117:8: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/loaders.py:117:8: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
app/articles/loaders.py:86:20: W0613: Unused argument 'node' (unused-argument)
app/articles/loaders.py:86:44: W0613: Unused argument 'attr' (unused-argument)
************* Module app.articles.types
app/articles/types.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/types.py:11:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/types.py:12:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/types.py:12:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/types.py:27:28: W0622: Redefining built-in 'id' (redefined-builtin)
app/articles/types.py:38:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/types.py:39:15: E1101: Instance of 'ArticleType' has no 'gid' member (no-member)
app/articles/types.py:38:38: W0613: Unused argument 'info' (unused-argument)
app/articles/types.py:43:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/types.py:43:47: W0613: Unused argument 'info' (unused-argument)
app/articles/types.py:46:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/types.py:46:58: W0613: Unused argument 'info' (unused-argument)
app/articles/types.py:55:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/types.py:56:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/types.py:56:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/types.py:73:28: W0622: Redefining built-in 'id' (redefined-builtin)
************* Module app.articles.apps
app/articles/apps.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/apps.py:4:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.articles.admin
app/articles/admin.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module app.articles.utils
app/articles/utils.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/utils.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/utils.py:6:15: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
************* Module app.articles.queries
app/articles/queries.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/queries.py:11:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/queries.py:20:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/queries.py:23:15: E1101: Class 'Article' has no 'DoesNotExist' member (no-member)
app/articles/queries.py:20:30: W0613: Unused argument 'info' (unused-argument)
app/articles/queries.py:26:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/queries.py:29:15: E1101: Class 'Comment' has no 'DoesNotExist' member (no-member)
app/articles/queries.py:26:30: W0613: Unused argument 'info' (unused-argument)
************* Module app.articles.filters
app/articles/filters.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/filters.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/filters.py:8:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/filters.py:8:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/articles/filters.py:29:15: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
app/articles/filters.py:32:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/filters.py:33:4: C0115: Missing class docstring (missing-class-docstring)
app/articles/filters.py:33:4: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module app.articles.views
app/articles/views.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/views.py:9:0: C0115: Missing class docstring (missing-class-docstring)
app/articles/views.py:12:4: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/views.py:12:18: W0613: Unused argument 'request' (unused-argument)
app/articles/views.py:12:0: W0613: Unused argument 'args' (unused-argument)
app/articles/views.py:12:0: W0613: Unused argument 'kwargs' (unused-argument)
************* Module app.articles.migrations.0002_auto_20220826_1617
app/articles/migrations/0002_auto_20220826_1617.py:21:0: C0301: Line too long (135/100) (line-too-long)
app/articles/migrations/0002_auto_20220826_1617.py:26:0: C0301: Line too long (135/100) (line-too-long)
app/articles/migrations/0002_auto_20220826_1617.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/migrations/0002_auto_20220826_1617.py:1:0: C0103: Module name "0002_auto_20220826_1617" doesn't conform to snake_case naming style (invalid-name)
app/articles/migrations/0002_auto_20220826_1617.py:8:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.articles.migrations.0001_initial
app/articles/migrations/0001_initial.py:18:0: C0301: Line too long (114/100) (line-too-long)
app/articles/migrations/0001_initial.py:29:0: C0301: Line too long (114/100) (line-too-long)
app/articles/migrations/0001_initial.py:33:0: C0301: Line too long (140/100) (line-too-long)
app/articles/migrations/0001_initial.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/migrations/0001_initial.py:1:0: C0103: Module name "0001_initial" doesn't conform to snake_case naming style (invalid-name)
app/articles/migrations/0001_initial.py:7:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.articles.tests.test_articles
app/articles/tests/test_articles.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/tests/test_articles.py:13:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/tests/test_articles.py:14:8: W0613: Unused argument 'query_client' (unused-argument)
app/articles/tests/test_articles.py:15:8: W0613: Unused argument 'create_random_users' (unused-argument)
app/articles/tests/test_articles.py:80:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/tests/test_articles.py:81:8: W0613: Unused argument 'create_random_articles_with_random_users' (unused-argument)
app/articles/tests/test_articles.py:94:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/tests/test_articles.py:95:4: C0415: Import outside toplevel (app.articles.services.health_check_naver) (import-outside-toplevel)
app/articles/tests/test_articles.py:102:0: C0116: Missing function or method docstring (missing-function-docstring)
app/articles/tests/test_articles.py:103:4: C0415: Import outside toplevel (rest_framework.status) (import-outside-toplevel)
app/articles/tests/test_articles.py:104:4: C0415: Import outside toplevel (app.articles.services.health_check_naver) (import-outside-toplevel)
************* Module app.articles.management.commands.create_random_article
app/articles/management/commands/create_random_article.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/articles/management/commands/create_random_article.py:13:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.stocks.models
app/stocks/models.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/stocks/models.py:8:0: C0115: Missing class docstring (missing-class-docstring)
app/stocks/models.py:15:4: C0116: Missing function or method docstring (missing-function-docstring)
app/stocks/models.py:19:4: C0116: Missing function or method docstring (missing-function-docstring)
app/stocks/models.py:24:0: C0116: Missing function or method docstring (missing-function-docstring)
app/stocks/models.py:24:19: C0103: Argument name "a" doesn't conform to snake_case naming style (invalid-name)
app/stocks/models.py:24:31: C0103: Argument name "b" doesn't conform to snake_case naming style (invalid-name)
************* Module app.stocks.apps
app/stocks/apps.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/stocks/apps.py:4:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.stocks.migrations.0001_initial
app/stocks/migrations/0001_initial.py:17:0: C0301: Line too long (114/100) (line-too-long)
app/stocks/migrations/0001_initial.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/stocks/migrations/0001_initial.py:1:0: C0103: Module name "0001_initial" doesn't conform to snake_case naming style (invalid-name)
app/stocks/migrations/0001_initial.py:6:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.stocks.tests.test_stocks
app/stocks/tests/test_stocks.py:23:0: C0301: Line too long (107/100) (line-too-long)
app/stocks/tests/test_stocks.py:24:0: C0301: Line too long (107/100) (line-too-long)
app/stocks/tests/test_stocks.py:25:0: C0301: Line too long (107/100) (line-too-long)
app/stocks/tests/test_stocks.py:26:0: C0301: Line too long (107/100) (line-too-long)
app/stocks/tests/test_stocks.py:27:0: C0301: Line too long (107/100) (line-too-long)
app/stocks/tests/test_stocks.py:28:0: C0301: Line too long (106/100) (line-too-long)
app/stocks/tests/test_stocks.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/stocks/tests/test_stocks.py:20:4: C0116: Missing function or method docstring (missing-function-docstring)
app/stocks/tests/test_stocks.py:23:12: E1101: Class 'Stock' has no 'objects' member (no-member)
app/stocks/tests/test_stocks.py:24:12: E1101: Class 'Stock' has no 'objects' member (no-member)
app/stocks/tests/test_stocks.py:25:12: E1101: Class 'Stock' has no 'objects' member (no-member)
app/stocks/tests/test_stocks.py:26:12: E1101: Class 'Stock' has no 'objects' member (no-member)
app/stocks/tests/test_stocks.py:27:12: E1101: Class 'Stock' has no 'objects' member (no-member)
app/stocks/tests/test_stocks.py:28:12: E1101: Class 'Stock' has no 'objects' member (no-member)
app/stocks/tests/test_stocks.py:34:35: E1120: No value for argument 'b' in function call (no-value-for-parameter)
************* Module app.printers.models
app/printers/models.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/models.py:10:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/models.py:34:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/models.py:36:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/models.py:34:0: R0903: Too few public methods (1/2) (too-few-public-methods)
app/printers/models.py:48:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/models.py:56:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/models.py:57:15: E1101: Instance of 'OutboundStock' has no 'invoice' member (no-member)
app/printers/models.py:60:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/models.py:61:15: E1101: Instance of 'OutboundStock' has no 'encrypted_invoice' member (no-member)
app/printers/models.py:64:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/models.py:66:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/models.py:64:0: R0903: Too few public methods (1/2) (too-few-public-methods)
app/printers/models.py:73:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/models.py:83:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/models.py:85:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/models.py:83:0: R0903: Too few public methods (1/2) (too-few-public-methods)
app/printers/models.py:93:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.printers.mutations
app/printers/mutations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/mutations.py:6:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/mutations.py:10:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/mutations.py:11:4: C0115: Missing class docstring (missing-class-docstring)
app/printers/mutations.py:11:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/printers/mutations.py:14:4: C0115: Missing class docstring (missing-class-docstring)
app/printers/mutations.py:14:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/printers/mutations.py:20:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/mutations.py:20:32: W0622: Redefining built-in 'input' (redefined-builtin)
app/printers/mutations.py:27:16: E1101: Class 'OutboundStock' has no 'DoesNotExist' member (no-member)
app/printers/mutations.py:20:20: W0613: Unused argument 'root' (unused-argument)
app/printers/mutations.py:20:26: W0613: Unused argument 'info' (unused-argument)
app/printers/mutations.py:20:32: W0613: Unused argument 'input' (unused-argument)
************* Module app.printers.apps
app/printers/apps.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/apps.py:4:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.printers.migrations.0002_auto_20220918_1259
app/printers/migrations/0002_auto_20220918_1259.py:17:0: C0301: Line too long (477/100) (line-too-long)
app/printers/migrations/0002_auto_20220918_1259.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/migrations/0002_auto_20220918_1259.py:1:0: C0103: Module name "0002_auto_20220918_1259" doesn't conform to snake_case naming style (invalid-name)
app/printers/migrations/0002_auto_20220918_1259.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/migrations/0002_auto_20220918_1259.py:4:0: C0411: third party import "from django.db import migrations, models" should be placed before "import app.printers.models" (wrong-import-order)
************* Module app.printers.migrations.0001_initial
app/printers/migrations/0001_initial.py:18:0: C0301: Line too long (114/100) (line-too-long)
app/printers/migrations/0001_initial.py:21:0: C0301: Line too long (238/100) (line-too-long)
app/printers/migrations/0001_initial.py:27:0: C0301: Line too long (114/100) (line-too-long)
app/printers/migrations/0001_initial.py:29:0: C0301: Line too long (143/100) (line-too-long)
app/printers/migrations/0001_initial.py:35:0: C0301: Line too long (114/100) (line-too-long)
app/printers/migrations/0001_initial.py:38:0: C0301: Line too long (153/100) (line-too-long)
app/printers/migrations/0001_initial.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/migrations/0001_initial.py:1:0: C0103: Module name "0001_initial" doesn't conform to snake_case naming style (invalid-name)
app/printers/migrations/0001_initial.py:7:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.printers.tests.test_printer
app/printers/tests/test_printer.py:3:0: C0301: Line too long (105/100) (line-too-long)
app/printers/tests/test_printer.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/tests/test_printer.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/tests/test_printer.py:12:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/tests/test_printer.py:23:8: W4902: Using deprecated method assert_() (deprecated-method)
app/printers/tests/test_printer.py:25:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/tests/test_printer.py:36:8: W4902: Using deprecated method assert_() (deprecated-method)
app/printers/tests/test_printer.py:38:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/tests/test_printer.py:49:8: W4902: Using deprecated method assert_() (deprecated-method)
app/printers/tests/test_printer.py:51:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/tests/test_printer.py:62:8: W4902: Using deprecated method assert_() (deprecated-method)
app/printers/tests/test_printer.py:64:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/tests/test_printer.py:75:8: W4902: Using deprecated method assert_() (deprecated-method)
app/printers/tests/test_printer.py:77:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/tests/test_printer.py:89:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/tests/test_printer.py:97:12: W0612: Unused variable 'output' (unused-variable)
************* Module app.printers.management.commands.create_random_outbound_stocks
app/printers/management/commands/create_random_outbound_stocks.py:20:0: C0301: Line too long (104/100) (line-too-long)
app/printers/management/commands/create_random_outbound_stocks.py:25:0: C0301: Line too long (112/100) (line-too-long)
app/printers/management/commands/create_random_outbound_stocks.py:29:0: C0301: Line too long (147/100) (line-too-long)
app/printers/management/commands/create_random_outbound_stocks.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/management/commands/create_random_outbound_stocks.py:9:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.printers.services.output.factory
app/printers/services/output/factory.py:6:0: C0301: Line too long (114/100) (line-too-long)
app/printers/services/output/factory.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/services/output/factory.py:10:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module app.printers.services.output.printer_output_maker
app/printers/services/output/printer_output_maker.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/services/output/printer_output_maker.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/printer_output_maker.py:12:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/services/output/printer_output_maker.py:7:0: R0903: Too few public methods (1/2) (too-few-public-methods)
app/printers/services/output/printer_output_maker.py:16:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/printer_output_maker.py:18:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/services/output/printer_output_maker.py:18:43: W0613: Unused argument 'invoice_no' (unused-argument)
app/printers/services/output/printer_output_maker.py:23:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/services/output/printer_output_maker.py:28:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/printer_output_maker.py:28:0: R0903: Too few public methods (1/2) (too-few-public-methods)
************* Module app.printers.services.output.provider.html
app/printers/services/output/provider/html.py:4:0: C0301: Line too long (106/100) (line-too-long)
app/printers/services/output/provider/html.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/services/output/provider/html.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/provider/html.py:10:4: C0116: Missing function or method docstring (missing-function-docstring)
app/printers/services/output/provider/html.py:26:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/provider/html.py:32:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/provider/html.py:38:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.printers.services.output.provider.encrypted
app/printers/services/output/provider/encrypted.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/services/output/provider/encrypted.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/provider/encrypted.py:7:0: R0903: Too few public methods (1/2) (too-few-public-methods)
************* Module app.printers.services.output.provider.pdf
app/printers/services/output/provider/pdf.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/printers/services/output/provider/pdf.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/printers/services/output/provider/pdf.py:7:0: R0903: Too few public methods (1/2) (too-few-public-methods)
************* Module app.authentication.tasks
app/authentication/tasks.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/tasks.py:12:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/tasks.py:12:0: W0223: Method 'run' is abstract in class 'Task' but is not overridden (abstract-method)
app/authentication/tasks.py:19:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tasks.py:19:20: W0613: Unused argument 'self' (unused-argument)
app/authentication/tasks.py:29:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tasks.py:31:4: E1205: Too many arguments for logging format string (logging-too-many-args)
************* Module app.authentication.models
app/authentication/models.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/models.py:6:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/models.py:8:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/models.py:21:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/models.py:29:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/models.py:41:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/models.py:42:15: E1101: Instance of 'User' has no 'articles' member (no-member)
app/authentication/models.py:45:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/models.py:46:15: E1101: Instance of 'User' has no 'articles' member (no-member)
app/authentication/models.py:48:4: C0115: Missing class docstring (missing-class-docstring)
app/authentication/models.py:48:4: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module app.authentication.loaders
app/authentication/loaders.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/loaders.py:8:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/loaders.py:10:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/loaders.py:10:4: E0202: An attribute defined in promise.dataloader line 56 hides this method (method-hidden)
************* Module app.authentication.types
app/authentication/types.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/types.py:12:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/types.py:13:4: C0115: Missing class docstring (missing-class-docstring)
app/authentication/types.py:13:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/authentication/types.py:43:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/types.py:44:15: E1101: Instance of 'UserType' has no 'get_article_count' member (no-member)
app/authentication/types.py:43:42: W0613: Unused argument 'info' (unused-argument)
app/authentication/types.py:46:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/types.py:49:12: E1101: Instance of 'UserType' has no 'get_articles_queryset' member (no-member)
app/authentication/types.py:46:45: W0613: Unused argument 'info' (unused-argument)
app/authentication/types.py:52:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/types.py:53:15: E1101: Instance of 'UserType' has no 'articles' member (no-member)
app/authentication/types.py:52:44: W0613: Unused argument 'info' (unused-argument)
app/authentication/types.py:55:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/types.py:58:8: C0415: Import outside toplevel (app.articles.loaders.ArticleLoader) (import-outside-toplevel)
app/authentication/types.py:60:35: E1101: Instance of 'UserType' has no 'get_articles_queryset' member (no-member)
app/authentication/types.py:55:51: W0613: Unused argument 'info' (unused-argument)
************* Module app.authentication.admin
app/authentication/admin.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module app.authentication.queries
app/authentication/queries.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/queries.py:5:0: E0611: No name 'DjangoFilterConnectionFieldSomething' in module 'graphene_django.filter' (no-name-in-module)
app/authentication/queries.py:13:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/queries.py:19:12: E0602: Undefined variable 'DjangoFilterConnectionField' (undefined-variable)
app/authentication/queries.py:21:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/queries.py:23:12: W0122: Use of exec (exec-used)
app/authentication/queries.py:25:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
app/authentication/queries.py:25:31: C0103: Variable name "f" doesn't conform to snake_case naming style (invalid-name)
app/authentication/queries.py:31:15: E1101: Class 'User' has no 'DoesNotExist' member (no-member)
app/authentication/queries.py:21:27: W0613: Unused argument 'info' (unused-argument)
app/authentication/queries.py:5:0: W0611: Unused DjangoFilterConnectionFieldSomething imported from graphene_django.filter (unused-import)
************* Module app.authentication.views
app/authentication/views.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/views.py:7:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/views.py:8:4: C0115: Missing class docstring (missing-class-docstring)
app/authentication/views.py:8:4: R0903: Too few public methods (0/2) (too-few-public-methods)
app/authentication/views.py:13:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.authentication.migrations.0001_initial
app/authentication/migrations/0001_initial.py:18:0: C0301: Line too long (114/100) (line-too-long)
app/authentication/migrations/0001_initial.py:20:0: C0301: Line too long (103/100) (line-too-long)
app/authentication/migrations/0001_initial.py:21:0: C0301: Line too long (196/100) (line-too-long)
app/authentication/migrations/0001_initial.py:26:0: C0301: Line too long (266/100) (line-too-long)
app/authentication/migrations/0001_initial.py:27:0: C0301: Line too long (229/100) (line-too-long)
app/authentication/migrations/0001_initial.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/migrations/0001_initial.py:1:0: C0103: Module name "0001_initial" doesn't conform to snake_case naming style (invalid-name)
app/authentication/migrations/0001_initial.py:6:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.authentication.migrations.0002_auto_20220910_1134
app/authentication/migrations/0002_auto_20220910_1134.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/migrations/0002_auto_20220910_1134.py:1:0: C0103: Module name "0002_auto_20220910_1134" doesn't conform to snake_case naming style (invalid-name)
app/authentication/migrations/0002_auto_20220910_1134.py:6:0: C0115: Missing class docstring (missing-class-docstring)
************* Module app.authentication.tests.test_users
app/authentication/tests/test_users.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/tests/test_users.py:17:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:17:17: W0613: Unused argument 'module' (unused-argument)
app/authentication/tests/test_users.py:21:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:21:20: W0613: Unused argument 'module' (unused-argument)
app/authentication/tests/test_users.py:25:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:25:19: W0613: Unused argument 'function' (unused-argument)
app/authentication/tests/test_users.py:29:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:29:22: W0613: Unused argument 'function' (unused-argument)
app/authentication/tests/test_users.py:34:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:36:8: W0613: Unused argument 'create_random_users' (unused-argument)
app/authentication/tests/test_users.py:37:8: W0613: Unused argument 'create_superuser' (unused-argument)
app/authentication/tests/test_users.py:72:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:80:8: C0103: Variable name "r" doesn't conform to snake_case naming style (invalid-name)
app/authentication/tests/test_users.py:74:8: W0613: Unused argument 'create_random_users' (unused-argument)
app/authentication/tests/test_users.py:85:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:102:4: E1129: Context manager 'NoneType' doesn't implement __enter__ and __exit__. (not-context-manager)
app/authentication/tests/test_users.py:106:4: E1129: Context manager 'NoneType' doesn't implement __enter__ and __exit__. (not-context-manager)
app/authentication/tests/test_users.py:86:8: W0613: Unused argument 'create_random_users' (unused-argument)
app/authentication/tests/test_users.py:87:8: W0613: Unused argument 'create_random_articles_with_random_users' (unused-argument)
app/authentication/tests/test_users.py:99:4: W0612: Unused variable 'user_count' (unused-variable)
app/authentication/tests/test_users.py:100:4: W0612: Unused variable 'user_count_2' (unused-variable)
app/authentication/tests/test_users.py:104:12: W0612: Unused variable 'user' (unused-variable)
app/authentication/tests/test_users.py:116:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:146:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:147:4: C0103: Variable name "a" doesn't conform to snake_case naming style (invalid-name)
app/authentication/tests/test_users.py:148:4: C0103: Variable name "b" doesn't conform to snake_case naming style (invalid-name)
app/authentication/tests/test_users.py:154:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:155:4: C0103: Variable name "a" doesn't conform to snake_case naming style (invalid-name)
app/authentication/tests/test_users.py:156:4: C0103: Variable name "b" doesn't conform to snake_case naming style (invalid-name)
app/authentication/tests/test_users.py:163:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:168:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:173:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:174:8: W0613: Unused argument 'create_random_users' (unused-argument)
app/authentication/tests/test_users.py:184:0: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_users.py:185:8: W0613: Unused argument 'create_random_users' (unused-argument)
************* Module app.authentication.tests.test_classuers
app/authentication/tests/test_classuers.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/tests/test_classuers.py:10:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/tests/test_classuers.py:14:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_classuers.py:18:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_classuers.py:21:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_classuers.py:21:27: W0613: Unused argument 'method' (unused-argument)
app/authentication/tests/test_classuers.py:25:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_classuers.py:25:30: W0613: Unused argument 'method' (unused-argument)
app/authentication/tests/test_classuers.py:28:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_classuers.py:32:4: C0116: Missing function or method docstring (missing-function-docstring)
app/authentication/tests/test_classuers.py:32:24: W0613: Unused argument 'create_random_users' (unused-argument)
app/authentication/tests/test_classuers.py:36:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module app.authentication.management.commands.create_random_user
app/authentication/management/commands/create_random_user.py:1:0: C0114: Missing module docstring (missing-module-docstring)
app/authentication/management/commands/create_random_user.py:11:0: C0115: Missing class docstring (missing-class-docstring)
app/authentication/management/commands/create_random_user.py:30:19: E1101: Class 'User' has no 'DoesNotExist' member (no-member)
************* Module app.authentication.management.commands.__init__
app/authentication/management/commands/__init__.py:1:0: R0801: Similar lines in 2 files
==app.articles.management.commands.create_random_article:[25:32]
==app.articles.tests.test_articles:[31:38]
        Article.objects.bulk_create(
            [
                Article(
                    title=fake.paragraph(nb_sentences=1),
                    content=fake.paragraph(nb_sentences=3),
                    creator=users[random.randint(0, users_size - 1)]
                ) (duplicate-code)
app/authentication/management/commands/__init__.py:1:0: R0801: Similar lines in 2 files
==app.articles.management.commands.create_random_article:[8:21]
==app.authentication.management.commands.create_random_user:[6:19]
fake = Faker()
Faker.seed(0)


class Command(BaseCommand):
    help = 'Create random articles'

    def add_arguments(self, parser):
        parser.add_argument('create_size', type=int)

    def handle(self, *args, **options):
        create_size = options.get('create_size', 10)
 (duplicate-code)
app/authentication/management/commands/__init__.py:1:0: R0801: Similar lines in 2 files
==app.articles.migrations.0001_initial:[6:15]
==app.stocks.migrations.0001_initial:[5:14]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel( (duplicate-code)
app/authentication/management/commands/__init__.py:1:0: R0801: Similar lines in 2 files
==app.authentication.management.commands.create_random_user:[10:20]
==app.printers.management.commands.create_random_outbound_stocks:[8:18]
class Command(BaseCommand):
    help = 'Create random articles'

    def add_arguments(self, parser):
        parser.add_argument('create_size', type=int)

    def handle(self, *args, **options):
        create_size = options.get('create_size', 10)

        for _ in range(create_size): (duplicate-code)

-----------------------------------
Your code has been rated at 2.84/10

bandit

실행
# file output (-r 경로)
bandit -r app -f csv -o results.csv 

# console
bandit -r app 
결과
[main]  INFO    profile include tests: None
[main]  INFO    profile exclude tests: None
[main]  INFO    cli include tests: None
[main]  INFO    cli exclude tests: None
[main]  INFO    running on Python 3.8.9
76 [0.. 50.. ]
Run started:2022-09-29 06:39:31.662855

Test results:
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   Location: app/articles/management/commands/create_random_article.py:31:34
   More Info: https://bandit.readthedocs.io/en/1.7.4/blacklists/blacklist_calls.html#b311-random
30                          content=fake.paragraph(nb_sentences=3),
31                          creator=users[random.randint(0, users_size - 1)]
32                      )

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   Location: app/articles/tests/test_articles.py:37:30
   More Info: https://bandit.readthedocs.io/en/1.7.4/blacklists/blacklist_calls.html#b311-random
36                      content=fake.paragraph(nb_sentences=3),
37                      creator=users[random.randint(0, users_size - 1)]
38                  )

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/articles/tests/test_articles.py:99:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
98          print(is_healthy)
99          assert is_healthy, "Naver Request 실패"
100     

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/articles/tests/test_articles.py:115:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
114         print(is_healthy)
115         assert not is_healthy, "Naver Request는 404 에러가 발생해야 한다."

--------------------------------------------------
>> Issue: [B102:exec_used] Use of exec detected.
   Severity: Medium   Confidence: High
   CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
   Location: app/authentication/queries.py:23:12
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b102_exec_used.html
22              try:
23                  exec("python")
24      

--------------------------------------------------
>> Issue: [B606:start_process_with_no_shell] Starting a process without a shell.
   Severity: Low   Confidence: Medium
   CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
   Location: app/authentication/queries.py:26:16
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b606_start_process_with_no_shell.html
25                  with open("db") as f:
26                      os.execl(f, ())
27      

--------------------------------------------------
>> Issue: [B606:start_process_with_no_shell] Starting a process without a shell.
   Severity: Low   Confidence: Medium
   CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
   Location: app/authentication/queries.py:28:12
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b606_start_process_with_no_shell.html
27      
28                  os.execv("123123", ())
29      

--------------------------------------------------
>> Issue: [B607:start_process_with_partial_path] Starting a process with a partial executable path
   Severity: Low   Confidence: High
   CWE: CWE-78 (https://cwe.mitre.org/data/definitions/78.html)
   Location: app/authentication/queries.py:28:12
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b607_start_process_with_partial_path.html
27      
28                  os.execv("123123", ())
29      

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/authentication/tests/test_users.py:79:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
78          # then
79          assert response.status_code == status.HTTP_200_OK, "200 성공이여야 한다."
80          for r in response.json():

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/authentication/tests/test_users.py:138:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
137         # then
138         assert result.get('data'), "Success Case 이므로 성공적으로 data를 가져와야 한다."
139         assert not result.get('errors'), "Success Case 이므로 errors 는 발생하지 않아야 한다."

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/authentication/tests/test_users.py:139:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
138         assert result.get('data'), "Success Case 이므로 성공적으로 data를 가져와야 한다."
139         assert not result.get('errors'), "Success Case 이므로 errors 는 발생하지 않아야 한다."
140     
141         data = result.get('data').popitem()

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/authentication/tests/test_users.py:142:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
141         data = result.get('data').popitem()
142         assert not data[1].get('is_duplicate'), "유저 생겅 Validate 규칙을 통해 중복은 발생해야 하지 않는다."
143     

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/authentication/tests/test_users.py:180:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
179         # then
180         assert True
181     

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/authentication/tests/test_users.py:191:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
190         # then
191         assert True

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   Location: app/printers/management/commands/create_random_outbound_stocks.py:22:19
   More Info: https://bandit.readthedocs.io/en/1.7.4/blacklists/blacklist_calls.html#b311-random
21      
22                  rand = random.randint(0, 1)
23                  if rand:

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   Location: app/printers/models.py:38:31
   More Info: https://bandit.readthedocs.io/en/1.7.4/blacklists/blacklist_calls.html#b311-random
37              if transfer_company is None:
38                  transfer_company = random.choice(list(TransferCompany)).value
39              fake_code = f"{fake.ean(length=8)}{random.randint(1000, 9999)}"

--------------------------------------------------
>> Issue: [B311:blacklist] Standard pseudo-random generators are not suitable for security/cryptographic purposes.
   Severity: Low   Confidence: High
   CWE: CWE-330 (https://cwe.mitre.org/data/definitions/330.html)
   Location: app/printers/models.py:39:43
   More Info: https://bandit.readthedocs.io/en/1.7.4/blacklists/blacklist_calls.html#b311-random
38                  transfer_company = random.choice(list(TransferCompany)).value
39              fake_code = f"{fake.ean(length=8)}{random.randint(1000, 9999)}"
40      

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/printers/services/output/factory.py:20:4
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
19      
20          assert factory, "factory is not set"
21          return factory

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/printers/services/output/provider/encrypted.py:11:8
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
10          def get_output(self, stock: OutboundStock) -> Union[str, dict]:
11              assert stock.last_encrypted_invoice, "outbound_encrypted_invoice 필요"
12      
13              return {

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/printers/services/output/provider/html.py:14:8
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
13          def get_output(self, stock: OutboundStock) -> Union[str, dict]:
14              assert stock.last_invoice, "need outbound_invoice"
15      
16              return f"""

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/printers/services/output/provider/html.py:42:8
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
41          def diff_get_output(self, stock: OutboundStock) -> Union[str, dict]:
42              assert stock.last_invoice, "need outbound_invoice"
43      
44              if not self.is_valid_customer_pin_number(stock.last_invoice.invoice_no):

--------------------------------------------------
>> Issue: [B101:assert_used] Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
   Severity: Low   Confidence: High
   CWE: CWE-703 (https://cwe.mitre.org/data/definitions/703.html)
   Location: app/printers/services/output/provider/pdf.py:11:8
   More Info: https://bandit.readthedocs.io/en/1.7.4/plugins/b101_assert_used.html
10          def get_output(self, stock: OutboundStock) -> Union[str, dict]:
11              assert stock.last_invoice, "need outbound_invoice"
12      
13              return f"{self.pdf_url}{stock.last_invoice.invoice_no}"

--------------------------------------------------

Code scanned:
        Total lines of code: 1318
        Total lines skipped (#nosec): 0

Run metrics:
        Total issues (by severity):
                Undefined: 0
                Low: 21
                Medium: 1
                High: 0
        Total issues (by confidence):
                Undefined: 0
                Low: 0
                Medium: 2
                High: 20
Files skipped (1):
        app/authentication/apps.py (syntax error while parsing AST from file)
728x90
반응형