Integrating PMD to check Java sources

Home Forums Multi-Edit User/Developer Additional Language/Compiler Support Integrating PMD to check Java sources

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2470
    arjan
    Participant

    PMD can be used to check Java sources for common problems. When installed as compiler, it will take advantage of ME’s error handling.

    Download PMD from http://pmd.sf.net.

    To add PMD to Multi-Edit, create a new compiler for files with the Java extension, with the following options (see pmd1.png below):

    The command-line should read:

    [code:1cpljey8]<LFN>D:\java\pmd-4.2.4\bin\pmd.bat -shortnames <NAME>.<EXT> net.sourceforge.pmd.renderers.TextPadRenderer basic,imports,unusedcode[/code:1cpljey8]

    Create a new Program Type for this compiler, with the following settings (see pmd2.png below):

    Search: ^([^(]+)\(([0-9]+), (.#)$
    Replace: /F=\0/L=\1/M=\2

    That’s it!

    Now press F9 when editing a Java file and run PMD. The errors will be shown in the error pane and are clickable.

    It is also possible to run PMD on all files in the current directory, just use the following command-line instead:
    [code:1cpljey8]<LFN>D:\java\pmd-4.2.4\bin\pmd.bat -shortnames <PATH>
    net.sourceforge.pmd.renderers.TextPadRenderer basic,imports,unusedcode[/code:1cpljey8]

    .
    pmd2.PNG
    pmd1.PNG

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.