Skip to content

Implement diagnostic flare

ci.jenkins.io / SpotBugs failed Sep 23, 2024 in 0s

8 new issues

Total New Outstanding Fixed Trend
8 8 0 0 👎

Reference build: Plugins » datadog-plugin » master #186

Details

Severity distribution of new issues

Error Warning High Warning Normal Warning Low
0 7 1 0

Annotations

Check warning on line 102 in src/main/java/org/datadog/jenkins/plugins/datadog/DatadogPluginManagement.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

DM_DEFAULT_ENCODING

HIGH:
Found reliance on default encoding in org.datadog.jenkins.plugins.datadog.DatadogPluginManagement.writeDiagnosticFlare(OutputStream): String.getBytes()
Raw output
<p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>

Check warning on line 30 in src/main/java/org/datadog/jenkins/plugins/datadog/flare/ExceptionsFlare.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

DM_DEFAULT_ENCODING

HIGH:
Found reliance on default encoding in org.datadog.jenkins.plugins.datadog.flare.ExceptionsFlare.writeFileContents(OutputStream): new java.io.PrintWriter(OutputStream, boolean)
Raw output
<p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>

Check warning on line 36 in src/main/java/org/datadog/jenkins/plugins/datadog/flare/ExceptionsFlare.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE

HIGH:
Call to method of static java.text.DateFormat in org.datadog.jenkins.plugins.datadog.flare.ExceptionsFlare.writeFileContents(OutputStream)
Raw output
<p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicious.</p> <p>For more information on this see <a href="http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6231579">JDK Bug #6231579</a> and <a href="http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6178997">JDK Bug #6178997</a>.</p>

Check warning on line 0 in src/main/java/org/datadog/jenkins/plugins/datadog/flare/ExceptionsFlare.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

STCAL_STATIC_SIMPLE_DATE_FORMAT_INSTANCE

HIGH:
org.datadog.jenkins.plugins.datadog.flare.ExceptionsFlare.DATE_FORMATTER is a static field of type java.text.DateFormat, which isn't thread safe
Raw output
<p>As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application.</p> <p>You may also experience serialization problems.</p> <p>Using an instance field is recommended.</p> <p>For more information on this see <a href="http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6231579">JDK Bug #6231579</a> and <a href="http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6178997">JDK Bug #6178997</a>.</p>

Check warning on line 34 in src/main/java/org/datadog/jenkins/plugins/datadog/flare/JenkinsLogsFlare.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

DM_DEFAULT_ENCODING

HIGH:
Found reliance on default encoding in org.datadog.jenkins.plugins.datadog.flare.JenkinsLogsFlare.writeFileContents(OutputStream): new java.io.PrintWriter(OutputStream, boolean)
Raw output
<p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>

Check warning on line 65 in src/main/java/org/datadog/jenkins/plugins/datadog/flare/PluginLogsFlare.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

DM_DEFAULT_ENCODING

HIGH:
Found reliance on default encoding in org.datadog.jenkins.plugins.datadog.flare.PluginLogsFlare.writeFileContents(OutputStream): new java.io.PrintWriter(OutputStream, boolean)
Raw output
<p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>

Check warning on line 30 in src/main/java/org/datadog/jenkins/plugins/datadog/flare/RuntimeInfoFlare.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

NORMAL:
Possible null pointer dereference in org.datadog.jenkins.plugins.datadog.flare.RuntimeInfoFlare.writeFileContents(OutputStream) due to return value of called method
Raw output
<p> The return value from a method is dereferenced without a null check, and the return value of that method is one that should generally be checked for null. This may lead to a <code>NullPointerException</code> when the code is executed. </p>

Check warning on line 22 in src/main/java/org/datadog/jenkins/plugins/datadog/flare/ThreadDumpFlare.java

See this annotation in the file changed.

@ci-jenkins-io ci-jenkins-io / SpotBugs

DM_DEFAULT_ENCODING

HIGH:
Found reliance on default encoding in org.datadog.jenkins.plugins.datadog.flare.ThreadDumpFlare.writeFileContents(OutputStream): new java.io.PrintWriter(OutputStream, boolean)
Raw output
<p> Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. </p>