Skip to content

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

Description

@Alkarex

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 #524 (comment)

In JSON, and then in the FreshRSS Web UI

This is the current output in PHPStan level 0:

$ 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedphpPull requests that update Php code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions