Closes SW-824
Merge request reports
Activity
- LCS/PyCommon/cep4_utils.py 100644 → 100755
99 99 dockerized_cmd += cmd 100 100 return dockerized_cmd 101 101 102 def get_cep4_available_cpu_nodes(): 102 def get_cep4_available_cpu_nodes(include_allocated_nodes=False): Here you introduce a so-called Flag Argument. This allows this function to show two different behaviors. This would be a violation of the Single Responsibility Principle (SRP). From a readability point this is less of a problem when you always use this function with a named argument. It is then clear that you either include or not include the allocated nodes. But this requires discipline that is not checked by tools. So it will be forgotten and that would make the a little bit less readable.
If you have two functions that clearly state what it does, and with a refactoring extract the common code out to a function that then accepts the specific part as argument (list of node states) you have the responsibilities nicely separated.
changed this line in version 2 of the diff
added process_review label
added 1 commit
mentioned in commit 8e4a7559