Code Duplication    Length = 10-10 lines in 4 locations

application/modules/comments/comments.php 1 location

@@ 263-272 (lines=10) @@
260
        }
261
        //}
262
263
        if (is_array($comments)) {
264
            $i = 0;
265
            foreach ($comments as $comment) {
266
                if ($comment['parent'] > 0) {
267
                    $comment_ch[] = $comment;
268
                    unset($comments[$i]);
269
                }
270
                $i++;
271
            }
272
        }
273
        //        $this->load->library('pagination');
274
        //
275
        //        $config['base_url'] = '';

application/modules/comments/commentsapi.php 3 locations

@@ 50-59 (lines=10) @@
47
48
        $comment_ch = [];
49
50
        if (is_array($comments)) {
51
            $i = 0;
52
            foreach ($comments as $comment) {
53
                if ($comment['parent'] > 0) {
54
                    $comment_ch[] = $comment;
55
                    unset($comments[$i]);
56
                }
57
                $i++;
58
            }
59
        }
60
61
        $data = [
62
                 'comments_arr'       => $comments,
@@ 107-116 (lines=10) @@
104
105
        $comment_ch = [];
106
107
        if (is_array($comments)) {
108
            $i = 0;
109
            foreach ($comments as $comment) {
110
                if ($comment['parent'] > 0) {
111
                    $comment_ch[] = $comment;
112
                    unset($comments[$i]);
113
                }
114
                $i++;
115
            }
116
        }
117
118
        $data = [
119
                 'comments_arr'       => $comments,
@@ 168-177 (lines=10) @@
165
            $comments_count = 0;
166
        }
167
168
        if (is_array($comments)) {
169
            $i = 0;
170
            foreach ($comments as $comment) {
171
                if ($comment['parent'] > 0) {
172
                    $comment_ch[] = $comment;
173
                    unset($comments[$i]);
174
                }
175
                $i++;
176
            }
177
        }
178
179
        $data = [
180
                 'comments_arr'       => $comments,