Avoid deeply nested control flow statements.
switch ($action) {
case 'FAILED':
$bbb->endMeeting($value['id'], $courseCode);
break;
case 'SUCCESS':
Avoid deeply nested control flow statements.
switch ($status) {
case 'FAILED':
$bbb->endMeeting($meetingId, $courseCode);
break;
case 'SUCCESS':
Function getMeetingsLight
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function getMeetingsLight(
$courseId = 0,
$sessionId = 0,
$groupId = 0,
$dateRange = []
Method getMeetingParticipantInfo
has 28 lines of code (exceeds 25 allowed). Consider refactoring.
public function getMeetingParticipantInfo($meetingId, $userId): array
{
$em = Database::getManager();
$repo = $em->getRepository(ConferenceActivity::class);
Method getAllMeetingsInCourse
has 31 lines of code (exceeds 25 allowed). Consider refactoring.
public function getAllMeetingsInCourse($courseId, $sessionId, $status)
{
$em = Database::getManager();
$courseEntity = api_get_course_entity($courseId);
$sessionEntity = api_get_session_entity($sessionId);
Method getMeetingsLight
has 31 lines of code (exceeds 25 allowed). Consider refactoring.
public function getMeetingsLight(
$courseId = 0,
$sessionId = 0,
$groupId = 0,
$dateRange = []
Method findConnectedMeetingParticipants
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
public function findConnectedMeetingParticipants(int $meetingId): array
{
$em = Database::getManager();
$repo = $em->getRepository(ConferenceActivity::class);
Method findOneArrayByMeetingAndParticipant
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
public function findOneArrayByMeetingAndParticipant(int $meetingId, int $participantId): ?array
{
$qb = $this->createQueryBuilder('a')
->where('a.meeting = :meetingId')
->andWhere('a.participant = :participantId')
Identical blocks of code found in 2 locations. Consider refactoring.
return [
'id' => $meeting->getId(),
'c_id' => $meeting->getCourse()?->getId(),
'session_id' => $meeting->getSession()?->getId(),
'meeting_name' => $meeting->getTitle(),
Identical blocks of code found in 2 locations. Consider refactoring.
$results[] = [
'id' => $meeting->getId(),
'c_id' => $meeting->getCourse()?->getId(),
'session_id' => $meeting->getSession()?->getId(),
'meeting_name' => $meeting->getTitle(),
Similar blocks of code found in 2 locations. Consider refactoring.
return [
'id' => $activity->getId(),
'meeting_id' => $activity->getMeeting()?->getId(),
'participant_id' => $activity->getParticipant()?->getId(),
'in_at' => $activity->getInAt()?->format('Y-m-d H:i:s'),
src/CoreBundle/Repository/ConferenceActivityRepository.php on lines 67..79 Similar blocks of code found in 2 locations. Consider refactoring.
return [
'id' => $entity->getId(),
'meeting_id' => $entity->getMeeting()?->getId(),
'participant_id' => $entity->getParticipant()?->getId(),
'in_at' => $entity->getInAt()?->format('Y-m-d H:i:s'),
Similar blocks of code found in 2 locations. Consider refactoring.
if (!empty($dateRange)) {
$dateStart = (new \DateTime($dateRange['search_meeting_start']))->setTime(0, 0, 0);
$dateEnd = (new \DateTime($dateRange['search_meeting_end']))->setTime(23, 59, 59);
$meetings = $repo->findByDateRange($dateStart, $dateEnd);
} elseif ($this->isGlobalConference()) {
Similar blocks of code found in 2 locations. Consider refactoring.
if (!empty($dateRange)) {
$dateStart = (new \DateTime($dateRange['search_meeting_start']))->setTime(0, 0, 0);
$dateEnd = (new \DateTime($dateRange['search_meeting_end']))->setTime(23, 59, 59);
$meetings = $repo->findByDateRange($dateStart, $dateEnd);
} else {
Similar blocks of code found in 2 locations. Consider refactoring.
public function publishMeeting($id)
{
if (empty($id)) {
return false;
}
Similar blocks of code found in 2 locations. Consider refactoring.
public function unpublishMeeting($id)
{
if (empty($id)) {
return false;
}
Avoid deeply nested control flow statements.
Fixed
Avoid deeply nested control flow statements.
Fixed
File bbb_plugin.class.php
has 269 lines of code (exceeds 250 allowed). Consider refactoring.
Fixed
Function uninstall
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Fixed
Method install
has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Fixed
Method uninstall
has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Fixed
Function endMeeting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Fixed
There are no issues that match your filters.