diff --git a/docs/composer/plugin/drupal-dev-environment/index.md b/docs/composer/plugin/drupal-dev-environment/index.md index ad1ff7fe37c2da0672a0501b1062bb35ae9ab79b..5fea776709a33c01396869e7aa14d87877bccf26 100644 --- a/docs/composer/plugin/drupal-dev-environment/index.md +++ b/docs/composer/plugin/drupal-dev-environment/index.md @@ -15,11 +15,10 @@ It provides a massive amount of testing tools, which can be executed out of the - [Dependency Analysis](../../../dev_tools/test.md#drupal-dependency-analysis) - [PHP Unit](../../../dev_tools/test.md#unitkernelfunctional-testing) - [PHP Code Sniffer](../../../dev_tools/test.md#php-code-sniffer) -- [PHP PHPStan](../../../dev_tools/test.md#php-stan) -- [PHP Lint](../../../dev_tools/test.md#php-code-sniffer) +- [PHP Stan](../../../dev_tools/test.md#php-stan) +- [PHP Lint](../../../dev_tools/test.md#php-lint) - [PHP LOC](../../../dev_tools/test.md#php-loc) - [PHP Mess Detection](../../../dev_tools/test.md#php-mess-detection) -- [PHP Copy and Paste Detector](../../../dev_tools/test.md#php-code-sniffer) -- [PHP Metrics](../../../dev_tools/test.md#php-code-sniffer) +- [PHP Metrics](../../../dev_tools/test.md#php-metrics) - [PHP Stylelint](../../../dev_tools/test.md#php-code-sniffer) - [Eslint](../../../dev_tools/test.md#php-code-sniffer) diff --git a/docs/dev_tools/test.md b/docs/dev_tools/test.md index 6f521c125aee8108cc7bc82c572c9d4f58161614..2e387e3566cc4f0b78f6c2bbfddd1bda15912108 100644 --- a/docs/dev_tools/test.md +++ b/docs/dev_tools/test.md @@ -44,11 +44,10 @@ We have several tools to perform static code analysis. - [PHP Code Sniffer](#php-code-sniffer) - [PHP PHPStan](#php-stan) -- [PHP Lint](#php-code-sniffer) +- [PHP Lint](#php-lint) - [PHP LOC](#php-loc) - [PHP Mess Detection](../../../dev_tools/test.md#php-mess-detection) -- [PHP Copy and Paste Detector](../../../dev_tools/test.md#php-code-sniffer) -- [PHP Metrics](../../../dev_tools/test.md#php-code-sniffer) +- [PHP Metrics](#php-metrics) - [PHP Stylelint](../../../dev_tools/test.md#php-code-sniffer) - [Eslint](../../../dev_tools/test.md#php-code-sniffer) @@ -134,6 +133,22 @@ a test phpstan <file_ordirectory> Whether it is a directory, it runs the analysis for everything under this directory recursively. +### PHP Lint + +You can execute PHP Lint for a specific Drupal contrib module: + +```phplint +a test phplintmodule <contrib_module> +``` + +Now the entire code in that module will be analysed. + +If you want to analyse a custom module, just do the following: + +```phplint +a test phplintmodule ../custom/<custom_module> +``` + ### PHP LOC PHP LOC prints several metrics about your code, like the average size of a class. @@ -164,6 +179,32 @@ a test phpmd <file_ordirectory> json <profile> Whether it is a directory, it runs the analysis for everything under this directory recursively. +### PHP Metrics + +This useful tool provides more information as [PHP LOC](#php-loc). It adds for example: + +- complexity +- bugs +- object-oriented programming stats +- coupling +- etc. + +Note: **This can take a while depending on your module.** + +You can execute PHP Metrics for a specific Drupal contrib module: + +```phpmet +a test phpmetricsmodule <contrib_module> +``` + +Now the entire code in that module will be analysed. + +If you want to analyse a custom module, just do the following: + +```phpmet +a test phpmetricsmodule ../custom/<custom_module> +``` + ## Unit/Kernel/Functional Testing To execute the tests, you can use a single command: