# Help in reducing openmrs-core codebase

**URL:** <https://talk.openmrs.org/t/help-in-reducing-openmrs-core-codebase/12863>\
**Category:** Development\
**Tags:** core\
**Created:** [August 12, 2017, 8:35am UTC](https://talk.openmrs.org/t/help-in-reducing-openmrs-core-codebase/12863 "2017-08-12T08:35:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [August 12, 2017, 8:35am UTC](https://talk.openmrs.org/t/help-in-reducing-openmrs-core-codebase/12863/1 "2017-08-12T08:35:58Z")

</div>

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:

> <https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/util/Security.java#L226>

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!

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [August 12, 2017, 6:20pm UTC](https://talk.openmrs.org/t/help-in-reducing-openmrs-core-codebase/12863/2 "2017-08-12T18:20:08Z")

</div>

Great initiative @teleivo 😄  
I would support deprecating such code.

---

<div class="post-metadata">

**Author:** ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)\
**Post date:** [August 13, 2017, 12:28am UTC](https://talk.openmrs.org/t/help-in-reducing-openmrs-core-codebase/12863/3 "2017-08-13T00:28:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![teleivo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/teleivo/32/2015_2.png) [@teleivo](https://talk.openmrs.org/u/teleivo)\
**Post date:** [August 13, 2017, 6:06am UTC](https://talk.openmrs.org/t/help-in-reducing-openmrs-core-codebase/12863/4 "2017-08-13T06:06:01Z")

</div>

> [@darius](#):
>
> 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 [[TRUNK-5207] - OpenMRS Issues](https://issues.openmrs.org/browse/TRUNK-5207) If others are in favor of deprecating I can adjust the ticket

---

<div class="post-metadata">

**Author:** ![wyclif](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wyclif/32/19607_2.png) [@wyclif](https://talk.openmrs.org/u/wyclif)\
**Post date:** [August 14, 2017, 6:41pm UTC](https://talk.openmrs.org/t/help-in-reducing-openmrs-core-codebase/12863/5 "2017-08-14T18:41:39Z")

</div>

> [@teleivo](#):
>
> Is our public API only considered to be in org.openmrs.api ?

Not really.

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