We are using TSF 2010 as code repository and the TFS code churn is not giving good results to compute Added, Modified and Deleted LOCs.
The built-in LOC counter ins the dashboard gives betters results. As there is no TFS integration, we made a little C# app that allows us to retrieve the original and modified versions of all files from a TFS changeset and save it on 2 folders on the file system. It would be great to be able to pass the two folders to the LOC counter to get the html report.
Is there any possibility ( shell command, URLwith params, …) to call the counter ?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, there is. Execute a command line of the form:
java -cp "<full directory path to>pspdash.jar" net.sourceforge.processdash.tool.diff.ui.LOCDiffCmdLineMain <options> dirA dirB
Where <full directory path to> is the directory where the Process Dashboard is installed (e.g. C:\Program Files\Process Dashboard).
If you run this with no <options>, it will compare the two directories, create an HTML change report, and display the report in your web browser.
You can use the option "-dest filename" to write the report to a file instead of opening it in your web browser.
If you don't care about the HTML change report and you just want counts, provide the option "-xml". This will write an XML document to stdout, or to whatever filename you provided via the "-dest" option.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
when not using the -xml option, it creates the html output file. But if i provide the -xml option (with or without the option -dest <filename>), i get an exception :
Exception in thread "main" java.lang.NullPointerException
at net.sourceforge.processdash.tool.diff.ui.XmlDiffReportWriter.writeLocCounts(XmlDiffReportWriter.java:104)
at net.sourceforge.processdash.tool.diff.ui.XmlDiffReportWriter.fileAnalysisFinished(XmlDiffReportWriter.java:84)
at net.sourceforge.processdash.tool.diff.engine.DiffEngine.fireFileAnalysisFinished(DiffEngine.java:212)
at net.sourceforge.processdash.tool.diff.engine.DiffEngine.analyzeFileAndFireEvents(DiffEngine.java:180)
at net.sourceforge.processdash.tool.diff.engine.DiffEngine.run(DiffEngine.java:153)
at net.sourceforge.processdash.tool.diff.impl.file.Main.run(Main.java:90)
at net.sourceforge.processdash.tool.diff.impl.file.Main.main(Main.java:95)
at net.sourceforge.processdash.tool.diff.ui.LOCDiffCmdLineMain.main(LOCDiffCmdLineMain.java:34)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry about that! But thank you for reporting the error - I'll get it fixed in the next release of the Process Dashboard.
In the meantime, I've created a small JAR file for you that includes a fix for this error. This JAR file only contains the logic needed to count LOC, so it is small. You can download it from:
Hi,
We are using TSF 2010 as code repository and the TFS code churn is not giving good results to compute Added, Modified and Deleted LOCs.
The built-in LOC counter ins the dashboard gives betters results. As there is no TFS integration, we made a little C# app that allows us to retrieve the original and modified versions of all files from a TFS changeset and save it on 2 folders on the file system. It would be great to be able to pass the two folders to the LOC counter to get the html report.
Is there any possibility ( shell command, URLwith params, …) to call the counter ?
Thanks
Yes, there is. Execute a command line of the form:
java -cp "<full directory path to>pspdash.jar" net.sourceforge.processdash.tool.diff.ui.LOCDiffCmdLineMain <options> dirA dirB
Where <full directory path to> is the directory where the Process Dashboard is installed (e.g. C:\Program Files\Process Dashboard).
If you run this with no <options>, it will compare the two directories, create an HTML change report, and display the report in your web browser.
You can use the option "-dest filename" to write the report to a file instead of opening it in your web browser.
If you don't care about the HTML change report and you just want counts, provide the option "-xml". This will write an XML document to stdout, or to whatever filename you provided via the "-dest" option.
Thanks :)
when not using the -xml option, it creates the html output file. But if i provide the -xml option (with or without the option -dest <filename>), i get an exception :
Exception in thread "main" java.lang.NullPointerException
at net.sourceforge.processdash.tool.diff.ui.XmlDiffReportWriter.writeLocCounts(XmlDiffReportWriter.java:104)
at net.sourceforge.processdash.tool.diff.ui.XmlDiffReportWriter.fileAnalysisFinished(XmlDiffReportWriter.java:84)
at net.sourceforge.processdash.tool.diff.engine.DiffEngine.fireFileAnalysisFinished(DiffEngine.java:212)
at net.sourceforge.processdash.tool.diff.engine.DiffEngine.analyzeFileAndFireEvents(DiffEngine.java:180)
at net.sourceforge.processdash.tool.diff.engine.DiffEngine.run(DiffEngine.java:153)
at net.sourceforge.processdash.tool.diff.impl.file.Main.run(Main.java:90)
at net.sourceforge.processdash.tool.diff.impl.file.Main.main(Main.java:95)
at net.sourceforge.processdash.tool.diff.ui.LOCDiffCmdLineMain.main(LOCDiffCmdLineMain.java:34)
Sorry about that! But thank you for reporting the error - I'll get it fixed in the next release of the Process Dashboard.
In the meantime, I've created a small JAR file for you that includes a fix for this error. This JAR file only contains the logic needed to count LOC, so it is small. You can download it from:
http://www.tuma-solutions.com/files/dashLocDiff.jar?jf
Since this file is tailored for counting LOC, you can use a shorter command line to execute it:
java -jar dashLocDiff.jar -xml dir1 dir2
Hi,
Thanks for the fix :)
And sorry for my delayed feedback ( i forgot to check the monitor check box for email notfifications).
Thansk a lot :)