herpaderpaldent/seat-groups

View on GitHub
src/Listeners/CreateSyncedSeatLogsEntry.php

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 3 of 3 total issues

Method handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function handle(GroupSynced $event)
{
if (empty($event->sync['attached']) && empty($event->sync['detached']))
$this->delete();
 
 
Severity: Minor
Found in src/Listeners/CreateSyncedSeatLogsEntry.php - About 1 hr to fix

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

    if (! empty($event->sync['attached'])) {
     
    SeatgroupLog::create([
    'event' => 'attached',
    'message' => sprintf('The user group of %s (%s) has successfully been attached to the following roles: %s.',
    Severity: Major
    Found in src/Listeners/CreateSyncedSeatLogsEntry.php and 1 other location - About 1 hr to fix
    src/Listeners/CreateSyncedSeatLogsEntry.php on lines 46..59

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

    if (! empty($event->sync['detached'])) {
     
    SeatgroupLog::create([
    'event' => 'detached',
    'message' => sprintf('The user group of %s (%s) has been detached from the following roles: %s.',
    Severity: Major
    Found in src/Listeners/CreateSyncedSeatLogsEntry.php and 1 other location - About 1 hr to fix
    src/Listeners/CreateSyncedSeatLogsEntry.php on lines 31..44
    Category
    Status