Skip to content

Commit 1bd57e1

Browse files
committed
Enhance Crawler to Support Unix and Windows.
1 parent b6ecc4e commit 1bd57e1

12 files changed

+16844
-182
lines changed

createScorecards.bat

100644100755
File mode changed.

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<goal>java</goal>
2424
</goals>
2525
<configuration>
26-
<mainClass>org.owasp.benchmark.tools.BenchmarkRunner</mainClass>
26+
<mainClass>org.owasp.benchmark.tools.BenchmarkCrawler</mainClass>
2727
</configuration>
2828
</execution>
2929
</executions>
@@ -279,7 +279,8 @@
279279
-Xmx4G
280280
-javaagent:${basedir}/tools/Contrast/contrast.jar=${basedir}/tools/Contrast/contrast.config
281281
-Dcontrast.dir=${basedir}/tools/Contrast/working
282-
-Dcontrast.saveresults=always
282+
-Dcontrast.log.daily=true
283+
-Dcontrast.level=debug
283284
-Dcontrast.noteamserver.enable=true
284285
-Dcontrast.teamserver.suppress=true
285286
</cargo.jvmargs>

prepareContrastResults.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

runBenchmark_wContrast.bat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@ECHO OFF
2+
IF EXIST tools\Contrast\contrast.jar (
3+
IF EXIST tools\Contrast\findings (
4+
DEL \F \Q tools\Contrast\findings
5+
6+
RMDIR \S tools\Contrast\working
7+
8+
ECHO ""
9+
10+
ECHO Previous Contrast results have been removed
11+
12+
ECHO ""
13+
)
14+
CALL mvn clean package cargo:run -Pdeploywcontrast
15+
16+
ECHO Copying Contrast reports to results directory
17+
18+
COPY tools\Contrast\working\contrast.log results\Benchmark_1.2beta-Contrast.log
19+
20+
) ELSE (
21+
ECHO Given that Contrast is a commercial product, you have to have a licensed version of Contrast in order to run it on the Benchmark. If you have access to Contrast, download the Java 1.5 version of contrast.jar from the Team Server and put it into the /tools/Contrast folder, and then rerun this script.
22+
)

runBenchmark_wContrast.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ if [ -f tools/Contrast/contrast.jar ]; then
1515
chmod 755 src/main/resources/insecureCmd.sh
1616
mvn clean package cargo:run -Pdeploywcontrast
1717

18+
echo "Copying Contrast report to results directory"
19+
cp tools/Contrast/working/contrast.log results/Benchmark_1.2beta-Contrast.log
20+
1821
else
1922

2023
echo "Given that Contrast is a commercial product, you have to have a licensed version of Contrast in order to run it on the Benchmark. If you have access to Contrast, download the Java 1.5 version of contrast.jar from the Team Server and put it into the /tools/Contrast folder, and then rerun this script."

runCrawler.bat

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
echo
2-
echo "NOTE: This crawler requires Firefox. Please install it if you don’t have it already."
3-
echo "ALSO: This crawler will sometimes stop if Firefox is not the window in focus. Be sure to keep Firefox in the foreground during the entire crawl in order to get the best results."
4-
echo
5-
6-
call mvn install -Pcrawler
1+
2+
CALL mvn install -Pcrawler

runCrawler.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
#!/bin/sh
22

3-
echo
4-
echo "NOTE: This crawler requires Firefox. Please install it if you don’t have it already."
5-
echo "ALSO: This crawler will sometimes stop if Firefox is not the window in focus. Be sure to keep Firefox in the foreground during the entire crawl in order to get the best results."
6-
echo
7-
83
mvn install -Pcrawler

src/main/java/org/owasp/benchmark/score/BenchmarkScore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
import org.owasp.benchmark.score.parsers.CoverityReader;
6060
import org.owasp.benchmark.score.parsers.FindbugsReader;
6161
import org.owasp.benchmark.score.parsers.FortifyReader;
62+
import org.owasp.benchmark.score.parsers.NoisyCricketReader;
6263
import org.owasp.benchmark.score.parsers.OverallResult;
6364
import org.owasp.benchmark.score.parsers.OverallResults;
6465
import org.owasp.benchmark.score.parsers.PMDReader;
6566
import org.owasp.benchmark.score.parsers.ParasoftReader;
66-
import org.owasp.benchmark.score.parsers.NoisyCricketReader;
6767
import org.owasp.benchmark.score.parsers.Rapid7Reader;
6868
import org.owasp.benchmark.score.parsers.SonarQubeReader;
6969
import org.owasp.benchmark.score.parsers.SourceMeterReader;
@@ -746,7 +746,7 @@ else if ( filename.endsWith( ".fpr" ) ) {
746746
}
747747
}
748748

749-
else if ( filename.endsWith( ".zip") ) {
749+
else if ( filename.endsWith( ".log") ) {
750750
tr = new ContrastReader().parse( fileToParse );
751751
}
752752

0 commit comments

Comments
 (0)