fossasia/engelsystem

View on GitHub
includes/controller/user_settings_controller.php

Summary

Maintainability
F
4 days
Test Coverage

Showing 7 of 7 total issues

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 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

    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

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

      form(array(
      form_info(_("Here you can change your password.")),
      form_password('password', _("Old password:")),
      form_password('new_password', _("New password:")),
      form_password('new_password2', _("Password confirmation:")),
      Severity: Major
      Found in includes/controller/user_settings_controller.php and 1 other location - About 1 hr to fix
      includes/controller/user_settings_controller.php on lines 230..236

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

      form(array(
      form_info(_("Here you can change your password.")),
      form_password('password', _("Old password:")),
      form_password('new_password', _("New password:")),
      form_password('new_password2', _("Password confirmation:")),
      Severity: Major
      Found in includes/controller/user_settings_controller.php and 1 other location - About 1 hr to fix
      includes/controller/user_settings_controller.php on lines 287..293

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

      if (isset($_REQUEST['planned_arrival_date']) && DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))) {
      $planned_arrival_date = DateTime::createFromFormat("Y-m-d", trim($_REQUEST['planned_arrival_date']))->getTimestamp();
      } else {
      $ok = false;
      $msg .= error(_("Please enter your planned date of arrival."), true);
      Severity: Major
      Found in includes/controller/user_settings_controller.php and 1 other location - About 1 hr to fix
      includes/controller/guest_login_controller.php on lines 114..119

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

      if (isset($_REQUEST['jabber']) && strlen(strip_request_item('jabber')) > 0) {
      $jabber = strip_request_item('jabber');
      if (! check_email($jabber)) {
      $ok = false;
      $msg .= error(_("Please check your jabber account information."), true);
      Severity: Minor
      Found in includes/controller/user_settings_controller.php and 1 other location - About 55 mins to fix
      includes/controller/guest_login_controller.php on lines 87..93

      There are no issues that match your filters.

      Category
      Status