Help in reducing openmrs-core codebase

Tags: #<Tag:0x00007fe2eca47b40>

Hi there!

I am constantly sifting through openmrs-core trying to find ways to improve it. One point was to increase code coverage so we can refactor/add features with confidence. This has proven to be a slow process, as the code base is big and adding tests after writing code is not the easiest.

What I noticed is that there is probably potential for removing/deprecating code that was once used but isnt anymore.

One example:

encrypt/decrypt (these methods are only referenced in the SecurityTest; also no other code under the openmrs org on github references it).

Would be great to get support on this!

1 Like

Great initiative @teleivo :smile:
I would support deprecating such code.

Strictly speaking this isn’t part of our public API, so it wouldn’t be against the rules to just remove this instead of deprecating it.

That said, it’s odd to see a method introduced in 1.9 (later than some others in that class) that isn’t used anywhere. Could it be that it’s the Security.encrypt(String) method that delegates to this that is actually used?

I looked for references in multiple ways, does not seem to be used. Also removed encrypt/decrypt and mvn clean package ran successfully.

Is our public API only considered to be in org.openmrs.api ?

I created a ticket https://issues.openmrs.org/browse/TRUNK-5207 If others are in favor of deprecating I can adjust the ticket

Not really.

In theory, the public API are the services, Util classes and domain object classes, the DAO isn’t.