EscolaLMS/Webinar

View on GitHub

Showing 636 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

    The class WebinarService has an overall complexity of 67 which is very high. The configured complexity threshold is 50.
    Open

    class WebinarService implements WebinarServiceContract
    {
        private WebinarRepositoryContract $webinarRepositoryContract;
        private JitsiServiceContract $jitsiServiceContract;
        private YoutubeServiceContract $youtubeServiceContract;
    Severity: Minor
    Found in src/Services/WebinarService.php by phpmd

    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

      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

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

            public function up(): void
            {
                Schema::rename('webinar_authors', 'webinar_trainers');
                Schema::table('webinar_trainers', function (Blueprint $table) {
                    $table->dropForeign('webinar_authors_author_id_foreign');
        database/migrations/2022_03_23_111023_change_name_columns_in_webinar_authors_table.php on lines 21..31

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 119.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            public function down(): void
            {
                Schema::rename('webinar_trainers', 'webinar_authors');
                Schema::table('webinar_authors', function (Blueprint $table) {
                    $table->dropForeign('webinar_trainers_trainer_id_foreign');
        database/migrations/2022_03_23_111023_change_name_columns_in_webinar_authors_table.php on lines 9..19

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 119.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Avoid excessively long variable names like $webinarRepositoryContract. Keep variable name length under 20.
        Open

                WebinarRepositoryContract $webinarRepositoryContract,
        Severity: Minor
        Found in src/Services/WebinarService.php by phpmd

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $youtubeServiceContract. Keep variable name length under 20.
        Open

                YoutubeServiceContract    $youtubeServiceContract
        Severity: Minor
        Found in src/Services/WebinarService.php by phpmd

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarRepositoryContract. Keep variable name length under 20.
        Open

            private WebinarRepositoryContract $webinarRepositoryContract;
        Severity: Minor
        Found in src/Services/WebinarService.php by phpmd

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $relationStrategyContract. Keep variable name length under 20.
        Open

            private RelationStrategyContract $relationStrategyContract;

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarServiceContract. Keep variable name length under 20.
        Open

            private WebinarServiceContract $webinarServiceContract;

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarSimpleResource. Keep variable name length under 20.
        Open

            public function extendResponse($webinarSimpleResource, $isApi = false);

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarServiceContract. Keep variable name length under 20.
        Open

                WebinarServiceContract $webinarServiceContract

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $relationStrategyContract. Keep variable name length under 20.
        Open

                RelationStrategyContract $relationStrategyContract

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarServiceContract. Keep variable name length under 20.
        Open

                WebinarServiceContract $webinarServiceContract,

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long class names like AddColumnYtAutoStartStatusInWebinarsTable. Keep class name length under 40.
        Open

        class AddColumnYtAutoStartStatusInWebinarsTable extends Migration
        {
            /**
             * Run the migrations.
             *

        LongClassName

        Since: 2.9

        Detects when classes or interfaces are declared with excessively long names.

        Example

        class ATooLongClassNameThatHintsAtADesignProblem {
        
        }
        
        interface ATooLongInterfaceNameThatHintsAtADesignProblem {
        
        }

        Source https://phpmd.org/rules/naming.html#longclassname

        Avoid excessively long variable names like $youtubeServiceContract. Keep variable name length under 20.
        Open

            private YoutubeServiceContract $youtubeServiceContract;
        Severity: Minor
        Found in src/Services/WebinarService.php by phpmd

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarSimpleResource. Keep variable name length under 20.
        Open

            public function extendResponse($webinarSimpleResource, $isApi = false)
        Severity: Minor
        Found in src/Services/WebinarService.php by phpmd

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarServiceContract. Keep variable name length under 20.
        Open

            private WebinarServiceContract $webinarServiceContract;

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Avoid excessively long variable names like $webinarServiceContract. Keep variable name length under 20.
        Open

            private WebinarServiceContract $webinarServiceContract;

        LongVariable

        Since: 0.2

        Detects when a field, formal or local variable is declared with a long name.

        Example

        class Something {
            protected $reallyLongIntName = -3; // VIOLATION - Field
            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                $otherReallyLongName = -5; // VIOLATION - Local
                for ($interestingIntIndex = 0; // VIOLATION - For
                     $interestingIntIndex < 10;
                     $interestingIntIndex++ ) {
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#longvariable

        Severity
        Category
        Status
        Source
        Language