Identify and eliminate code duplication (100+ lines) #2BRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: erikgTags: C, programming, refactoring, reduction

BRL-CAD is huge.  With any large body of code, one inevitably ends up with a mix of good and bad coding practices.  On the whole, BRL-CAD is actually better than most but we are constantly working on improving the code.  This includes eliminating duplication.

References:

  • http://en.wikipedia.org/wiki/Don't_repeat_yourself
  • http://brlcad.org/wiki/Code_Cleanup
  • http://brlcad.org/wiki/Compiling
  • http://brlcad.org/wiki/SVN

This task involves reducing BRL-CAD's source code by 100 or more lines of code by refactoring and eliminating duplicate code.  You can use whatever method you like to identify duplication, but beware that there are more than 1 million lines of code in BRL-CAD, so you're not likely going to find this duplication just by browsing.

We suggest using a code duplication detection tool like Simian.  See our Code_Cleanup page for details.

Download our latest Subversion trunk sources and make sure you can compile cleanly first.  Then you can run Simian or do whatever you need to find sources of code duplication.  Make your edits, then make sure the code still compiles (run "make", "make test", "make regress" and "make benchmark" to test your changes).  Finally, create and submit a patch file of your changes (see the references, svn will create the patch file for you).

Feel free to join the brlcad-devel mailing list or IRC channel to discuss your changes beforehand.

Uploaded Work
File name/URLFile sizeDate submitted
duplicate_removal_1.diff17.0 KBDecember 30 2013 08:14 UTC
Comments
Peter Amidonon December 30 2013 05:59 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on December 30 2013 06:04 UTCTask Assigned

This task has been assigned to Andromeda Galaxy. You have 72 hours to complete this task, good luck!

Peter Amidonon December 30 2013 08:14 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 30 2013 08:24 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on December 30 2013 08:27 UTCwdb functions

Just so you know, many/most of the code in the src/libged/wdb_*.c files are deprecated/duplicated and scheduled for consolidation/refactoring/removal.  Any work you do there that helps us get closer is appreciated.  They're almost entirely duplication of other code with subtle type changes.