FreshRSS / FreshRSS/Extensions

Add the number of PHPStan errors to our list of third-party extensions

Open
#525 0 comments 1 reaction 0 assignees View on GitHub
help wanted php
Dominant language
PHP
Stars
712
Forks
117
Avg merge
5h 10m
Merged PRs (30d)
9

Description

We could consider adding the number of PHPStan errors to our list of third-party extensions, to get a better idea automatically of their likely compatibility / maintenance / code quality

_Originally posted by @Alkarex in https://github.com/FreshRSS/Extensions/issues/524#issuecomment-5624762314_

In JSON, and then in the FreshRSS Web UI

This is the current output in PHPStan level 0:

```console
$ composer run-script phpstan-third-party
> phpstan analyse -c phpstan-third-party.neon .
458/458 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ -------------------------------------------------------------------------------------------
Line third-party/003df625d41b62458ad6771961c1bddc4fe76d3b/xExtension-SendToMyJD2/extension.php
------ -------------------------------------------------------------------------------------------
:305 Undefined variable: $lMD
🪪 variable.undefined
------ -------------------------------------------------------------------------------------------

------ ----------------------------------------------------------------------------------------------------------------
Line third-party/71d0d525734575879efdb68094330d118b534e8a/TranslateTitlesCN/extension.php
------ ----------------------------------------------------------------------------------------------------------------
:21 Cannot instantiate class FreshRSS_UserConfiguration via private constructor Minz_Configuration::__construct().
🪪 new.privateConstructor
:21 Class FreshRSS_UserConfiguration constructor invoked with 1 parameter, 2-4 required.
🪪 arguments.count
:115 Cannot instantiate class FreshRSS_UserConfiguration via private constructor Minz_Configuration::__construct().
🪪 new.privateConstructor
:115 Class FreshRSS_UserConfiguration constructor invoked with 1 parameter, 2-4 required.
🪪 arguments.count
:166 Access to an undefined property TranslateTitlesExtension::$view.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
:176 Access to an undefined property TranslateTitlesExtension::$view.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
:177 Access to an undefined property TranslateTitlesExtension::$view.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
:182 Access to an undefined property TranslateTitlesExtension::$view.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
:183 Access to an undefined property TranslateTitlesExtension::$view.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
:189 Access to an undefined property TranslateTitlesExtension::$view.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
:190 Access to an undefined property TranslateTitlesExtension::$view.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ ----------------------------------------------------------------------------------------------------------------

------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line third-party/8c042738017d75b31bcbc23d84cfb35d6315f3a7/comics/penny-arcade.php
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
:59 Inner named functions are not supported by PHPStan. Consider refactoring to an anonymous function, class method, or a top-level-defined function. See issue #165 (https://github.com/phpstan/phpstan/issues/165) for more details.
🪪 function.inner
------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------ ------------------------------------------------------------------------------------------------
Line third-party/9581cff1782b49a2cfed9e67b94fbc5601de41c5/xExtension-ExtensionManager/extension.php
------ ------------------------------------------------------------------------------------------------
:137 Method ExtensionManagerExtension::queueInstall() has invalid return type true.
🪪 class.notFound
:191 Method ExtensionManagerExtension::queueRemove() has invalid return type true.
🪪 class.notFound
:404 Method ExtensionManagerExtension::installFromExtracted() has invalid return type true.
🪪 class.notFound
------ ------------------------------------------------------------------------------------------------

------ --------------------------------------------------------------------------------------------------------
Line third-party/9581cff1782b49a2cfed9e67b94fbc5601de41c5/xExtension-QuickFilter/lib/QuickFilterService.php
------ --------------------------------------------------------------------------------------------------------
:125 Call to an undefined static method QuickFilterService::buildMatchConditions().
🪪 staticMethod.notFound
------ --------------------------------------------------------------------------------------------------------

------ ---------------------------------------------------------------------------------------
Line third-party/95ca211e7f6c04b83bf51b07c166705938755929/extension.php
------ ---------------------------------------------------------------------------------------
:726 Access to an undefined property FeedDigestExtension::$test_result.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
:727 Access to an undefined property FeedDigestExtension::$test_success.
🪪 property.notFound
💡 Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
------ ---------------------------------------------------------------------------------------

------ ---------------------------------------------------------------------
Line third-party/ff93e7bdfeac04a02f76b1b3b87f43422186f1c7/extension.php
------ ---------------------------------------------------------------------
:588 Access to an undefined static property FreshRSS_Context::$category.
🪪 staticProperty.notFound
:604 Access to an undefined static property FreshRSS_Context::$feed.
🪪 staticProperty.notFound
:627 Access to an undefined static property FreshRSS_Context::$category.
🪪 staticProperty.notFound
------ ---------------------------------------------------------------------


[ERROR] Found 22 errors

Script phpstan analyse -c phpstan-third-party.neon . handling the phpstan-third-party event returned with error code 1
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the composer run-script phpstan-third-party command and how third-party extension data is serialized to JSON. Then locate the FreshRSS Web UI that lists those extensions and determine how the PHPStan error count should be represented. Done means the generated JSON contains the count and the UI displays it consistently for each extension.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.