You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/test/resources/sanity_check_expected_issues.json
+2-2
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
"type": "issue",
4
4
"check_name": "squid:S106",
5
5
"severity": "major",
6
-
"description": "Replace this usage of System.out or System.err by a logger.",
6
+
"description": "Replace this use of System.out or System.err by a logger.",
7
7
"content": {
8
8
"body": "<p>When logging a message there are several important requirements which must be fulfilled:</p>\n<ul>\n <li> The user must be able to easily retrieve the logs </li>\n <li> The format of all logged message must be uniform to allow the user to easily read the log </li>\n <li> Logged data must actually be recorded </li>\n <li> Sensitive data must only be logged securely </li>\n</ul>\n<p>If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a\ndedicated logger is highly recommended.</p>\n<h2>Noncompliant Code Example</h2>\n<pre>\nSystem.out.println(\"My Message\"); // Noncompliant\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\nlogger.log(\"My Message\");\n</pre>\n<h2>See</h2>\n<ul>\n <li> <a href=\"https://www.securecoding.cert.org/confluence/x/RoElAQ\">CERT, ERR02-J.</a> - Prevent exceptions while logging data </li>\n</ul>"
9
9
},
@@ -58,7 +58,7 @@
58
58
"severity": "critical",
59
59
"description": "Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.",
60
60
"content": {
61
-
"body": "<p>There are several reasons for a method not to have a method body:</p>\n<ul>\n <li> It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production. </li>\n <li> It is not yet, or never will be, supported. In this case an <code>UnsupportedOperationException</code> should be thrown. </li>\n <li> The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override. </li>\n <li> There is a desire to provide a public, no-args constructor. In this case, it can simply be omitted from the code; a default constructor will\n automatically be generated. </li>\n</ul>\n<h2>Noncompliant Code Example</h2>\n<pre>\npublic void doSomething() {\n}\n\npublic void doSomethingElse() {\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\n@Override\npublic void doSomething() {\n // Do nothing because of X and Y.\n}\n\n@Override\npublic void doSomethingElse() {\n throw new UnsupportedOperationException();\n}\n</pre>\n<h2>Exceptions</h2>\n<p>An abstract class may have empty methods, in order to provide default implementations for child classes.</p>\n<pre>\npublic abstract class Animal {\n void speak() {\n }\n}\n</pre>"
61
+
"body": "<p>There are several reasons for a method not to have a method body:</p>\n<ul>\n <li> It is an unintentional omission, and should be fixed to prevent an unexpected behavior in production. </li>\n <li> It is not yet, or never will be, supported. In this case an <code>UnsupportedOperationException</code> should be thrown. </li>\n <li> The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override. </li>\n</ul>\n<h2>Noncompliant Code Example</h2>\n<pre>\npublic void doSomething() {\n}\n\npublic void doSomethingElse() {\n}\n</pre>\n<h2>Compliant Solution</h2>\n<pre>\n@Override\npublic void doSomething() {\n // Do nothing because of X and Y.\n}\n\n@Override\npublic void doSomethingElse() {\n throw new UnsupportedOperationException();\n}\n</pre>\n<h2>Exceptions</h2>\n<p>Default (no-argument) constructors are ignored when there are other constructors in the class, as are empty methods in abstract classes.</p>\n<pre>\npublic abstract class Animal {\n void speak() { // default implementation ignored\n }\n}\n</pre>"
0 commit comments