Code Duplication    Length = 3-3 lines in 2 locations

main/gradebook/lib/GradebookUtils.php 2 locations

@@ 626-628 (lines=3) @@
623
                FROM ' . $table_user . ' u
624
                INNER JOIN ' . $table_certificate . ' gc
625
                ON u.user_id=gc.user_id ';
626
        if (!is_null($cat_id) && $cat_id > 0) {
627
            $sql.=' WHERE cat_id=' . intval($cat_id);
628
        }
629
        if (!empty($userList)) {
630
            $userList = array_map('intval', $userList);
631
            $userListCondition = implode("','", $userList);
@@ 657-659 (lines=3) @@
654
        $sql = 'SELECT gc.score_certificate, gc.created_at, gc.path_certificate, gc.cat_id, gc.user_id, gc.id
655
                FROM  ' . $table_certificate . ' gc
656
                WHERE gc.user_id="' . intval($user_id) . '" ';
657
        if (!is_null($cat_id) && $cat_id > 0) {
658
            $sql.=' AND cat_id=' . intval($cat_id);
659
        }
660
661
        $rs = Database::query($sql);
662
        $list_certificate = array();