fossasia/engelsystem

View on GitHub

Showing 271 of 271 total issues

Function view_user_shifts has a Cognitive Complexity of 324 (exceeds 5 allowed). Consider refactoring.
Open

function view_user_shifts() {
global $user, $privileges;
global $ical_shifts;
 
$ical_shifts = array();
Severity: Minor
Found in includes/controller/user_shifts_controller.php - About 6 days to fix

Function user_shifts has a Cognitive Complexity of 287 (exceeds 5 allowed). Consider refactoring.
Open

function user_shifts() {
global $user, $privileges;
$timezone_identifiers = DateTimeZone::listIdentifiers();
$timezone = $user['timezone'];
date_default_timezone_set ("$timezone_identifiers[$timezone]");
Severity: Minor
Found in includes/controller/user_shifts_controller.php - About 5 days to fix

Function admin_shifts has a Cognitive Complexity of 164 (exceeds 5 allowed). Consider refactoring.
Open

function admin_shifts() {
global $user;
$timezone_identifiers = DateTimeZone::listIdentifiers();
$timezone = $user['timezone'];
date_default_timezone_set ("$timezone_identifiers[$timezone]");
Severity: Minor
Found in includes/controller/admin_shifts_controller.php - About 3 days to fix

Function admin_rooms has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring.
Open

function admin_rooms() {
global $user;
 
$event_source = sql_select("SELECT * FROM `Events` ORDER BY `name`");
$events = array();
Severity: Minor
Found in includes/controller/admin_rooms_controller.php - About 2 days to fix

Method user_shifts has 452 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function user_shifts() {
global $user, $privileges;
$timezone_identifiers = DateTimeZone::listIdentifiers();
$timezone = $user['timezone'];
date_default_timezone_set ("$timezone_identifiers[$timezone]");
Severity: Major
Found in includes/controller/user_shifts_controller.php - About 2 days to fix

    File user_shifts_controller.php has 874 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
     
    function shifts_title() {
    return _("Shifts");
    }
    Severity: Major
    Found in includes/controller/user_shifts_controller.php - About 2 days to fix

      Function guest_register has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
      Open

      function guest_register() {
      global $tshirt_sizes, $enable_tshirt_size, $default_theme;
       
      $msg = "";
      $nick = "";
      Severity: Minor
      Found in includes/controller/guest_login_controller.php - About 2 days to fix

      Function user_settings has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
      Open

      function user_settings() {
      global $enable_tshirt_size, $tshirt_sizes, $themes, $locales;
      global $user;
      $msg = "";
      $nick = $user['Nick'];
      Severity: Minor
      Found in includes/controller/user_settings_controller.php - About 2 days to fix

      Method view_user_shifts has 382 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function view_user_shifts() {
      global $user, $privileges;
      global $ical_shifts;
       
      $ical_shifts = array();
      Severity: Major
      Found in includes/controller/user_shifts_controller.php - About 1 day to fix

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

        } elseif (isset($_REQUEST['submit'])) {
        if (! is_array($_SESSION['admin_shifts_shifts']) || ! is_array($_SESSION['admin_shifts_types']))
        redirect(page_link_to('admin_shifts'));
         
        foreach ($_SESSION['admin_shifts_shifts'] as $shift) {
        Severity: Major
        Found in includes/controller/admin_shifts_controller.php and 1 other location - About 1 day to fix
        includes/controller/user_shifts_controller.php on lines 355..380

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

        elseif (isset($_REQUEST['save'])) {
        if (! is_array($_SESSION['admin_shifts_shifts']) || ! is_array($_SESSION['admin_shifts_types']))
        redirect(page_link_to('admin_shifts'));
         
        foreach ($_SESSION['admin_shifts_shifts'] as $shift) {
        Severity: Major
        Found in includes/controller/user_shifts_controller.php and 1 other location - About 1 day to fix
        includes/controller/admin_shifts_controller.php on lines 299..324

        Method guest_register has 329 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function guest_register() {
        global $tshirt_sizes, $enable_tshirt_size, $default_theme;
         
        $msg = "";
        $nick = "";
        Severity: Major
        Found in includes/controller/guest_login_controller.php - About 1 day to fix

          Method user_settings has 318 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function user_settings() {
          global $enable_tshirt_size, $tshirt_sizes, $themes, $locales;
          global $user;
          $msg = "";
          $nick = $user['Nick'];
          Severity: Major
          Found in includes/controller/user_settings_controller.php - About 1 day to fix

            Method admin_shifts has 314 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function admin_shifts() {
            global $user;
            $timezone_identifiers = DateTimeZone::listIdentifiers();
            $timezone = $user['timezone'];
            date_default_timezone_set ("$timezone_identifiers[$timezone]");
            Severity: Major
            Found in includes/controller/admin_shifts_controller.php - About 1 day to fix

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

              return page_with_title(_("Preview"), array(
              form(array(
              $hidden_types,
              form_hidden('shifttype_id', $shifttype_id),
              form_hidden('title', $title),
              Severity: Major
              Found in includes/controller/user_shifts_controller.php and 1 other location - About 1 day to fix
              includes/controller/admin_shifts_controller.php on lines 275..297

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

              return page_with_title(_("Preview"), array(
              form(array(
              $hidden_types,
              form_hidden('shifttype_id', $shifttype_id),
              form_hidden('title', $title),
              Severity: Major
              Found in includes/controller/admin_shifts_controller.php and 1 other location - About 1 day to fix
              includes/controller/user_shifts_controller.php on lines 330..352

              Function user_messages has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
              Open

              function user_messages() {
              global $user;
               
              if (! isset($_REQUEST['action'])) {
              $users = user_by_nick($user['UID']);
              Severity: Minor
              Found in includes/controller/user_messages_controller.php - About 1 day to fix

              Function admin_import has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
              Open

              function admin_import() {
              global $rooms_import;
              global $user;
              $html = "";
               
               
              Severity: Minor
              Found in includes/controller/admin_import_controller.php - About 1 day to fix

              Function admin_active has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
              Open

              function admin_active() {
              global $tshirt_sizes, $shift_sum_formula;
               
              $msg = "";
              $search = "";
              Severity: Minor
              Found in includes/controller/admin_active_controller.php - About 1 day to fix

              Function admin_export has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
              Open

              function admin_export() {
              // Export User data
              if(isset($_REQUEST['download'])){
              $filename = tempnam('/tmp', '.csv'); // Temporary File Name
              create_temporary_table(); // Create temporary table
              Severity: Minor
              Found in includes/controller/admin_export_controller.php - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language