Code Duplication    Length = 13-13 lines in 2 locations

application/modules/cfcm/cfcm.php 2 locations

@@ 119-131 (lines=13) @@
116
                $form_fields = [];
117
                $fields = $query->result_array();
118
119
                foreach ($fields as $field) {
120
                    $f_data = unserialize($field['data']);
121
                    if ($f_data == false) {
122
                        $f_data = [];
123
                    }
124
125
                    $form_fields[$field['field_name']] = [
126
                                                          'type'  => $field['type'],
127
                                                          'label' => encode($field['label']),
128
                                                         ];
129
130
                    $form_fields[$field['field_name']] = array_merge($form_fields[$field['field_name']], $f_data);
131
                }
132
133
                $form = $this->forms->add_fields($form_fields);
134
@@ 226-238 (lines=13) @@
223
            $form_fields = [];
224
            $fields = $query->result_array();
225
226
            foreach ($fields as $field) {
227
                $f_data = unserialize($field['data']);
228
                if ($f_data == false) {
229
                    $f_data = [];
230
                }
231
232
                $form_fields[$field['field_name']] = [
233
                                                      'type'  => $field['type'],
234
                                                      'label' => $field['label'],
235
                                                     ];
236
237
                $form_fields[$field['field_name']] = array_merge($form_fields[$field['field_name']], $f_data);
238
            }
239
240
            return $form_fields;
241
        } else {