Menu

External access to the folder LOC counter

2012-11-08
2012-12-09
  • Vincent Rogier

    Vincent Rogier - 2012-11-08

    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

     
  • David Tuma

    David Tuma - 2012-11-08

    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.

     
  • Vincent Rogier

    Vincent Rogier - 2012-11-14

    Thanks :)

     
  • Vincent Rogier

    Vincent Rogier - 2012-11-14

    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)

     
  • David Tuma

    David Tuma - 2012-11-14

    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

     
  • Vincent Rogier

    Vincent Rogier - 2012-11-26

    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 :)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.