Introduction
Due to PEP8 [1] either all return statements in a function should return an expression, or none of them should.
# Correct: def bar(x): if x < 0: return None return math.sqrt(x)
# Wrong: def foo(x): if x >= 0: return math.sqrt(x) # implicit returns None here which should be explicit def bar(x): if x < 0: return # implicit returns None here which should be explicit return math.sqrt(x)
What to do
Issues to be solved can be found here:
https://deepsource.io/gh/xqt/pwb/issue/PYL-R1710/occurrences
Fix it by adding consistent return statements.
Please split your patch into smaller parts (no more than 20 methods at once) because it is heave to review a bulk of changed lines.
[1] https://peps.python.org/pep-0008/#programming-recommendations