Project Idea - Refactoring Codebase and Adding Some Coding standard

Honorable Mentors,

As i was exploring the codebase from a few days now i was not sattisfied with the current coding standards. Many files are not well linted and some files have unnecessary comments and some having deprecated code.Till now mostly i was into interface part and that could be refactored very much there might be more part of codebase which could have potintial to refactor we can discuss that below.But for Coding Standard as we are mostly using PHP in the codebase (image ) we can introduce PEAR Coding style with the help of phpcs.
The Goal here is to have clean and readable code for contributors so that there would be a great Future for OpenEMR

Thanks you
Yash Bothra

1 Like

hi @yashrajbothra, could see this as part of Project - Automated Testing, check out how in the codebase travis.yml and the ci directory is handling the phpcs if you haven’t already

1 Like

We already have a coding standard in place, a big issue is making legacy code comply. But if I remember we did some automated linting and should have a pretty decent coverage rate. See https://www.open-emr.org/wiki/index.php/Development_Policies#PHP

Hii @robert.down @stephenwaite I totally agree on the point that we have coding standard but it seems the whole codebase is not following it

hi @yashrajbothra, correct, there’s only certain files that are being scanned rn, like can be see in travis.yml

hi,

Regarding php_codesniffer run by travis.

The only places that are skipped by the php_codesniffer are the gacl directory and a couple classes:

Note that we are NOT fully PSR2 compliant though and are skipping below rules:

Quick aside, this line can be removed if anybody wants a quick PR:

1 Like

I would recommend moving the non-compliant code towards the standard we already have in place versus attempting to begin following a new standard

1 Like