Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 9 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
17 | public function testMethodOneTryCatchRule() |
||
18 | { |
||
19 | $output = $this |
||
20 | ->runPhpmd('Utility/TryThings.php', 'cleancode.xml') |
||
21 | ->getOutput(); |
||
22 | |||
23 | $this->assertContains('Utility/TryThings.php:39 This method contains more than one try statement. Swap out the try statement in an extra method. It increase the readability.', $output); |
||
24 | $this->assertContains('Utility/TryThings.php:53 This method contains more than one try statement. Swap out the try statement in an extra method. It increase the readability.', $output); |
||
25 | } |
||
26 | |||
39 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.