CodeSniffer DrupalPractice coding standards for quant_search code

Created on 2 September 2022, almost 2 years ago
Updated 3 November 2023, 8 months ago

Problem/Motivation

#3306710: Facets are added every edit β†’ has a bunch of fixes but here are some more:

Kristens-MacBook-Pro:quant_search kristenpol$ drupalcsp .
Registering sniffs in the DrupalPractice standard... DONE (40 sniffs registered)
Creating file list... DONE (23 files in queue)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search
Processing quant_search.info.yml [PHP => 11 tokens in 11 lines]... DONE in 6ms (0 errors, 0 warnings)
Processing quant_search.routing.yml [PHP => 66 tokens in 66 lines]... DONE in 0ms (0 errors, 0 warnings)
Processing quant_search.links.task.yml [PHP => 24 tokens in 24 lines]... DONE in 0ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/css
Processing quant-search.css [CSS => 923 tokens in 160 lines]... DONE in 5ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/config/install
Processing quant_search.entities.settings.yml [PHP => 6 tokens in 6 lines]... DONE in 0ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/config/schema
Processing quant_search_page.schema.yml [PHP => 10 tokens in 10 lines]... DONE in 0ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search
Processing quant_search.module [PHP => 722 tokens in 97 lines]... DONE in 8ms (0 errors, 2 warnings)
Processing quant_search.services.yml [PHP => 12 tokens in 12 lines]... DONE in 0ms (0 errors, 0 warnings)
Processing quant_search.permissions.yml [PHP => 6 tokens in 6 lines]... DONE in 0ms (0 errors, 0 warnings)
Processing quant_search.links.action.yml [PHP => 11 tokens in 11 lines]... DONE in 0ms (0 errors, 0 warnings)
Processing quant_search.links.menu.yml [PHP => 20 tokens in 20 lines]... DONE in 0ms (0 errors, 0 warnings)
Processing quant_search.libraries.yml [PHP => 14 tokens in 14 lines]... DONE in 0ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Form
Processing SearchPagesForm.php [PHP => 511 tokens in 79 lines]... DONE in 4ms (0 errors, 6 warnings)
Processing QuantSearchPageForm.php [PHP => 3872 tokens in 503 lines]... DONE in 37ms (0 errors, 8 warnings)
Processing SearchIndexForm.php [PHP => 1295 tokens in 178 lines]... DONE in 10ms (0 errors, 10 warnings)
Processing ConfirmIndexClearForm.php [PHP => 300 tokens in 51 lines]... DONE in 3ms (0 errors, 0 warnings)
Processing SearchEntitiesForm.php [PHP => 2496 tokens in 303 lines]... DONE in 21ms (0 errors, 18 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Entity
Processing QuantSearchPage.php [PHP => 658 tokens in 144 lines]... DONE in 2ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Controller
Processing Search.php [PHP => 2814 tokens in 365 lines]... DONE in 27ms (0 errors, 7 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Routing
Processing QuantSearchRoutes.php [PHP => 311 tokens in 53 lines]... DONE in 3ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/EventSubscriber
Processing SearchEventSubscriber.php [PHP => 401 tokens in 67 lines]... DONE in 3ms (0 errors, 0 warnings)
Changing into directory /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src
Processing QuantSearchPageInterface.php [PHP => 47 tokens in 12 lines]... DONE in 0ms (0 errors, 0 warnings)
Processing QuantSearchPageListBuilder.php [PHP => 334 tokens in 37 lines]... DONE in 3ms (0 errors, 0 warnings)

FILE: /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/quant_search.module
---------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
 44 | WARNING | Unused variable $config.
 54 | WARNING | Unused variable $idx.
---------------------------------------------------------------------------------------------------------------------


FILE: /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Form/SearchPagesForm.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 62 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 63 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 66 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 71 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Form/QuantSearchPageForm.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------------------------------------------------------------------
 103 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 106 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 125 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 289 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes, use dependency injection instead
 332 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 428 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 433 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 444 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Form/SearchIndexForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  61 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  64 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  64 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  68 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  91 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  94 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 111 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 141 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Form/SearchEntitiesForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 18 WARNINGS AFFECTING 16 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  61 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  64 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  64 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  68 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  92 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  95 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 113 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 123 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 161 | WARNING | #description values usually have to run through t() for translation
 168 | WARNING | #description values usually have to run through t() for translation
 175 | WARNING | #description values usually have to run through t() for translation
 182 | WARNING | #description values usually have to run through t() for translation
 248 | WARNING | #description values usually have to run through t() for translation
 282 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 286 | WARNING | Unused variable $content_types.
 290 | WARNING | Unused variable $typeConfig.
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/kristenpol/Sites/quant/quantsearch/web/modules/contrib/quantcdn/modules/quant_search/src/Controller/Search.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  47 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  50 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  50 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  54 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 155 | WARNING | Unused variable $taxonomyEnabled.
------------------------------------------------------------------------------------------------------------------------------------------

Time: 148ms; Memory: 8MB

Steps to reproduce

  1. Go to quant_search directory
  2. Run phpcs -v --standard=DrupalPractice --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md,yml' .

Proposed resolution

Go through and clean up the ones that make sense.

Remaining tasks

  1. Update code
  2. Review and test
  3. Commit :)

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Closed: won't fix

Version

1.5

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024