There is no 'too deep nesting'

This commit is contained in:
Alexander Hess 2021-09-15 11:49:08 +02:00
parent 5978b0e92f
commit 7e23033d84
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
5 changed files with 27 additions and 25 deletions

View file

@ -93,6 +93,8 @@ extend-ignore =
# until after being processed by Sphinx Napoleon.
# Source: https://github.com/peterjc/flake8-rst-docstrings/issues/17
RST201,RST203,RST210,RST213,RST301,
# The "too deep nesting" violation fires off "too early" and cannot be configured.
WPS220,
# String constant over-use is checked visually by the programmer.
WPS226,
# Modules as a whole are assumed to be not "too complex".

View file

@ -169,15 +169,15 @@ class City(meta.Base):
)
# ... and adjust the size of the red dot on the `.map`.
if n_orders >= 1000:
radius = 20 # noqa:WPS220
radius = 20
elif n_orders >= 500:
radius = 15 # noqa:WPS220
radius = 15
elif n_orders >= 100:
radius = 10 # noqa:WPS220
radius = 10
elif n_orders >= 10:
radius = 5 # noqa:WPS220
radius = 5
else:
radius = 1 # noqa:WPS220
radius = 1
tooltip += f' | n_orders={n_orders}' # noqa:WPS336

View file

@ -90,15 +90,15 @@ class Customer(meta.Base):
.count()
)
if n_orders >= 25:
radius = 20 # noqa:WPS220
radius = 20
elif n_orders >= 10:
radius = 15 # noqa:WPS220
radius = 15
elif n_orders >= 5:
radius = 10 # noqa:WPS220
radius = 10
elif n_orders > 1:
radius = 5 # noqa:WPS220
radius = 5
else:
radius = 1 # noqa:WPS220
radius = 1
address.draw(
radius=radius,
@ -156,15 +156,15 @@ class Customer(meta.Base):
.count()
)
if n_orders >= 25:
radius = 20 # noqa:WPS220
radius = 20
elif n_orders >= 10:
radius = 15 # noqa:WPS220
radius = 15
elif n_orders >= 5:
radius = 10 # noqa:WPS220
radius = 10
elif n_orders > 1:
radius = 5 # noqa:WPS220
radius = 5
else:
radius = 1 # noqa:WPS220
radius = 1
tooltip += f' | n_orders={n_orders}' # noqa:WPS336

View file

@ -226,15 +226,15 @@ class Pixel(meta.Base):
)
# ... and adjust the size of the red dot on the `.map`.
if n_orders >= 1000:
radius = 20 # noqa:WPS220
radius = 20
elif n_orders >= 500:
radius = 15 # noqa:WPS220
radius = 15
elif n_orders >= 100:
radius = 10 # noqa:WPS220
radius = 10
elif n_orders >= 10:
radius = 5 # noqa:WPS220
radius = 5
else:
radius = 1 # noqa:WPS220
radius = 1
tooltip += f' | n_orders={n_orders}' # noqa:WPS336

View file

@ -116,15 +116,15 @@ class Restaurant(meta.Base):
.count()
)
if n_orders >= 25:
radius = 20 # noqa:WPS220
radius = 20
elif n_orders >= 10:
radius = 15 # noqa:WPS220
radius = 15
elif n_orders >= 5:
radius = 10 # noqa:WPS220
radius = 10
elif n_orders > 1:
radius = 5 # noqa:WPS220
radius = 5
else:
radius = 1 # noqa:WPS220
radius = 1
address.draw(
radius=radius,