src/models/TeamGroups.php
File TeamGroups.php
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @package Elabftw\Elabftw
* @author Nicolas CARPi <nico-git@deltablot.email>
Method updateTeamgroupPermissionsOnDestroy
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function updateTeamgroupPermissionsOnDestroy(string $type): bool
{
// the complicated SQL could be avoided if we could use JSON_SEARCH with integers but it only works with strings :(
// https://bugs.mysql.com/bug.php?id=90085
// we need to do a detour and convert int to string to get the index of the element that we want to remove
Method readGroupsWithUsersFromUser
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function readGroupsWithUsersFromUser(): array
{
$sql = "SELECT team_groups_of_user.name,
teams.name AS team_name,
JSON_ARRAYAGG(JSON_OBJECT(
Method readAll
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function readAll(): array
{
$sql = "SELECT team_groups.id,
team_groups.name,
GROUP_CONCAT(users.userid ORDER BY users.firstname, users.lastname) AS userids,