@@ -8,35 +8,40 @@ class HardCodedPasswordCheckCustom {
88 String fieldNameWithBazookaInIt ;
99
1010 private void a (char [] pwd , String var ) {
11- String variable2 = "login=a&password=xxx" ; // Compliant
12- String variable3 = "login=a&passwd=xxx" ; // Compliant
13- String variable4 = "login=a&pwd=xxx" ; // Compliant
14- String variable5 = "login=a&marmalade=xxx" ; // Noncompliant {{'marmalade' detected in this expression, review this potentially hard-coded password.}}
15- // ^^^^^^^^^^^^^^^^^^^^^^^
16- String variable6 = "login=a&bazooka=xxx " ; // Noncompliant
17-
18- String variableNameWithBazookaInIt = "xxx" ; // Noncompliant
19- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^
20- String variableNameWithmarMalAdeInIt = "xxx" ; // Noncompliant
11+ String variable2 = "login=a&password=xvxf6_gaa" ; // Compliant
12+ String variable3 = "login=a&passwd=xvxf6_gaa" ; // Compliant
13+ String variable4 = "login=a&pwd=xvxf6_gaa" ; // Compliant
14+ String variable5 = "login=a&marmalade=xxx" ; // Compliant, short value filter
15+ String variable5_2 = "login=a&marmalade=xvxf6_gaa" ; // Noncompliant {{'marmalade' detected in this expression, review this potentially hard-coded password.}}
16+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+ String variable6 = "login=a&bazooka=xxx" ; // Compliant, short value filter
18+ String variable6_2 = "login=a&bazooka=xvxf6_gaa" ; // Noncompliant
19+
20+ String variableNameWithBazookaInIt = "xxx" ; // Compliant, , short value filter
21+ String variableNameWithBazookaInIt_2 = "xvxf6_gaa" ; // Noncompliant
2122// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22- String variableNameWithPwdInIt = "xxx" ; // Compliant
23+ String variableNameWithmarMalAdeInIt = "xvxf6_gaa" ; // Noncompliant
24+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+ String variableNameWithPwdInIt = "xvxf6_gaa" ; // Compliant
2326 String otherVariableNameWithPasswordInIt ;
24- fieldNameWithPasswordInIt = "xx" ; // Compliant
25- this .fieldNameWithBazookaInIt = "xx" ; // Noncompliant
27+ fieldNameWithPasswordInIt = "xx" ;
28+ this .fieldNameWithBazookaInIt = "xx" ; // Compliant, , short value filter
2629
2730
2831 HardCodedPasswordCheckCustom myA = new HardCodedPasswordCheckCustom ();
29- myA .setProperty ("marmalade" , "xxxxx" ); // Noncompliant
30- myA .setProperty ("passwd" , "xxxxx" ); //Compliant
31- myA .setProperty ("pwd" , "xxxxx" ); // Compliant
32+ myA .setProperty ("marmalade" , "xxxxx" ); // Compliant, short value filter
33+ myA .setProperty ("marmalade" , "xvxf6_gaa" ); // Noncompliant
34+ myA .setProperty ("marmalade" , "marmalade" ); // Compliant
35+ myA .setProperty ("passwd" , "xvxf6_gaa" ); //Compliant
36+ myA .setProperty ("pwd" , "xvxf6_gaa" ); // Compliant
3237
3338
34- new PasswordAuthentication ("userName" , "1234 " .toCharArray ()); // Compliant, handled by S6437
39+ new PasswordAuthentication ("userName" , "xvxf6_gaa " .toCharArray ()); // Compliant, handled by S6437
3540 new PasswordAuthentication ("userName" , pwd ); // Compliant
3641 new PasswordAuthentication ("userName" , getPwd (var )); // Compliant
3742 new PasswordAuthentication ("userName" , var .toCharArray ()); // Compliant
3843
39- new OtherPasswordAuthentication ("userName" , "1234 " .toCharArray ()); // Compliant
44+ new OtherPasswordAuthentication ("userName" , "xvxf6_gaa " .toCharArray ()); // Compliant
4045 }
4146
4247 private void setProperty (Object property , Object Value ) { }
0 commit comments