adding code enhancements to helper.py file #1218
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When adding some code enhancements, mainly changing .format expressions to f-string expressions, and making long lines into two shorter lines of code, I was able to increase the code quality from 6.29 to 7.21:
************* Module helper
installer\helper.py:49:56: C0303: Trailing whitespace (trailing-whitespace)
installer\helper.py:124:0: C0303: Trailing whitespace (trailing-whitespace)
installer\helper.py:163:61: C0303: Trailing whitespace (trailing-whitespace)
installer\helper.py:1:0: C0114: Missing module docstring (missing-module-docstring)
installer\helper.py:17:4: W0622: Redefining built-in 'input' (redefined-builtin)
installer\helper.py:22:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:27:0: C0103: Constant name "debug_log" doesn't conform to UPPER_CASE naming style (invalid-name)
installer\helper.py:30:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:31:4: W0603: Using the global statement (global-statement)
installer\helper.py:32:16: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
installer\helper.py:36:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:40:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:57:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:61:11: W0718: Catching too general exception Exception (broad-exception-caught)
installer\helper.py:70:15: W0718: Catching too general exception BaseException (broad-exception-caught)
installer\helper.py:75:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:80:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:81:13: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
installer\helper.py:81:32: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
installer\helper.py:84:0: C0103: Constant name "spinning" doesn't conform to UPPER_CASE naming style (invalid-name)
installer\helper.py:87:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:88:4: W0603: Using the global statement (global-statement)
installer\helper.py:103:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:104:4: W0603: Using the global statement (global-statement)
installer\helper.py:108:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:121:11: R1716: Simplify chained comparison between the operands (chained-comparison)
installer\helper.py:127:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:131:19: R1719: The if expression can be replaced with 'test' (simplifiable-if-expression)
installer\helper.py:135:0: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:136:4: C0115: Missing class docstring (missing-class-docstring)
installer\helper.py:137:8: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:140:8: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:167:8: W0201: Attribute 'exception' defined outside init (attribute-defined-outside-init)
installer\helper.py:175:4: W0201: Attribute 'cli_output' defined outside init (attribute-defined-outside-init)
installer\helper.py:145:4: C0115: Missing class docstring (missing-class-docstring)
installer\helper.py:146:8: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:149:8: C0116: Missing function or method docstring (missing-function-docstring)
installer\helper.py:175:4: W0201: Attribute 'cli_output' defined outside init (attribute-defined-outside-init)
installer\helper.py:8:0: W0611: Unused IS_WIN imported from unix_windows (unused-import)
Your code has been rated at 7.21/10 (previous run: 7.14/10, +0.07)