Skip to content

Commit c3a5dbd

Browse files
committed
Remove some weird characters from two of the parsers.
1 parent 1de655d commit c3a5dbd

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

src/main/java/org/owasp/benchmark/score/parsers/ParasoftReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public TestResults parse(File f) throws Exception {
4242

4343
Node root = doc.getDocumentElement();
4444

45-
// <ResultsSession time="06/03/15 10:10:09" toolName="Jtest" toolVer="9.5.13.20140908���>
45+
// <ResultsSession time="06/03/15 10:10:09" toolName="Jtest" toolVer="9.5.13.20140908>
4646
String version = this.getAttributeValue("toolVer", root);
4747
tr.setToolVersion( version );
4848

src/main/java/org/owasp/benchmark/score/parsers/SonarReader.java

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -81,51 +81,51 @@ private TestCaseResult parseSonarIssue(Node flaw) {
8181

8282
private int cweLookup(String squidNumber) {
8383
switch( squidNumber ) {
84-
case "S00105" : return 0000; //S00105��Replace all tab characters in this file by sequences of white-spaces.
85-
case "S106" : return 0000; //S00106��Replace this usage of System.out or System.err by a logger.
86-
case "S00112" : return 397; //S00112��Generic exceptions should never be thrown
87-
case "S00121" : return 483; //S00121��Control structures should always use curly braces
88-
case "S1132" : return 0000; //S1132��Move the "foo" string literal on the left side of this string comparison.
89-
case "S1143" : return 584; //S1143��"return " statements should not occur in"finally" blocks
90-
case "S1145" : return 0000; //S1145��"if" statement conditions should not unconditionally evaluate to"true" or to"false"
91-
case "S1147" : return 382; //S1147��Exit methods should not be called
92-
case "S1174" : return 583; //S1174��"Object.finalize()" should remain protected (versus public) when overriding
93-
case "S1181" : return 396; //S1181��Throwable and Error should not be caught
94-
case "S1182" : return 580; //S1182��Classes that override"clone" should be"Cloneable" and call"super.clone()"
95-
case "S1206" : return 581; //S1206��"equals(Object obj)" and"hashCode()" should be overridden in pairs
96-
case "S1217" : return 572; //S1217��Thread.run() and Runnable.run() should not be called directly
97-
case "S128" : return 484; //S128��Switch cases should end with an unconditional"break" statement
98-
case "S1481" : return 0000; //1481��Remove this unused "c" local variable.
99-
case "S1444" : return 500; //S1444��"public static" fields should always be constant
100-
case "S1696" : return 395; //S1696��"NullPointerException" should not be caught
101-
case "S1698" : return 595; //S1698��Objects should be compared with"equals()"
102-
case "S1724" : return 0000; //S1724��Deprecated classes and interfaces should not be extended/implemented
103-
case "S1850" : return 0000; //S1850��"instanceof" operators that always return "true" or"false" should be removed
104-
case "S1872" : return 486; //S1872��Classes should not be compared by name
105-
case "S1873" : return 582; //S1873��"static final" arrays should be"private"
106-
case "S1948" : return 594; //S1948��Fields in a"Serializable" class should either be transient or serializable
107-
case "S2068" : return 259; //S2068��Credentials should not be hard-coded
108-
case "S2070" : return 328; //S2070��SHA-1 and Message-Digest hash algorithms should not be used
109-
case "S2076" : return 88; //S2076��Values passed to OS commands should be sanitized
110-
case "S2077" : return 89; //S2077��Values passed to SQL commands should be sanitized
111-
case "S2078" : return 90; //S2078��Values passed to LDAP queries should be sanitized
112-
case "S2089" : return 293; //S2089��HTTP referers should not be relied on
113-
case "S2092" : return 614; //S2092��Cookies should be"secure"
114-
case "S2095" : return 459; //S2095��Resources should be closed
115-
case "S2184" : return 190; //S2184��Math operands should be cast before assignment
116-
case "S2222" : return 0000; //S2222��Locks should be released
117-
case "S2225" : return 0000; //S2225��"toString()" and"clone()" methods should not return null
118-
case "S2245" : return 330; //S2245��Pseudorandom number generators (PRNGs) should not be used in secure contexts
119-
case "S2254" : return 0000; //S2254��"HttpServletRequest.getRequestedSessionId()" should not be used
120-
case "S2257" : return 327; //S2257��Only standard cryptographic algorithms should be used
121-
case "S2259" : return 476; //S2259��Null pointers should not be dereferenced
122-
case "S2277" : return 780; //S2277��Cryptographic RSA algorithms should always incorporate OAEP (Optimal Asymmetric Encryption Padding)
123-
case "S2278" : return 327; //S2278��DES (Data Encryption Standard) and DESede (3DES) should not be used
124-
case "S2384" : return 374; //S2384��Mutable members should not be stored or returned directly
125-
case "S2441" : return 579; //S2441��Non-serializable objects should not be stored in"HttpSessions"
126-
case "S2583" : return 489; //S2583��Conditions should not unconditionally evaluate to"TRUE" or to"FALSE"
127-
case "S864" : return 783; //S864��Limited dependence should be placed on operator precedence rules in expressions
128-
case "S888" : return 835; //S888��Relational operators should be used in"for" loop termination conditions
84+
case "S00105" : return 0000; //S00105-Replace all tab characters in this file by sequences of white-spaces.
85+
case "S106" : return 0000; //S00106-Replace this usage of System.out or System.err by a logger.
86+
case "S00112" : return 397; //S00112-Generic exceptions should never be thrown
87+
case "S00121" : return 483; //S00121-Control structures should always use curly braces
88+
case "S1132" : return 0000; //S1132-Move the "foo" string literal on the left side of this string comparison.
89+
case "S1143" : return 584; //S1143-"return " statements should not occur in"finally" blocks
90+
case "S1145" : return 0000; //S1145-"if" statement conditions should not unconditionally evaluate to"true" or to"false"
91+
case "S1147" : return 382; //S1147-Exit methods should not be called
92+
case "S1174" : return 583; //S1174-"Object.finalize()" should remain protected (versus public) when overriding
93+
case "S1181" : return 396; //S1181-Throwable and Error should not be caught
94+
case "S1182" : return 580; //S1182-Classes that override"clone" should be"Cloneable" and call"super.clone()"
95+
case "S1206" : return 581; //S1206-"equals(Object obj)" and"hashCode()" should be overridden in pairs
96+
case "S1217" : return 572; //S1217-Thread.run() and Runnable.run() should not be called directly
97+
case "S128" : return 484; //S128-Switch cases should end with an unconditional"break" statement
98+
case "S1481" : return 0000; //1481-Remove this unused "c" local variable.
99+
case "S1444" : return 500; //S1444-"public static" fields should always be constant
100+
case "S1696" : return 395; //S1696-"NullPointerException" should not be caught
101+
case "S1698" : return 595; //S1698-Objects should be compared with"equals()"
102+
case "S1724" : return 0000; //S1724-Deprecated classes and interfaces should not be extended/implemented
103+
case "S1850" : return 0000; //S1850-"instanceof" operators that always return "true" or"false" should be removed
104+
case "S1872" : return 486; //S1872-Classes should not be compared by name
105+
case "S1873" : return 582; //S1873-"static final" arrays should be"private"
106+
case "S1948" : return 594; //S1948-Fields in a"Serializable" class should either be transient or serializable
107+
case "S2068" : return 259; //S2068-Credentials should not be hard-coded
108+
case "S2070" : return 328; //S2070-SHA-1 and Message-Digest hash algorithms should not be used
109+
case "S2076" : return 88; //S2076-Values passed to OS commands should be sanitized
110+
case "S2077" : return 89; //S2077-Values passed to SQL commands should be sanitized
111+
case "S2078" : return 90; //S2078-Values passed to LDAP queries should be sanitized
112+
case "S2089" : return 293; //S2089-HTTP referers should not be relied on
113+
case "S2092" : return 614; //S2092-Cookies should be"secure"
114+
case "S2095" : return 459; //S2095-Resources should be closed
115+
case "S2184" : return 190; //S2184-Math operands should be cast before assignment
116+
case "S2222" : return 0000; //S2222-Locks should be released
117+
case "S2225" : return 0000; //S2225-"toString()" and"clone()" methods should not return null
118+
case "S2245" : return 330; //S2245-Pseudorandom number generators (PRNGs) should not be used in secure contexts
119+
case "S2254" : return 0000; //S2254-"HttpServletRequest.getRequestedSessionId()" should not be used
120+
case "S2257" : return 327; //S2257-Only standard cryptographic algorithms should be used
121+
case "S2259" : return 476; //S2259-Null pointers should not be dereferenced
122+
case "S2277" : return 780; //S2277-Cryptographic RSA algorithms should always incorporate OAEP (Optimal Asymmetric Encryption Padding)
123+
case "S2278" : return 327; //S2278-DES (Data Encryption Standard) and DESede (3DES) should not be used
124+
case "S2384" : return 374; //S2384-Mutable members should not be stored or returned directly
125+
case "S2441" : return 579; //S2441-Non-serializable objects should not be stored in"HttpSessions"
126+
case "S2583" : return 489; //S2583-Conditions should not unconditionally evaluate to"TRUE" or to"FALSE"
127+
case "S864" : return 783; //S864-Limited dependence should be placed on operator precedence rules in expressions
128+
case "S888" : return 835; //S888-Relational operators should be used in"for" loop termination conditions
129129
}
130130
// System.out.println( "Failed to translate " + squidNumber );
131131
return -1;

0 commit comments

Comments
 (0)