ballle98 / cec-mqtt-bridge

A HDMI-CEC to MQTT bridge for connecting HDMI-CEC-devices to your Home Automation system.
2 stars 1 forks source link

pylint cleanup #16

Closed ballle98 closed 2 months ago

ballle98 commented 2 months ago
pi@raspberrypi:~/git/cec-mqtt-bridge/src/cec_mqtt_bridge $ pylint *.py
************* Module bridge
bridge.py:54:0: C0301: Line too long (116/100) (line-too-long)
bridge.py:54:0: W0301: Unnecessary semicolon (unnecessary-semicolon)
bridge.py:57:0: C0301: Line too long (114/100) (line-too-long)
bridge.py:63:0: C0301: Line too long (109/100) (line-too-long)
bridge.py:86:0: C0301: Line too long (112/100) (line-too-long)
bridge.py:109:0: W0301: Unnecessary semicolon (unnecessary-semicolon)
bridge.py:148:0: C0301: Line too long (110/100) (line-too-long)
bridge.py:197:0: C0303: Trailing whitespace (trailing-whitespace)
bridge.py:205:0: C0303: Trailing whitespace (trailing-whitespace)
bridge.py:238:0: C0325: Unnecessary parens after 'elif' keyword (superfluous-parens)
bridge.py:242:0: C0303: Trailing whitespace (trailing-whitespace)
bridge.py:258:0: C0303: Trailing whitespace (trailing-whitespace)
bridge.py:260:0: C0303: Trailing whitespace (trailing-whitespace)
bridge.py:1:0: C0114: Missing module docstring (missing-module-docstring)
bridge.py:33:0: C0115: Missing class docstring (missing-class-docstring)
bridge.py:39:12: C0113: Consider changing "not int(self.config['cec']['enabled']) == 1" to "int(self.config['cec']['enabled']) != 1" (unneeded-not)
bridge.py:40:17: C0113: Consider changing "not int(self.config['ir']['enabled']) == 1" to "int(self.config['ir']['enabled']) != 1" (unneeded-not)
bridge.py:69:19: W0703: Catching too general exception Exception (broad-except)
bridge.py:67:12: C0103: Variable name "e" doesn't conform to snake_case naming style (invalid-name)
bridge.py:69:12: C0103: Variable name "e" doesn't conform to snake_case naming style (invalid-name)
bridge.py:113:8: C0103: Variable name "e" doesn't conform to snake_case naming style (invalid-name)
bridge.py:114:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
bridge.py:118:4: C0103: Argument name "rc" doesn't conform to snake_case naming style (invalid-name)
bridge.py:118:4: C0116: Missing function or method docstring (missing-function-docstring)
bridge.py:118:44: W0613: Unused argument 'userdata' (unused-argument)
bridge.py:118:54: W0613: Unused argument 'flags' (unused-argument)
bridge.py:150:4: C0116: Missing function or method docstring (missing-function-docstring)
bridge.py:155:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
bridge.py:150:30: W0613: Unused argument 'client' (unused-argument)
bridge.py:150:44: W0613: Unused argument 'userdata' (unused-argument)
bridge.py:150:4: R0911: Too many return statements (10/6) (too-many-return-statements)
bridge.py:150:4: R0912: Too many branches (19/12) (too-many-branches)
bridge.py:221:0: C0116: Missing function or method docstring (missing-function-docstring)
bridge.py:243:13: W0212: Access to a protected member _load_config of a client class (protected-access)
bridge.py:256:7: R1716: Simplify chained comparison between the operands (chained-comparison)
bridge.py:221:0: R0912: Too many branches (13/12) (too-many-branches)
bridge.py:10:0: C0411: standard import "import argparse" should be placed before "import paho.mqtt.client as mqtt" (wrong-import-order)
************* Module create_lircrc
create_lircrc.py:1:0: C0114: Missing module docstring (missing-module-docstring)
create_lircrc.py:18:0: C0115: Missing class docstring (missing-class-docstring)
create_lircrc.py:18:0: R0205: Class 'Remote' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
create_lircrc.py:23:4: C0116: Missing function or method docstring (missing-function-docstring)
create_lircrc.py:18:0: R0903: Too few public methods (1/2) (too-few-public-methods)
create_lircrc.py:27:0: C0115: Missing class docstring (missing-class-docstring)
create_lircrc.py:27:0: R0205: Class 'Parser' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
create_lircrc.py:58:4: C0116: Missing function or method docstring (missing-function-docstring)
create_lircrc.py:59:8: W0621: Redefining name 'parser' from outer scope (line 80) (redefined-outer-name)
create_lircrc.py:61:36: C0103: Variable name "fn" doesn't conform to snake_case naming style (invalid-name)
create_lircrc.py:68:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module hdmicec
hdmicec.py:42:0: C0303: Trailing whitespace (trailing-whitespace)
hdmicec.py:62:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
hdmicec.py:64:0: C0301: Line too long (102/100) (line-too-long)
hdmicec.py:73:0: C0301: Line too long (126/100) (line-too-long)
hdmicec.py:85:64: C0303: Trailing whitespace (trailing-whitespace)
hdmicec.py:86:79: C0303: Trailing whitespace (trailing-whitespace)
hdmicec.py:91:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
hdmicec.py:94:0: C0301: Line too long (110/100) (line-too-long)
hdmicec.py:97:0: C0301: Line too long (111/100) (line-too-long)
hdmicec.py:224:0: C0301: Line too long (126/100) (line-too-long)
hdmicec.py:249:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
hdmicec.py:256:0: C0303: Trailing whitespace (trailing-whitespace)
hdmicec.py:270:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
hdmicec.py:278:0: C0301: Line too long (110/100) (line-too-long)
hdmicec.py:281:0: C0301: Line too long (108/100) (line-too-long)
hdmicec.py:283:0: C0301: Line too long (112/100) (line-too-long)
hdmicec.py:284:0: C0301: Line too long (107/100) (line-too-long)
hdmicec.py:1:0: C0114: Missing module docstring (missing-module-docstring)
hdmicec.py:22:0: C0115: Missing class docstring (missing-class-docstring)
hdmicec.py:22:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes)
hdmicec.py:52:38: W0621: Redefining name 'time' from outer scope (line 8) (redefined-outer-name)
hdmicec.py:64:12: C0103: Variable name "m" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:52:38: W0613: Unused argument 'time' (unused-argument)
hdmicec.py:96:16: C0103: Variable name "vendorId" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:99:16: C0103: Variable name "physicalAddress" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:178:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
hdmicec.py:196:12: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
hdmicec.py:200:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
hdmicec.py:207:16: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
hdmicec.py:219:4: C0116: Missing function or method docstring (missing-function-docstring)
hdmicec.py:234:8: W1201: Use lazy % formatting in logging functions (logging-not-lazy)
hdmicec.py:248:12: C0103: Variable name "physicalAddress" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:251:16: C0103: Variable name "powerStr" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:263:4: C0116: Missing function or method docstring (missing-function-docstring)
hdmicec.py:269:12: C0103: Variable name "physicalAddress" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:271:16: C0103: Variable name "vendorId" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:272:16: C0103: Variable name "physicalAddress" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:274:16: C0103: Variable name "cecVersion" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:276:16: C0103: Variable name "osdName" doesn't conform to snake_case naming style (invalid-name)
hdmicec.py:4:0: C0411: standard import "import logging" should be placed before "import cec" (wrong-import-order)
hdmicec.py:5:0: C0411: standard import "import math" should be placed before "import cec" (wrong-import-order)
hdmicec.py:6:0: C0411: standard import "import re" should be placed before "import cec" (wrong-import-order)
hdmicec.py:7:0: C0411: standard import "import threading" should be placed before "import cec" (wrong-import-order)
hdmicec.py:8:0: C0411: standard import "import time" should be placed before "import cec" (wrong-import-order)
hdmicec.py:9:0: C0411: standard import "from typing import List" should be placed before "import cec" (wrong-import-order)
************* Module __init__
__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module lirc
lirc.py:36:0: C0301: Line too long (129/100) (line-too-long)
lirc.py:1:0: C0114: Missing module docstring (missing-module-docstring)
lirc.py:7:0: W0406: Module import itself (import-self)
lirc.py:18:0: C0115: Missing class docstring (missing-class-docstring)
lirc.py:31:15: W0703: Catching too general exception Exception (broad-except)
lirc.py:31:8: C0103: Variable name "e" doesn't conform to snake_case naming style (invalid-name)
lirc.py:32:12: E1205: Too many arguments for logging format string (logging-too-many-args)
lirc.py:33:12: R1722: Consider using sys.exit() (consider-using-sys-exit)
lirc.py:35:4: C0116: Missing function or method docstring (missing-function-docstring)
lirc.py:37:20: E1101: Module 'lirc' has no 'RawConnection' member (no-member)
lirc.py:46:19: E1101: Module 'lirc' has no 'TimeoutException' member (no-member)
lirc.py:52:4: C0116: Missing function or method docstring (missing-function-docstring)
lirc.py:54:19: E1101: Module 'lirc' has no 'CommandConnection' member (no-member)
lirc.py:55:16: E1101: Module 'lirc' has no 'SendCommand' member (no-member)
lirc.py:6:0: W0611: Unused import time (unused-import)

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