chamilo/chamilo-lms

View on GitHub

Plugin: Refactor BBB to use new conference tables - refs #6153
#6161

christianbeeznest wants to merge christianbeeznest:GH-6153 into chamilo:master
Failed
16 issues to fix.

Showing 23 of 23 total issues

Avoid deeply nested control flow statements.
New

switch ($action) {
case 'FAILED':
$bbb->endMeeting($value['id'], $courseCode);
break;
case 'SUCCESS':
Severity: Major
Found in public/plugin/bbb/cron_close_meeting.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    New

    switch ($status) {
    case 'FAILED':
    $bbb->endMeeting($meetingId, $courseCode);
    break;
    case 'SUCCESS':
    Severity: Major
    Found in public/plugin/bbb/listing.php - About 45 mins to fix

      Function getMeetingsLight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      New

      public function getMeetingsLight(
      $courseId = 0,
      $sessionId = 0,
      $groupId = 0,
      $dateRange = []
      Severity: Minor
      Found in public/plugin/bbb/lib/bbb.lib.php - About 25 mins to fix

      Method getMeetingParticipantInfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      New

      public function getMeetingParticipantInfo($meetingId, $userId): array
      {
      $em = Database::getManager();
      /** @var ConferenceActivityRepository $repo */
      $repo = $em->getRepository(ConferenceActivity::class);
      Severity: Minor
      Found in public/plugin/bbb/lib/bbb.lib.php - About 1 hr to fix

        Method getAllMeetingsInCourse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        New

        public function getAllMeetingsInCourse($courseId, $sessionId, $status)
        {
        $em = Database::getManager();
        $courseEntity = api_get_course_entity($courseId);
        $sessionEntity = api_get_session_entity($sessionId);
        Severity: Minor
        Found in public/plugin/bbb/lib/bbb.lib.php - About 1 hr to fix

          Method getMeetingsLight has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          New

          public function getMeetingsLight(
          $courseId = 0,
          $sessionId = 0,
          $groupId = 0,
          $dateRange = []
          Severity: Minor
          Found in public/plugin/bbb/lib/bbb.lib.php - About 1 hr to fix

            Method findConnectedMeetingParticipants has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            New

            public function findConnectedMeetingParticipants(int $meetingId): array
            {
            $em = Database::getManager();
            /** @var ConferenceActivityRepository $repo */
            $repo = $em->getRepository(ConferenceActivity::class);
            Severity: Minor
            Found in public/plugin/bbb/lib/bbb.lib.php - About 1 hr to fix

              Method findOneArrayByMeetingAndParticipant has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              New

              public function findOneArrayByMeetingAndParticipant(int $meetingId, int $participantId): ?array
              {
              $qb = $this->createQueryBuilder('a')
              ->where('a.meeting = :meetingId')
              ->andWhere('a.participant = :participantId')
              Severity: Minor
              Found in src/CoreBundle/Repository/ConferenceActivityRepository.php - About 1 hr to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                New

                return [
                'id' => $meeting->getId(),
                'c_id' => $meeting->getCourse()?->getId(),
                'session_id' => $meeting->getSession()?->getId(),
                'meeting_name' => $meeting->getTitle(),
                Severity: Major
                Found in public/plugin/bbb/lib/bbb.lib.php and 1 other location - About 4 hrs to fix
                public/plugin/bbb/lib/bbb.lib.php on lines 910..928

                Identical blocks of code found in 2 locations. Consider refactoring.
                New

                $results[] = [
                'id' => $meeting->getId(),
                'c_id' => $meeting->getCourse()?->getId(),
                'session_id' => $meeting->getSession()?->getId(),
                'meeting_name' => $meeting->getTitle(),
                Severity: Major
                Found in public/plugin/bbb/lib/bbb.lib.php and 1 other location - About 4 hrs to fix
                public/plugin/bbb/lib/bbb.lib.php on lines 867..885

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

                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'),
                Severity: Major
                Found in public/plugin/bbb/lib/bbb.lib.php and 1 other location - About 1 hr to fix
                src/CoreBundle/Repository/ConferenceActivityRepository.php on lines 67..79

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

                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'),
                Severity: Major
                Found in src/CoreBundle/Repository/ConferenceActivityRepository.php and 1 other location - About 1 hr to fix
                public/plugin/bbb/lib/bbb.lib.php on lines 740..752

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

                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()) {
                Severity: Major
                Found in public/plugin/bbb/lib/bbb.lib.php and 1 other location - About 1 hr to fix
                public/plugin/bbb/lib/bbb.lib.php on lines 1092..1106

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

                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 {
                Severity: Major
                Found in public/plugin/bbb/lib/bbb.lib.php and 1 other location - About 1 hr to fix
                public/plugin/bbb/lib/bbb.lib.php on lines 960..987

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

                public function publishMeeting($id)
                {
                if (empty($id)) {
                return false;
                }
                Severity: Minor
                Found in public/plugin/bbb/lib/bbb.lib.php and 1 other location - About 45 mins to fix
                public/plugin/bbb/lib/bbb.lib.php on lines 1489..1508

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

                public function unpublishMeeting($id)
                {
                if (empty($id)) {
                return false;
                }
                Severity: Minor
                Found in public/plugin/bbb/lib/bbb.lib.php and 1 other location - About 45 mins to fix
                public/plugin/bbb/lib/bbb.lib.php on lines 1465..1484

                Avoid deeply nested control flow statements.
                Fixed

                Severity: Major
                Found in public/plugin/bbb/cron_close_meeting.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Fixed

                  Severity: Major
                  Found in public/plugin/bbb/listing.php - About 45 mins to fix

                    File bbb_plugin.class.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                    Fixed

                    Severity: Minor
                    Found in public/plugin/bbb/lib/bbb_plugin.class.php - About 2 hrs to fix

                      Function uninstall has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Fixed

                      Severity: Minor
                      Found in public/plugin/bbb/lib/bbb_plugin.class.php - About 1 hr to fix

                      Method install has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                      Fixed

                      Severity: Major
                      Found in public/plugin/bbb/lib/bbb_plugin.class.php - About 2 hrs to fix

                        Method uninstall has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Fixed

                        Severity: Major
                        Found in public/plugin/bbb/lib/bbb_plugin.class.php - About 2 hrs to fix

                          Function endMeeting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Fixed

                          Severity: Minor
                          Found in public/plugin/bbb/lib/bbb.lib.php - About 25 mins to fix
                          Category
                          Status