fossasia/engelsystem

View on GitHub
includes/controller/user_driver_licenses_controller.php

Summary

Maintainability
C
1 day
Test Coverage

Showing 4 of 4 total issues

Function user_driver_license_edit_controller has a Cognitive Complexity of 39 (exceeds 5 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: Minor
Found in includes/controller/user_driver_licenses_controller.php - About 5 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 user_driver_license_required_hint has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function user_driver_license_required_hint() {
    global $user;
     
    $angeltypes = User_angeltypes($user);
    if ($angeltypes === false)
    Severity: Minor
    Found in includes/controller/user_driver_licenses_controller.php - About 45 mins to fix

    Consider simplifying this complex logical expression.
    Open

    if ($wants_to_drive && ! $has_license_car && ! $has_license_3_5t_transporter && ! $has_license_7_5t_truck && ! $has_license_12_5t_truck && ! $has_license_forklift) {
    $ok = false;
    error(_("Please select at least one driving license."));
    }
    Severity: Major
    Found in includes/controller/user_driver_licenses_controller.php - About 40 mins to fix
      Category
      Status