Skip to content

Help Clean the legacy code up!

Jonathan Foote edited this page Mar 3, 2022 · 2 revisions

The GeoCore software has been around a long time! More than 2 decades now, and still going.

The fact is that the software pre-dates modern tools like phpcs and phpstan. It still has a lot of PHP 4 specific code in it despite requiring PHP 7 to run.

Since the software community is still active and the software is still being used by many, we're looking to improve things!

We need volunteers:

Fix reported errors in code sniffing tools

To help, you can use this composer command:

composer scan-all

That will generate 2 files, cs-check.txt and stan.txt. In them will be the scan results of the respective tool.

Note: Try not to be overwhelmed! I think we can do it if we tackle the problems in "chunks". We've already eliminated a lot of the errors found.

End Game Goals:

The end goal is to fix all existing errors from both tools.

Once all the errors from a tool are fixed, we should add that scan to pre-commit hook (if it is able to run in less than 30 seconds). In addition, we hope to make a github action to run the scans on PR's in case they are skipped, since it is possible to skip pre commit hooks on the local environment.

cs-check

Note that cs-check currently has a number of "rules" that are ignored. Once cs-check starts passing, we might want to try lifting a rule at a time. Some rules will require major refactor across the board, so depending on usage, we may decide not to remove them in the short term.