Total Complexity | 0 |
Total Lines | 18 |
Duplicated Lines | 55.56 % |
Changes | 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 |
||
2 | import time |
||
3 | |||
4 | from . import CommandLineArgumentsHandling as ClassCLAH |
||
5 | from datetime import timedelta |
||
6 | |||
7 | |||
8 | View Code Duplication | if __name__ == '__main__': |
|
|
|||
9 | # marking the start of performance measuring (in nanoseconds) |
||
10 | performance_start = time.perf_counter_ns() |
||
11 | ClassCLAH.fn_command_line_argument_interpretation(ClassCLAH, sys.argv[1:]) |
||
12 | # marking the end of performance measuring (in nanoseconds) |
||
13 | performance_finish = time.perf_counter_ns() |
||
14 | # calculate time spent on execution |
||
15 | performance_timed = timedelta(microseconds = (performance_finish - performance_start) / 1000) |
||
16 | # display time spent on execution |
||
17 | print("This script has been executed in " + format(performance_timed) + ' seconds') |
||
18 |