fossasia/engelsystem

View on GitHub

Showing 271 of 271 total issues

Method Shift_view has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, $user_shift_admin, $admin_rooms, $admin_shifttypes, $user_shifts, $signed_up) {
$parsedown = new Parsedown();
 
$angeltypes = [];
foreach ($angeltypes_source as $angeltype)
Severity: Major
Found in includes/view/Shifts_view.php - About 3 hrs to fix

    Method insert_user has 25 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function insert_user($default_theme, $nick, $prename, $lastname, $age, $tel, $dect, $native_lang, $other_langs, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $current_city, $organization_web, $timezone, $planned_arrival_date) {
    Severity: Major
    Found in includes/model/User_model.php - About 3 hrs to fix

      Method user_myshifts has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function user_myshifts() {
      global $LETZTES_AUSTRAGEN;
      global $user, $privileges;
      $timezone_identifiers = DateTimeZone::listIdentifiers();
      $timezone = $user['timezone'];
      Severity: Major
      Found in includes/controller/user_myshifts_controller.php - About 3 hrs to fix

        Method admin_groups has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function admin_groups() {
        global $user;
         
        $html = "";
        $groups = Groups_by_name();
        Severity: Major
        Found in includes/controller/admin_groups_controller.php - About 3 hrs to fix

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          div('col-md-4', [
          heading(_("Planned arrival statistics"), 2),
          bargraph('planned_arrives', 'day', [
          'count' => _("arrived"),
          'sum' => _("arrived sum")
          Severity: Major
          Found in includes/controller/admin_arrive_controller.php and 2 other locations - About 3 hrs to fix
          includes/controller/admin_arrive_controller.php on lines 159..173
          includes/controller/admin_arrive_controller.php on lines 174..188

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          div('col-md-4', [
          heading(_("Planned departure statistics"), 2),
          bargraph('planned_departures', 'day', [
          'count' => _("arrived"),
          'sum' => _("arrived sum")
          Severity: Major
          Found in includes/controller/admin_arrive_controller.php and 2 other locations - About 3 hrs to fix
          includes/controller/admin_arrive_controller.php on lines 144..158
          includes/controller/admin_arrive_controller.php on lines 159..173

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          div('col-md-4', [
          heading(_("Arrival statistics"), 2),
          bargraph('arrives', 'day', [
          'count' => _("arrived"),
          'sum' => _("arrived sum")
          Severity: Major
          Found in includes/controller/admin_arrive_controller.php and 2 other locations - About 3 hrs to fix
          includes/controller/admin_arrive_controller.php on lines 144..158
          includes/controller/admin_arrive_controller.php on lines 174..188

          Method user_angeltype_add_controller has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function user_angeltype_add_controller() {
          global $user, $privileges;
           
          if (! isset($_REQUEST['angeltype_id'])) {
          error(_("Angeltype doesn't exist."));
          Severity: Major
          Found in includes/controller/user_angeltypes_controller.php - About 3 hrs to fix

            Method Users_view has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function Users_view($users, $order_by, $arrived_count, $active_count, $force_active_count, $freeloads_count, $tshirts_count, $voucher_count) {
            $search = "";
            $users_matched = [];
            if (isset($_REQUEST['search']))
            $search = strip_request_item('search');
            Severity: Major
            Found in includes/view/User_view.php - About 2 hrs to fix

              Method admin_free has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function admin_free() {
              global $privileges;
               
              $search = "";
              if (isset($_REQUEST['search']))
              Severity: Major
              Found in includes/controller/admin_free_controller.php - About 2 hrs to fix

                Method user_driver_license_edit_controller has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function user_driver_license_edit_controller() {
                global $privileges, $user;
                 
                if (isset($_REQUEST['user_id'])) {
                $user_source = User($_REQUEST['user_id']);
                Severity: Major
                Found in includes/controller/user_driver_licenses_controller.php - About 2 hrs to fix

                  Function Shift_signup_allowed has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function Shift_signup_allowed($shift, $angeltype, $user_angeltype = null, $user_shifts = null) {
                  global $user, $privileges;
                   
                  if ($user_shifts == null) {
                  $user_shifts = Shifts_by_user($user);
                  Severity: Minor
                  Found in includes/model/Shifts_model.php - About 2 hrs to fix

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  foreach ($types as $type) {
                  if (isset($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
                  $needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]);
                  } else {
                  $ok = false;
                  Severity: Major
                  Found in includes/controller/user_shifts_controller.php and 1 other location - About 2 hrs to fix
                  includes/controller/admin_shifts_controller.php on lines 149..156

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  foreach ($types as $type) {
                  if (isset($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
                  $needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]);
                  } else {
                  $ok = false;
                  Severity: Major
                  Found in includes/controller/admin_shifts_controller.php and 1 other location - About 2 hrs to fix
                  includes/controller/user_shifts_controller.php on lines 281..288

                  Method guest_login has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function guest_login() {
                  global $user, $privileges;
                   
                  $nick = "";
                   
                   
                  Severity: Major
                  Found in includes/controller/guest_login_controller.php - About 2 hrs to fix

                    Method header_toolbar has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function header_toolbar() {
                    global $p, $privileges, $user, $enable_tshirt_size, $max_freeloadable_shifts;
                    $settings = array();
                    $no_migrated = "";
                    if (test_import()) {
                    Severity: Major
                    Found in includes/sys_menu.php - About 2 hrs to fix

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                      if (isset($_REQUEST['shifttype_id'])) {
                      $shifttype = ShiftType($_REQUEST['shifttype_id']);
                      if ($shifttype === false)
                      engelsystem_error('Unable to load shift type.');
                      if ($shifttype == null) {
                      Severity: Major
                      Found in includes/controller/admin_shifts_controller.php and 1 other location - About 2 hrs to fix
                      includes/controller/user_shifts_controller.php on lines 212..224

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                      if (isset($_REQUEST['shifttype_id'])) {
                      $shifttype = ShiftType($_REQUEST['shifttype_id']);
                      if ($shifttype === false)
                      engelsystem_error('Unable to load shift type.');
                      if ($shifttype == null) {
                      Severity: Major
                      Found in includes/controller/user_shifts_controller.php and 1 other location - About 2 hrs to fix
                      includes/controller/admin_shifts_controller.php on lines 48..60

                      Method User_insert has 21 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function User_insert($nick, $prename, $lastname, $age, $tel, $dect, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $organization_web, $timezone, $planned_arrival_date) {
                      Severity: Major
                      Found in includes/model/User_model.php - About 2 hrs to fix

                        Function Shift_view has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, $user_shift_admin, $admin_rooms, $admin_shifttypes, $user_shifts, $signed_up) {
                        $parsedown = new Parsedown();
                         
                        $angeltypes = [];
                        foreach ($angeltypes_source as $angeltype)
                        Severity: Minor
                        Found in includes/view/Shifts_view.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language