| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 100 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | import sys |
||
| 6 | View Code Duplication | class VerifyGrahamCluster(VerifySlurmCluster): |
|
|
|
|||
| 7 | |||
| 8 | WALLTIME = 60 |
||
| 9 | CORES_PER_NODE = 32 |
||
| 10 | GPUS_PER_NODE = 2 |
||
| 11 | |||
| 12 | def get_arguments(self, **kwargs): |
||
| 13 | |||
| 14 | kwargs = super(VerifyGrahamCluster, self).get_arguments(**kwargs) |
||
| 15 | |||
| 16 | if kwargs["gpusPerCommand"] == 0: |
||
| 17 | account = os.environ.get("CPU_SLURM_ACCOUNT") |
||
| 18 | else: |
||
| 19 | account = os.environ.get("GPU_SLURM_ACCOUNT") |
||
| 20 | |||
| 21 | if "sbatchFlags" not in kwargs or len(kwargs["sbatchFlags"]) == 0: |
||
| 22 | kwargs["sbatchFlags"] = "--account=" + account |
||
| 23 | else: |
||
| 24 | kwargs["sbatchFlags"] += " --account=" + account |
||
| 25 | |||
| 26 | return kwargs |
||
| 27 | |||
| 34 |