Code Duplication    Length = 11-15 lines in 2 locations

system/modules/Ui/objects/Tree.php 2 locations

@@ 51-61 (lines=11) @@
48
            $items = $class::getList(['where' => ['parent_id', $object->pk()]]);
49
            $count += count($items);
50
            foreach ($items as $objectChild) {
51
                if (!$isset) {
52
                    $isset = true;
53
                    ?>
54
                    <li id='<?= str_replace('\\', '_', get_class($object)) . "-{$object->pk()}"; ?>'>
55
                      <?= $hrefFunc ? $hrefFunc($object) : "<a href='#'> {$object->name()}</a> "; ?>
56
                      <ul>
57
                        <?php
58
                    }
59
                    $count+=static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc);
60
                }
61
            }
62
            if ($isset) {
63
                ?>
64
              </ul>
@@ 62-76 (lines=15) @@
59
                    $count+=static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc);
60
                }
61
            }
62
            if ($isset) {
63
                ?>
64
              </ul>
65
            </li>
66
            <?php
67
        } else {
68
            ?>
69
            <li id='<?= str_replace('\\', '_', get_class($object)) . "-{$object->pk()}"; ?>'>
70
              <?= $hrefFunc ? $hrefFunc($object) : "<a href='#'> {$object->name()}</a> "; ?>
71
            </li>
72
            <?php
73
        }
74
        return $count;
75
    }
76
77
}
78