728x90
1. Lint Tool for Refactoring
요새 코딩할 일이 많아 함수를 열심히 만들고 있는데,
완성하고 나면 왜 이렇게 지저분해 보이는지.. 아놔!
리팩토링을 습관 들여야겠다 생각하고 툴을 찾아보았는데,
자동 리팩토링은 안 되지만 상세하게 어디에 문제가 있는지 알려주는 lint tool이 있다 하여 바로 설치했다.
"pylint"
(맨 끝에 모듈의 점수도 매겨준다ㅋㅋㅋㅋ "Your code has been rated at 4.29/10")
라인이 너무 길다는 피드백이 많고, 이외에는
candles.py:193:0: C0304: Final newline missing (missing-final-newline)
candles.py:1:0: C0114: Missing module docstring (missing-module-docstring)
candles.py:9:0: C0103: Function name "candleInquiry" doesn't conform to snake_case naming style (invalid-name)
candles.py:9:0: R0914: Too many local variables (31/15) (too-many-locals)
candles.py:150:16: W0622: Redefining built-in 'open' (redefined-builtin)
candles.py:37:12: C0103: Variable name "l" doesn't conform to snake_case naming style (invalid-name) candles.py:39:12: C0103: Variable name "API_request_limit_cnt" doesn't conform to snake_case naming style (invalid-name)
candles.py:52:23: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
candles.py:55:12: R1723: Unnecessary "else" after "break", remove the "else" and de-indent the code inside it (no-else-break)
candles.py:69:12: C0103: Variable name "API_request_limit_cnt" doesn't conform to snake_case naming style (invalid-name)
candles.py:99:12: C0103: Variable name "l" doesn't conform to snake_case naming style (invalid-name) candles.py:101:12: C0103: Variable name "API_request_limit_cnt" doesn't conform to snake_case naming style (invalid-name)
candles.py:109:23: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
candles.py:112:12: R1723: Unnecessary "else" after "break", remove the "else" and de-indent the code inside it (no-else-break)
candles.py:126:12: C0103: Variable name "API_request_limit_cnt" doesn't conform to snake_case naming style (invalid-name)
candles.py:133:25: C0321: More than one statement on a single line (multiple-statements)
candles.py:9:0: R0912: Too many branches (34/12) (too-many-branches)
candles.py:9:0: R0915: Too many statements (101/50) (too-many-statements)
candles.py:2:0: C0411: standard import "import json" should be placed before "import requests" (wrong-import-order) candles.py:3:0: C0411: standard import "from datetime import datetime" should be placed before "import requests" (wrong-import-order)
candles.py:5:0: C0411: standard import "import time" should be placed before "import requests" (wrong-import-order)
클린 코드 가보자고~
728x90