Strimoid/Strimoid

View on GitHub

Showing 559 of 559 total issues

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

    public function up(): void
    {
        Schema::create('user_followed_users', function (Blueprint $table) {
            $table->integer('source_id')->unsigned();
            $table->foreign('source_id')

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 CreateEntryRepliesTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('entry_replies', function (Blueprint $table) {
            $table->increments('id');

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 CreateNotificationTargetsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('notification_targets', function (Blueprint $table) {
            $table->integer('notification_id')->unsigned();
            $table->foreign('notification_id')->references('id')->on('notifications')->onDelete('cascade');

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 CreateGroupsModeratorsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('group_moderators', function (Blueprint $table) {
            $table->increments('id');

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 CreateFailedJobsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('failed_jobs', function (Blueprint $table) {
            $table->increments('id');
            $table->text('connection');

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 CreateCommentsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->increments('id');

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 CreateUserSubscribedGroupsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('user_subscribed_groups', function (Blueprint $table) {
            $table->integer('group_id')->unsigned();
            $table->foreign('group_id')

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 ::s(). The configured minimum method name length is 3.
Open

    function s($str, string $encoding = null): Stringy
    {
        return new Stringy($str, $encoding);
    }
Severity: Minor
Found in app/utils.php by phpmd

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 CreatePasswordResetsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('password_resets', function (Blueprint $table) {
            $table->string('email')->index();
            $table->string('token')->index();

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 CreateFolderGroupsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('folder_groups', function (Blueprint $table) {
            $table->integer('folder_id')->unsigned();
            $table->foreign('folder_id')

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 CreateSavesTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('saves', function (Blueprint $table) {
            $table->integer('element_id')->unsigned();
            $table->string('element_type');

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 CreateGroupsBansTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('group_bans', function (Blueprint $table) {
            $table->increments('id');

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 CreateUserSettingsTable::up(). The configured minimum method name length is 3.
Open

    public function up(): void
    {
        Schema::create('user_settings', function (Blueprint $table) {
            $table->string('key');

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 getUrlAttribute has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getUrlAttribute(): ?string
    {
        $url = null;
        $params = null;

Severity: Minor
Found in app/Models/Notification.php - About 1 hr to fix

    Function charCount has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      $.fn.charCount = function (options) {
    
        // default configuration properties
        var defaults = {
          allowed: 140,
    Severity: Minor
    Found in resources/assets/js/plugins/jquery.charcount.js - About 1 hr to fix

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

              $body = preg_replace_callback('/(?<=^|\s)u\/([a-z0-9_-]+)(?=$|\s|:|.)/i', function ($matches) {
                  $target = User::name($matches[1])->first();
      
                  if ($target) {
                      return '[u/' . str_replace('_', '\_', (string) $target->name) . '](/u/' . $target->name . ')';
      Severity: Major
      Found in app/utils.php and 1 other location - About 1 hr to fix
      app/utils.php on lines 58..66

      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 105.

      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

              $body = preg_replace_callback('/(?<=^|\s)@([a-z0-9_-]+)(?=$|\s|:|.)/i', function ($matches) {
                  $target = User::name($matches[1])->first();
      
                  if ($target) {
                      return '[@' . str_replace('_', '\_', (string) $target->name) . '](/u/' . $target->name . ')';
      Severity: Major
      Found in app/utils.php and 1 other location - About 1 hr to fix
      app/utils.php on lines 48..56

      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 105.

      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

        return template({
          username: username,
          observe_class: window.observed_users.includes(username) ? 'btn-success' : 'btn-light',
          block_class: window.blocked_users.includes(username) ? 'btn-danger' : 'btn-light'
        })
      Severity: Major
      Found in resources/assets/js/modules/users.js and 1 other location - About 1 hr to fix
      resources/assets/js/modules/groups.js on lines 59..63

      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 59.

      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

        return template({
          groupname: groupname,
          subscribe_class: window.subscribed_groups.includes(groupname) ? 'btn-success' : 'btn-light',
          block_class: window.blocked_groups.includes(groupname) ? 'btn-danger' : 'btn-light'
        })
      Severity: Major
      Found in resources/assets/js/modules/groups.js and 1 other location - About 1 hr to fix
      resources/assets/js/modules/users.js on lines 72..76

      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 59.

      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 using undefined variables such as '$data' which will lead to PHP notices.
      Open

              $data['group'] = $group;

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Severity
      Category
      Status
      Source
      Language