fossasia/engelsystem

View on GitHub

Showing 271 of 271 total issues

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

function ShiftType_delete_view($shifttype) {
return page_with_title(sprintf(_("Delete shifttype %s"), $shifttype['name']), array(
info(sprintf(_("Do you want to delete shifttype %s?"), $shifttype['name']), true),
buttons(array(
button(page_link_to('shifttypes'), _("cancel"), 'cancel'),
Severity: Major
Found in includes/view/ShiftTypes_view.php and 1 other location - About 4 hrs to fix
includes/view/AngelTypes_view.php on lines 48..56

Function User_view has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function User_view($user_source, $admin_user_privilege, $freeloader, $user_angeltypes, $user_groups, $shifts, $its_me) {
global $LETZTES_AUSTRAGEN, $privileges;
$user_name = htmlspecialchars($user_source['Vorname']) . " " . htmlspecialchars($user_source['Name']);
$myshifts_table = array();
$timesum = 0;
Severity: Minor
Found in includes/view/User_view.php - About 4 hrs to fix

Method admin_settings has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function admin_settings() {
 
$ok = false;
$msg = "";
$event_name = "";
Severity: Major
Found in includes/controller/admin_settings_controller.php - About 4 hrs to fix

    File User_view.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
     
    /**
    * Available T-Shirt sizes
    */
    Severity: Minor
    Found in includes/view/User_view.php - About 4 hrs to fix

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

      return sql_query("UPDATE `Shifts` SET
      `shifttype_id`='" . sql_escape($shift['shifttype_id']) . "',
      `start`='" . sql_escape($shift['start']) . "',
      `end`='" . sql_escape($shift['end']) . "',
      `RID`='" . sql_escape($shift['RID']) . "',
      Severity: Major
      Found in includes/model/Shifts_model.php and 1 other location - About 3 hrs to fix
      includes/model/Shifts_model.php on lines 141..150

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

      $result = sql_query("INSERT INTO `Shifts` SET
      `shifttype_id`='" . sql_escape($shift['shifttype_id']) . "',
      `start`='" . sql_escape($shift['start']) . "',
      `end`='" . sql_escape($shift['end']) . "',
      `RID`='" . sql_escape($shift['RID']) . "',
      Severity: Major
      Found in includes/model/Shifts_model.php and 1 other location - About 3 hrs to fix
      includes/model/Shifts_model.php on lines 108..117

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

      function AngelType_validate_name($name, $angeltype) {
      $name = strip_item($name);
      if ($name == "")
      return array(
      false,
      Severity: Major
      Found in includes/model/AngelType_model.php and 1 other location - About 3 hrs to fix
      includes/model/Events_model.php on lines 72..98

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

      function event_validate_name($name, $event) {
      $name = strip_item($name);
      if ($name == "")
      return array(
      false,
      Severity: Major
      Found in includes/model/Events_model.php and 1 other location - About 3 hrs to fix
      includes/model/AngelType_model.php on lines 62..88

      File user_settings_controller.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      function settings_title() {
      return _("Settings");
      }
      function user_settings() {
      Severity: Minor
      Found in includes/controller/user_settings_controller.php - About 3 hrs to fix

        File admin_import_controller.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
         
        function admin_import_title() {
        return _("Frab import");
        }
        Severity: Minor
        Found in includes/controller/admin_import_controller.php - About 3 hrs to fix

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

          } elseif (isset($_REQUEST['not_active']) && preg_match("/^[0-9]+$/", $_REQUEST['not_active'])) {
          $id = $_REQUEST['not_active'];
          $user_source = User($id);
          if ($user_source != null) {
          User_update_inactive($id);
          Severity: Major
          Found in includes/controller/admin_active_controller.php and 1 other location - About 3 hrs to fix
          includes/controller/admin_active_controller.php on lines 83..92

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

          } elseif (isset($_REQUEST['not_tshirt']) && preg_match("/^[0-9]+$/", $_REQUEST['not_tshirt'])) {
          $id = $_REQUEST['not_tshirt'];
          $user_source = User($id);
          if ($user_source != null) {
          User_update_not_tshirt($id);
          Severity: Major
          Found in includes/controller/admin_active_controller.php and 1 other location - About 3 hrs to fix
          includes/controller/admin_active_controller.php on lines 65..74

          File admin_shifts_controller.php has 321 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
           
          function admin_shifts_title() {
          return _("Create shifts");
          }
          Severity: Minor
          Found in includes/controller/admin_shifts_controller.php - About 3 hrs to fix

            File user_angeltypes_controller.php has 318 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
             
            /**
            * Display a hint for team/angeltype coordinators if there are unconfirmed users for his angeltype.
            */
            Severity: Minor
            Found in includes/controller/user_angeltypes_controller.php - About 3 hrs to fix

              Method install_admin has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function install_admin() {
               
              $ok = false;
              $msg = "";
              $username = "";
              Severity: Major
              Found in install.php - About 3 hrs to fix

                Method admin_questions has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function admin_questions() {
                global $user;
                 
                if (! isset($_REQUEST['action'])) {
                $unanswered_questions_table = array();
                Severity: Major
                Found in includes/controller/admin_questions_controller.php - About 3 hrs to fix

                  Function user_questions has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function user_questions() {
                  global $user;
                  if (! isset($_REQUEST['action'])) {
                  $open_questions = select_open_questions($user['UID']);
                  $answered_questions = select_ansd_questions($user['UID']);
                  Severity: Minor
                  Found in includes/controller/user_questions_controller.php - About 3 hrs to fix

                  Method admin_events has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function admin_free has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

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

                    Function guest_login has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function guest_login() {
                    global $user, $privileges;
                     
                    $nick = "";
                     
                     
                    Severity: Minor
                    Found in includes/controller/guest_login_controller.php - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language