fossasia/engelsystem

View on GitHub

Showing 271 of 271 total issues

Function admin_questions has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

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

Function admin_events has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

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

Function AngelType_view has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

function AngelType_view($angeltype, $members, $user_angeltype, $admin_user_angeltypes, $admin_angeltypes, $coordinator, $user_driver_license, $user) {
$buttons = [
button(page_link_to('angeltypes'), _("Angeltypes"), 'back')
];
 
 
Severity: Minor
Found in includes/view/AngelTypes_view.php - About 5 hrs to fix

Function angeltype_edit_controller has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

function angeltype_edit_controller() {
global $privileges, $user;
 
$name = "";
$restricted = false;
Severity: Minor
Found in includes/controller/angeltypes_controller.php - About 5 hrs to fix

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

function UserAngelType_delete_view($user_angeltype, $user, $angeltype) {
return page_with_title(_("Remove angeltype"), array(
msg(),
info(sprintf(_("Do you really want to delete %s from %s?"), User_Nick_render($user), $angeltype['name']), true),
buttons(array(
Severity: Major
Found in includes/view/UserAngelTypes_view.php and 1 other location - About 5 hrs to fix
includes/view/UserAngelTypes_view.php on lines 35..44

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

function UserAngelType_confirm_view($user_angeltype, $user, $angeltype) {
return page_with_title(_("Confirm angeltype for user"), array(
msg(),
info(sprintf(_("Do you really want to confirm %s for %s?"), User_Nick_render($user), $angeltype['name']), true),
buttons(array(
Severity: Major
Found in includes/view/UserAngelTypes_view.php and 1 other location - About 5 hrs to fix
includes/view/UserAngelTypes_view.php on lines 46..55

Function install_admin has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

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

Method user_messages has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function header_toolbar has a Cognitive Complexity of 34 (exceeds 5 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: Minor
    Found in includes/sys_menu.php - About 5 hrs to fix

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

    function mail_shift_assign($user, $shift) {
    if ($user["email_shiftinfo"]) {
    $room = Room($shift["RID"]);
     
    $message = _("You have been assigned to a Shift:") . "\n";
    Severity: Major
    Found in includes/mailer/shifts_mailer.php and 1 other location - About 4 hrs to fix
    includes/mailer/shifts_mailer.php on lines 86..98

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

    function mail_shift_removed($user, $shift) {
    if ($user["email_shiftinfo"]) {
    $room = Room($shift["RID"]);
     
    $message = _("You have been removed from a Shift:") . "\n";
    Severity: Major
    Found in includes/mailer/shifts_mailer.php and 1 other location - About 4 hrs to fix
    includes/mailer/shifts_mailer.php on lines 72..84

    Method User_view has 118 lines of code (exceeds 25 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: Major
    Found in includes/view/User_view.php - About 4 hrs to fix

      Function shifttype_edit_controller has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

      function shifttype_edit_controller() {
      $shifttype_id = null;
      $name = "";
      $angeltype_id = null;
      $description = "";
      Severity: Minor
      Found in includes/controller/shifttypes_controller.php - About 4 hrs to fix

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

      case "delete":
      if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
      $id = $_REQUEST['id'];
      else
      return error(_("Incomplete call, missing Message ID."), true);
      Severity: Major
      Found in includes/controller/user_messages_controller.php and 1 other location - About 4 hrs to fix
      includes/controller/user_messages_controller.php on lines 96..108

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

      case "read":
      if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
      $id = $_REQUEST['id'];
      else
      return error(_("Incomplete call, missing Message ID."), true);
      Severity: Major
      Found in includes/controller/user_messages_controller.php and 1 other location - About 4 hrs to fix
      includes/controller/user_messages_controller.php on lines 110..122

      Method AngelType_view has 112 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function AngelType_view($angeltype, $members, $user_angeltype, $admin_user_angeltypes, $admin_angeltypes, $coordinator, $user_driver_license, $user) {
      $buttons = [
      button(page_link_to('angeltypes'), _("Angeltypes"), 'back')
      ];
       
       
      Severity: Major
      Found in includes/view/AngelTypes_view.php - About 4 hrs to fix

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

        function UserAngelTypes_confirm_all_view($angeltype) {
        return page_with_title(_("Confirm all users"), array(
        msg(),
        info(sprintf(_("Do you really want to confirm all users for %s?"), $angeltype['name']), true),
        buttons(array(
        Severity: Major
        Found in includes/view/UserAngelTypes_view.php and 1 other location - About 4 hrs to fix
        includes/view/UserAngelTypes_view.php on lines 13..22

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

        function UserAngelTypes_delete_all_view($angeltype) {
        return page_with_title(_("Deny all users"), array(
        msg(),
        info(sprintf(_("Do you really want to deny all users for %s?"), $angeltype['name']), true),
        buttons(array(
        Severity: Major
        Found in includes/view/UserAngelTypes_view.php and 1 other location - About 4 hrs to fix
        includes/view/UserAngelTypes_view.php on lines 24..33

        File sys_template.php has 345 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
        * List of available themes
        */
        $themes = array(
        Severity: Minor
        Found in includes/sys_template.php - About 4 hrs to fix

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

          function AngelType_delete_view($angeltype) {
          return page_with_title(sprintf(_("Delete angeltype %s"), $angeltype['name']), array(
          info(sprintf(_("Do you want to delete angeltype %s?"), $angeltype['name']), true),
          buttons(array(
          button(page_link_to('angeltypes'), _("cancel"), 'cancel'),
          Severity: Major
          Found in includes/view/AngelTypes_view.php and 1 other location - About 4 hrs to fix
          includes/view/ShiftTypes_view.php on lines 10..18
          Severity
          Category
          Status
          Source
          Language