forked from phoedos/pmd
Various docs tweaks; thx to Jarkko Hietaniemin for the suggestions
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3919 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -29,7 +29,7 @@ mkdir ~/tmp/pmd-3.3/bin
|
||||
mkdir ~/tmp/pmd-3.3/lib
|
||||
cp ../LICENSE.txt changelog.txt ~/tmp/pmd-3.3/etc
|
||||
cd ../bin/
|
||||
cp pmd.* cygwin-run.sh build.xml cpdgui.bat designer.* ~/tmp/pmd-3.3/bin
|
||||
cp pmd.* cygwin-run.sh build.xml cpd.sh cpdgui.bat designer.* ~/tmp/pmd-3.3/bin
|
||||
cd ../etc/
|
||||
cp ../lib/pmd-3.3.jar ../lib/xmlParserAPIs-2.6.2.jar ../lib/xercesImpl-2.6.2.jar ../lib/jaxen-1.1-beta-7.jar ~/tmp/pmd-3.3/lib/
|
||||
mkdir ~/tmp/pmd-3.3/etc/xslt
|
||||
|
@ -90,15 +90,17 @@ public class CPD {
|
||||
|
||||
try {
|
||||
String lang = LanguageFactory.JAVA_KEY;
|
||||
Renderer renderer = new SimpleRenderer();
|
||||
if (args.length > 2) {
|
||||
lang = args[2];
|
||||
}
|
||||
LanguageFactory f = new LanguageFactory();
|
||||
Language language = f.createLanguage(lang);
|
||||
|
||||
Renderer renderer = new SimpleRenderer();
|
||||
if (args.length > 3) {
|
||||
renderer = CPD.getRendererFromString(args[3]);
|
||||
}
|
||||
LanguageFactory f = new LanguageFactory();
|
||||
Language language = f.createLanguage(lang);
|
||||
|
||||
CPD cpd = new CPD(Integer.parseInt(args[0]), language);
|
||||
cpd.addRecursively(args[1]);
|
||||
cpd.go();
|
||||
|
@ -33,6 +33,7 @@ public class CPPTokenizer implements Tokenizer {
|
||||
tokenEntries.add(TokenEntry.getEOF());
|
||||
System.out.println("Added " + sourceCode.getFileName());
|
||||
} catch (TokenMgrError err) {
|
||||
err.printStackTrace();
|
||||
System.out.println("Skipping " + sourceCode.getFileName() + " due to parse error");
|
||||
List emptyCode = new ArrayList();
|
||||
emptyCode.add("");
|
||||
|
@ -22,7 +22,9 @@
|
||||
<p>Each rewrite made it much faster, and now it can process the JDK 1.4 java.* packages in about 4 seconds (on my workstation, at least).</p>
|
||||
<p>Here's a <a href="images/screenshot_cpd.png">screenshot</a> of CPD after running on the JDK java.lang package.</p>
|
||||
<p>Note that CPD works with Java, C, C++, and PHP code.</p>
|
||||
<p>If you have <a href="http://java.sun.com/products/javawebstart/">Java Web Start</a>, you can <a href="cpd.jnlp">run CPD by clicking here</a>.</p>
|
||||
<p>CPD is included with PMD, which you can download <a href="http://sourceforge.net/project/showfiles.php?group_id=56262">here</a>.
|
||||
Or, if you have <a href="http://java.sun.com/products/javawebstart/">Java Web Start</a>, you can <a href="cpd.jnlp">run CPD by clicking here</a>.
|
||||
</p>
|
||||
<p><a href="cpdresults.txt">Here</a> are the duplicates CPD found in the JDK 1.4 source code.</p>
|
||||
<p><a href="cpp_cpdresults.txt">Here</a> are the duplicates CPD found in the APACHE_2_0_BRANCH branch of Apache
|
||||
(just the <code>httpd-2.0/server/</code> directory).</p>
|
||||
@ -47,6 +49,11 @@
|
||||
The same guidelines apply.
|
||||
</p>
|
||||
<p>Also, you can get verbose output from this task by running ant with the <code>-v</code> flag; i.e., <code>ant -v -f mybuildfile.xml cpd</code>.</p>
|
||||
<p>Note that CPD is pretty memory-hungry; you may need to give Java more memory to run it, like this:
|
||||
<source>
|
||||
$ java -Xmx512m net.sourceforge.pmd.cpd.CPD 100 /path/to/my/src
|
||||
</source>
|
||||
</p>
|
||||
<p>There's also a JavaSpaces version available for splitting the CPD effort across a farm of machines.
|
||||
I usually post news on that <a href="http://cpd.jini.org/">here</a> and the releases are <a href="http://sf.net/projects/pmd/">here</a>.
|
||||
This project is pretty much dead, though, since the current code is fast enough to just run it on one machine.</p>
|
||||
|
@ -45,6 +45,7 @@
|
||||
</subsection>
|
||||
<subsection name="Contributors">
|
||||
<ul>
|
||||
<li>Jarkko Hietaniemin - several CPD documentation suggestions, noted missing CPD scripts in binary release</li>
|
||||
<li>dvholten - formatting suggestions for HTML report, test cases for ConstructorCallsOverridableMethod, reported several NullAssignment bugs</li>
|
||||
<li>Olaf Heimburger - code changes to get JDeveloper plugin working under JDev 10.1.3 EA</li>
|
||||
<li>Brian Duff - helped get Oracle JDeveloper plugin working</li>
|
||||
|
@ -7,7 +7,7 @@
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="How to install PMD">
|
||||
<section name="How to install PMD (and CPD)">
|
||||
|
||||
<subsection name="Windows">
|
||||
<p>
|
||||
@ -42,6 +42,7 @@
|
||||
[tom@hal tmp]$
|
||||
</source>
|
||||
</p>
|
||||
<p>Note that the PMD jar file contains the <a href="cpd.html">CPD</a> utility as well.</p>
|
||||
</subsection>
|
||||
|
||||
</section>
|
||||
|
@ -15,7 +15,6 @@
|
||||
href="http://sourceforge.net" />
|
||||
</links>
|
||||
<menu name="Overview">
|
||||
<item name="Installation" href="/installing.html" />
|
||||
<item name="PMD in the news" href="/news.html" />
|
||||
<item name="PMD-related products and books" href="/products.html" />
|
||||
<item name="Best practices" href="/bestpractices.html" />
|
||||
@ -26,6 +25,7 @@
|
||||
<item name="What does 'PMD' mean?" href="/meaning.html" />
|
||||
</menu>
|
||||
<menu name="Usage">
|
||||
<item name="Installation" href="/installing.html" />
|
||||
<item name="Command line usage" href="/running.html" />
|
||||
<item name="Ant task usage" href="/ant-task.html" />
|
||||
<item name="Maven plugin usage" href="/maven-plugin.html" />
|
||||
|
Reference in New Issue
Block a user