Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#253 Unused code in CDK classes

closed
nobody
None
5
2012-10-08
2005-02-01
Egon Willighagen
No

PMD reports on their website [1] quite some unused code bringing CDK
almost at the bottom of the list. These things are very easy to fix. Just
look at the file and line number on [1], remove the unused code,
recompile and test (ant clean test-all), and commit to CVS.

  1. http://pmd.sf.net/reports/cdk_cdk.html

Discussion

  • Logged In: YES
    user_id=25678

    I've noted that in some cases the code is not completely
    unused, e.g.

    cdk/test/iupac/ParserTest.java

    where things are done like:

    public void testUnconnectingGroup() 
    { 
        try 
        { 
            Molecule parserMolecule =
    

    NomParser.generate("7-chloropentane");
    fail("Molecule was successfully generated but should
    have thrown a ParseException");
    } catch (ParseException pe) {
    assertTrue (true);
    } catch (CDKException exception) {
    fail(exception.getMessage());
    }
    }

    In such cases it might be possible to remove the assignment
    only, but the part after the '=' must be kept.

    Egon

     
  • Logged In: YES
    user_id=25678

    This is really a maintainance task.

     
  • Logged In: YES
    user_id=25678

    Nightly nicely makes these bits of unused code
    transparent, and easy to fix. With that, it may be
    considered bugs, and no longer maintenance.

     
  • Logged In: YES
    user_id=25678
    Originator: YES

    Actually, most code is fixed. Consider this addressed.