Reduce complexity of route_method_exception
Split the code from route_method_exception into two separate functions and remove the noqa: C901.
Describe alternatives you've considered Simplify the function such that no split is required.
Additional context Code quality:
2020-04-29T13:13:32.5920184Z ./syft/exceptions.py:359:1: C901 'route_method_exception' is too complex (14)
2020-04-29T13:13:32.5920476Z def route_method_exception(exception, self, args_, kwargs_):
2020-04-29T13:13:32.5920733Z ^
hey , can i work on this issue?
Is the issue still open?I would like to work on it? @gmuraru
Hey. If the issue is still present, you can grab it :D
Can you guide through how to produce the bug?
This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the stale label to unmark it. Otherwise, this will be closed in 7 days.
@gmuraru sir, I tried to solve the mentioned problem
2020-04-29T13:13:32.5920184Z ./syft/exceptions.py:359:1: C901 'route_method_exception' is too complex (14)
2020-04-29T13:13:32.5920476Z def route_method_exception(exception, self, args_, kwargs_):
2020-04-29T13:13:32.5920733Z ^
But, instead of converting route_method_exception to two separate methods I just reduced the if...elif statements.
And it seems to work properly, it shows positive results in both Flake8 test(after removing C901) and pytest.
Will this change work instead of separating the method?
@gmuraru sir, I tried to solve the mentioned problem
2020-04-29T13:13:32.5920184Z ./syft/exceptions.py:359:1: C901 'route_method_exception' is too complex (14) 2020-04-29T13:13:32.5920476Z def route_method_exception(exception, self, args_, kwargs_): 2020-04-29T13:13:32.5920733Z ^But, instead of converting
route_method_exceptionto two separate methods I just reduced theif...elifstatements. And it seems to work properly, it shows positive results in both Flake8 test(after removing C901) and pytest.Will this change work instead of separating the method?
Sure!