Scott McKellar wrote:
--- Dan Scott <[EMAIL PROTECTED]> wrote:

<snip>

I just ran PMD (a code copy & paste detector from
http://pmd.sourceforge.net/) against OpenSRF trunk and it found some
large chunks of duplicated code that we could probably refactor into
a
single shared block of code - rationale being that duplicated code is
eventually likely to have a bug fixed in one place but missed in the
other. The output is attached.

I looked very briefly at the reported code duplications.

Most of the duplication is between two different version of the
JSON-handling code.  Not surprisingly, these two versions have a
lot in common.  I don't know what Bill plans to do with the older
version.
I had planned to wade into the newer JSON code, applying my usual
fetishes about const-correctness, static functions, and the like.
However if we're going to abstract out the commonalities between the
new JSON code and the old JSON code, I should hold off on my efforts
so that I can do it just once.


Ideally, the old JSON code would be removed from the repository over the next 6-12 months. It's probably not worth de-duplicating.

The other duplications are in the patch directory.  I've never looked
at this directory before but it appears to contain patched versions
of jabberd code.  In the case of nad.c I suspect (but have not
verified) that the duplication occurs because of conditional compilation -- two similar blocks of code chosen through #ifdefs.
Anyway I don't think we want to mess with jabberd code if we don't
have to.

I have removed the jabber2d patch files. They were out of date and we generally recommend Ejabberd over jabber2d.

Thanks, guys.

-bill

--
Bill Erickson
| VP, Software Development & Integration
| Equinox Software, Inc. / The Evergreen Experts
| phone: 877-OPEN-ILS (673-6457)
| email: [EMAIL PROTECTED]
| web: http://esilibrary.com

Reply via email to