| Total Complexity | 2 |
| Total Lines | 35 |
| Duplicated Lines | 74.29 % |
| Coverage | 0% |
| 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 | from cleo import Application |
||
| 2 | |||
| 3 | from sdoc.command.SDoc1Command import SDoc1Command |
||
| 4 | from sdoc.command.SDoc2Command import SDoc2Command |
||
| 5 | from sdoc.command.SDocCommand import SDocCommand |
||
| 6 | |||
| 7 | |||
| 8 | # ---------------------------------------------------------------------------------------------------------------------- |
||
| 9 | View Code Duplication | class SDocApplication(Application): |
|
|
|
|||
| 10 | """ |
||
| 11 | The SDocApplication application. |
||
| 12 | """ |
||
| 13 | |||
| 14 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 15 | def __init__(self): |
||
| 16 | """ |
||
| 17 | Object constructor. |
||
| 18 | """ |
||
| 19 | Application.__init__(self, 'SDocApplication', '0.0.11') |
||
| 20 | |||
| 21 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 22 | def get_default_commands(self): |
||
| 23 | """ |
||
| 24 | Returns the default commands of this application. |
||
| 25 | |||
| 26 | :rtype: list[cleo.Command] |
||
| 27 | """ |
||
| 28 | commands = Application.get_default_commands(self) |
||
| 29 | |||
| 30 | self.add(SDocCommand()) |
||
| 31 | self.add(SDoc1Command()) |
||
| 32 | self.add(SDoc2Command()) |
||
| 33 | |||
| 34 | return commands |
||
| 35 | |||
| 37 |