[英]FindBugs generate report in different formats
I am using FindBugs in order to generate some reports for a java project. 我正在使用FindBugs为java项目生成一些报告。 I used the following command :
我使用以下命令:
./findbugs-3.0.1/bin/findbugs -textui -high -nested:false -sortByClass -html -output h.html -auxclasspath ../LabMetrics/operations/utilJars/junit.jar -auxclasspath ../LabMetrics/operations/utilJars/hamcrest-core-1.3.jar ../LabMetrics/operations/target/classes
It works fine and a html report is generated. 它工作正常,生成一个HTML报告。 Also, when I am using this command:
./findbugs-3.0.1/bin/findbugs -textui -high -nested:false -sortByClass -output h.txt -auxclasspath ../LabMetrics/operations/utilJars/junit.jar -auxclasspath ../LabMetrics/operations/utilJars/hamcrest-core-1.3.jar ../LabMetrics/operations/target/classes
the output will be redirected to h.txt file. 此外,当我使用此命令时:
./findbugs-3.0.1/bin/findbugs -textui -high -nested:false -sortByClass -output h.txt -auxclasspath ../LabMetrics/operations/utilJars/junit.jar -auxclasspath ../LabMetrics/operations/utilJars/hamcrest-core-1.3.jar ../LabMetrics/operations/target/classes
/ ./findbugs-3.0.1/bin/findbugs -textui -high -nested:false -sortByClass -output h.txt -auxclasspath ../LabMetrics/operations/utilJars/junit.jar -auxclasspath ../LabMetrics/operations/utilJars/hamcrest-core-1.3.jar ../LabMetrics/operations/target/classes
输出将被重定向到h.txt文件。
Now, I want to generate a html and a txt report running only a command. 现在,我想生成一个仅运行命令的html和txt报告。 This action is time comsumming and I don t want to analyze twice the same code, only for obtaining the same report, but with different format.
这个动作是时间推理,我不想分析两次相同的代码,只是为了获得相同的报告,但格式不同。 I searched on FindBugs site, but with no result.
我在FindBugs网站上搜索过但没有结果。 I really don`t want to parse html report source in order to build a txt report.
我真的不想解析html报告源以构建txt报告。 There must be a way to get two reports in a single run.
必须有一种方法可以在一次运行中获得两个报告。
It's better to create an XML first. 最好先创建一个XML。 XML contains all the necessary information and can be translated to whatever you need using some non-trivial command lines.
XML包含所有必要的信息,可以使用一些非平凡的命令行转换为您需要的任何信息。
For example, assuming you have analysisResult.xml to produce txt report use 例如,假设您有analyzeResult.xml来生成txt报告使用
java -cp findbugs.jar edu.umd.cs.findbugs.PrintingBugReporter -txt analysisResult.xml >output.txt
To produce HTML report use 要生成HTML报告使用
java -cp findbugs.jar edu.umd.cs.findbugs.PrintingBugReporter -html analysisResult.xml >output.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.