EscolaLMS/topic-types

View on GitHub

Showing 313 of 313 total issues

Method boot has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function boot()
    {
        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
        $this->mergeConfigFrom(__DIR__ . '/../config/topic-h5p.php', 'topic-h5p');
        if ($this->app->runningInConsole()) {
Severity: Major
Found in src/EscolaLmsTopicTypesServiceProvider.php - About 2 hrs to fix

    Method run has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function run()
        {
            $this->faker = $this->makeFaker();
            $this->faker->addProvider(new FakerProvider($this->faker));
            $randomTags = [
    Severity: Major
    Found in database/seeders/CoursesWithTopicSeeder.php - About 2 hrs to fix

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

      class AddLengthAndPageCountFieldsToTopicPdfsTable extends Migration
      {
          public function up(): void
          {
              Schema::table('topic_pdfs', function (Blueprint $table) {

      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 using short method names like CreateTopicVideosTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_videos', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicCmi5AusTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_cmi5_aus', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->string('value', 255);

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicOembedsTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_oembeds', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicRichtextsTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_richtexts', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like AddLengthFieldToTopicRichtextsTable::up(). The configured minimum method name length is 3.
      Open

          public function up(): void
          {
              Schema::table('topic_richtexts', function (Blueprint $table) {
                  $table->bigInteger('length')->nullable();
              });

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicAudiosTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_audios', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicH5PsTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_h5ps', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like AddLengthAndPageCountFieldsToTopicPdfsTable::up(). The configured minimum method name length is 3.
      Open

          public function up(): void
          {
              Schema::table('topic_pdfs', function (Blueprint $table) {
                  $table->bigInteger('length')->nullable();
                  $table->integer('page_count')->nullable();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like AddLengthColumnToTopicVideosTable::up(). The configured minimum method name length is 3.
      Open

          public function up(): void
          {
              Schema::table('topic_videos', function (Blueprint $table) {
                  $table->bigInteger('length')->nullable();
              });

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicImagesTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_images', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicPdfsTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_pdfs', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

      Avoid using short method names like CreateTopicScormScosTable::up(). The configured minimum method name length is 3.
      Open

          public function up()
          {
              Schema::create('topic_scorm_scos', function (Blueprint $table) {
                  $table->bigIncrements('id');
                  $table->timestamps();

      ShortMethodName

      Since: 0.2

      Detects when very short method names are used.

      Example

      class ShortMethod {
          public function a( $index ) { // Violation
          }
      }

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

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

          public function fixAssetPaths(): array
          {
              $topic = $this->topic;
              $course = $topic->lesson->course;
              $destinationValue = sprintf(
      Severity: Minor
      Found in src/Models/TopicContent/Video.php - About 1 hr to fix

        Each class must be in a namespace of at least one level (a top-level vendor name)
        Open

        class CreateTopicRichtextsTable extends Migration

        Each class must be in a namespace of at least one level (a top-level vendor name)
        Open

        class CreateTopicCmi5AusTable extends Migration

        Each class must be in a namespace of at least one level (a top-level vendor name)
        Open

        class CreateTopicScormScosTable extends Migration

        Each class must be in a namespace of at least one level (a top-level vendor name)
        Open

        class CreateTopicH5PsTable extends Migration
        Severity
        Category
        Status
        Source
        Language