Review main Merged

86266[TASK] Add MethodCallArgumentValue PhpScanner analysis

Garvin Hicking CR +2 V +2 Hard +508 −0 updated 11/18/24, 16:43

Commit message

The static code scanner is now able to inspect scalar
value arguments in static or non-static method calls.

This allows for example to inspect calls to:

  TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin()
  TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin()

and see if for example the second argument contains the
value 'list_type'.

Since this is done via static code analysis, this does NOT work
dynamic variable assignments like:

```
$somevar = 'list_type';
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
    $arg1,
    $somevar
)
```

or other nested method calls:

```
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
    $arg1,
    Helper::getArgument(),
)
```

Fully qualified static method calls are resolved as a 'strong' match,
non-static method calls as 'weak' matches.

Multiple entries in the 'argumentMatches' configuration allow
to match multiple arguments (AND combined).

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Torben Hansen +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Torben Hansen +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 3

Files 5

Review log 1220

  1. Garvin Hicking uploaded patch set 1 09/23/24, 11:59

  2. core-ci voted on patch set 1 V +1 09/23/24, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66438

  3. Garvin Hicking updated the commit message in patch set 2 V +1 10/26/24, 12:24

  4. Garvin Hicking updated the commit message in patch set 3 10/26/24, 12:27

  5. core-ci voted on patch set 2 V -1 10/26/24, 12:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68664

  6. core-ci voted on patch set 3 V -1 10/26/24, 12:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68666

  7. Garvin Hicking rebased onto patch set 4 V -1 10/26/24, 13:05

  8. Garvin Hicking updated the commit message in patch set 5 10/26/24, 13:06

  9. core-ci voted on patch set 4 V +1 10/26/24, 13:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68669

  10. core-ci voted on patch set 5 V +1 10/26/24, 13:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68670

  11. Garvin Hicking updated the commit message in patch set 6 V +1 10/30/24, 10:35

  12. core-ci voted on patch set 6 V +1 10/30/24, 10:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68841

  13. Garvin Hicking uploaded patch set 7 V +1 10/30/24, 10:47

    Adapt to current state
  14. core-ci voted on patch set 7 V +1 10/30/24, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68843

  15. Garvin Hicking uploaded patch set 8 V +1 11/18/24, 15:35

    Adjust matcher configuration for multiple matches
  16. Christian Kuhn voted on patch set 8 CR +1 V +1 11/18/24, 15:38

  17. core-ci voted on patch set 8 V +1 11/18/24, 15:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69605

  18. Torben Hansen voted on patch set 8 CR +1 V +1 11/18/24, 16:08

  19. Garvin Hicking voted on patch set 8 CR +2 V +2 11/18/24, 16:43

  20. Garvin Hicking merged patch set 9 11/18/24, 16:43