WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
195 stars 39 forks source link

Refactor `Plugin_Check_Command` class to reduce `ExcessiveClassComplexity` #390

Open ernilambar opened 5 months ago

ernilambar commented 5 months ago

Would it make sense to add new abstract Abstract_Plugin_Check_Command class so that we can move few common methods from the current Plugin_Check_Command class?

Current Cyclomatic Complexity of this class around the higher limit (50). So any new addition triggers error in PHPMD.

Common and utility methods that could be moved to another class:

ernilambar commented 5 months ago

Related https://github.com/WordPress/plugin-check/pull/389

Ref: https://github.com/WordPress/plugin-check/actions/runs/7500517063/job/20432398413?pr=389