Code Duplication    Length = 12-12 lines in 2 locations

src/dbo/groups.php 1 location

@@ 491-502 (lines=12) @@
488
            $group['description'] = ustrcut($group['description'], MAX_GROUP_DESCRIPTION);
489
490
            // Validate group.
491
            switch (group_validate($group['name']))
492
            {
493
                case NO_ERROR:
494
                    break;  // nop
495
                case ERROR_INCOMPLETE_FORM:
496
                    $error = get_html_resource(RES_ALERT_REQUIRED_ARE_EMPTY_ID);
497
                    return FALSE;
498
                default:
499
                    debug_write_log(DEBUG_WARNING, '[groups_import] Group validation failure.');
500
                    $error = get_html_resource(RES_ALERT_UNKNOWN_ERROR_ID);
501
                    return FALSE;
502
            }
503
504
            // Create group.
505
            group_create($group['type'] == 'global' ? NULL : $project_id,

src/dbo/states.php 1 location

@@ 550-561 (lines=12) @@
547
            $state['abbr'] = ustrcut($state['abbr'], MAX_STATE_ABBR);
548
549
            // Validate state.
550
            switch (state_validate($state['name'], $state['abbr']))
551
            {
552
                case NO_ERROR:
553
                    break;  // nop
554
                case ERROR_INCOMPLETE_FORM:
555
                    $error = get_html_resource(RES_ALERT_REQUIRED_ARE_EMPTY_ID);
556
                    return FALSE;
557
                default:
558
                    debug_write_log(DEBUG_WARNING, '[states_import] State validation failure.');
559
                    $error = get_html_resource(RES_ALERT_UNKNOWN_ERROR_ID);
560
                    return FALSE;
561
            }
562
563
            $type        = strval($state['type']);
564
            $responsible = strval($state['responsible']);