Skip to content

Add reusable code complexity workflow #8#10

Open
olatechpro wants to merge 6 commits into
developmentfrom
code-complexity-analysis
Open

Add reusable code complexity workflow #8#10
olatechpro wants to merge 6 commits into
developmentfrom
code-complexity-analysis

Conversation

@olatechpro
Copy link
Copy Markdown

@olatechpro olatechpro commented May 18, 2026

The workflow should identify overly complex functions/classes that might need refactoring using PHPMetrics to surface cognitive complexity issues to fix #8

Edit:

@andergmartins I initally used PHPMetrics but later switched to PHPMD, due to PHPMetrics not showing affected file lines and code.

@andergmartins @stevejburge I tested this on cart here https://github.com/publishpress/publishpress-cart/pull/197 which ofcourse I expect to have alot of violations as can be seen in the workflow failing results https://github.com/publishpress/publishpress-cart/actions/runs/26032382011/job/76521454324?pr=197, that contain thousands of violation.

It's very similar to WordPress VIP scan but only for coding standard. So, this is ideally not usable unless the whole plugin is refactor. Most of our plugins will probably failed this workflow too but maybe it worth keeping for future use hoping our plugins will one day meet the right standard, if not old but new future plugins by having this test on them from the beginning?

@olatechpro olatechpro marked this pull request as ready for review May 18, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add reusable code complexity workflow

1 participant