EscolaLMS/Webinar

View on GitHub

Showing 7 of 636 total issues

File WebinarService.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace EscolaLms\Webinar\Services;

use Carbon\Carbon;
Severity: Minor
Found in src/Services/WebinarService.php - About 3 hrs to fix

    FilterListDto has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class FilterListDto extends BaseDto
    {
        private string $name;
        private array $status;
        private array $reminderStatus;
    Severity: Minor
    Found in src/Dto/FilterListDto.php - About 2 hrs to fix

      WebinarService has 25 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class WebinarService implements WebinarServiceContract
      {
          private WebinarRepositoryContract $webinarRepositoryContract;
          private JitsiServiceContract $jitsiServiceContract;
          private YoutubeServiceContract $youtubeServiceContract;
      Severity: Minor
      Found in src/Services/WebinarService.php - About 2 hrs to fix

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

            public static function prepareFilters(array $search)
            {
                $dto = new self($search);
                $user = auth()->user();
        
        
        Severity: Minor
        Found in src/Dto/FilterListDto.php - About 1 hr to fix

          Function prepareFilters has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function prepareFilters(array $search)
              {
                  $dto = new self($search);
                  $user = auth()->user();
          
          
          Severity: Minor
          Found in src/Dto/FilterListDto.php - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method generateJitsi has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function generateJitsi(int $webinarId): array
              {
                  /** @var Webinar|null $webinar */
                  $webinar = $this->webinarRepositoryContract->find($webinarId);
                  if (!$webinar || !$this->canGenerateJitsi($webinar)) {
          Severity: Minor
          Found in src/Services/WebinarService.php - About 1 hr to fix

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

                public function apply(Builder $query): Builder
                {
                    if ($this->withDuration) {
                        return $query
                            ->where(function (Builder $query) {
            Severity: Minor
            Found in src/Repositories/Criteria/WebinarIncomingCriterion.php - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language