fossasia/engelsystem

View on GitHub
includes/mailer/shifts_mailer.php

Summary

Maintainability
C
1 day
Test Coverage

Showing 4 of 4 total issues

Method mail_shift_change has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function mail_shift_change($old_shift, $new_shift) {
$users = ShiftEntries_by_shift($old_shift["SID"]);
$old_room = Room($old_shift["RID"]);
$new_room = Room($new_shift["RID"]);
 
 
Severity: Minor
Found in includes/mailer/shifts_mailer.php - About 1 hr to fix

    Function mail_shift_change has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function mail_shift_change($old_shift, $new_shift) {
    $users = ShiftEntries_by_shift($old_shift["SID"]);
    $old_room = Room($old_shift["RID"]);
    $new_room = Room($new_shift["RID"]);
     
     
    Severity: Minor
    Found in includes/mailer/shifts_mailer.php - About 55 mins 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

    There are no issues that match your filters.

    Category
    Status