Conditions | 4 |
Paths | 3 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
22 | public function init() |
||
23 | { |
||
24 | parent::init(); |
||
25 | if ($this->inView and is_array($this->watchers)) { |
||
26 | echo Html::beginTag('ul', ['class' => 'list-unstyled']); |
||
27 | foreach ($this->watchers as $uid => $username) { |
||
28 | echo Html::beginTag('li'); |
||
29 | echo Html::a($username, ['/client/client/view', 'id' => $uid]); |
||
30 | echo Html::endTag('li'); |
||
31 | } |
||
32 | echo Html::endTag('ul'); |
||
33 | } |
||
34 | } |
||
35 | |||
44 |
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.