Showing 7 of 636 total issues
File WebinarService.php
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace EscolaLms\Webinar\Services;
use Carbon\Carbon;
FilterListDto
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class FilterListDto extends BaseDto
{
private string $name;
private array $status;
private array $reminderStatus;
WebinarService
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class WebinarService implements WebinarServiceContract
{
private WebinarRepositoryContract $webinarRepositoryContract;
private JitsiServiceContract $jitsiServiceContract;
private YoutubeServiceContract $youtubeServiceContract;
Method prepareFilters
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function prepareFilters(array $search)
{
$dto = new self($search);
$user = auth()->user();
Function prepareFilters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function prepareFilters(array $search)
{
$dto = new self($search);
$user = auth()->user();
- Read upRead up
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
Open
public function generateJitsi(int $webinarId): array
{
/** @var Webinar|null $webinar */
$webinar = $this->webinarRepositoryContract->find($webinarId);
if (!$webinar || !$this->canGenerateJitsi($webinar)) {
Method apply
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function apply(Builder $query): Builder
{
if ($this->withDuration) {
return $query
->where(function (Builder $query) {