argo0n / NograBot

Discord.py bot written by Argon#0002
GNU General Public License v3.0
2 stars 1 forks source link

(PYL-R1705) Unnecessary `else` / `elif` used after `return` #79

Closed argo0n closed 3 years ago

argo0n commented 3 years ago

Description

return statement causes the control flow to be disrupted, making the else / elif block here unnecessary. This doesn't mean you can not use it, but it is recommended to refactor this for a better readability. Bad: ```python def classify_number(x): if x % 2 == 0: return 'Even' else: return …

Occurrences

There are 26 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/argo0n/NograBot/issue/PYL-R1705/occurrences/

argo0n commented 3 years ago

Fixed in commit 01b6dd27db93b96fd99c6ade6e76f5bbc90e8a87