Repository navigation
Update metricshub/workflows to v8 - #95
SpotBugs Source Code Analyzer report
8 violation(s) found
Annotations
Check warning on line 858 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
DM_DEFAULT_ENCODING
Found reliance on default encoding in org.metricshub.ssh.SshClient.interactiveSession(InputStream, OutputStream): new java.io.InputStreamReader(InputStream)
Raw output
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 behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.
Check warning on line 655 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
DM_DEFAULT_ENCODING
Found reliance on default encoding in org.metricshub.ssh.SshClient.readFile(String, Long, Integer): java.io.ByteArrayOutputStream.toString()
Raw output
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 behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.
Check warning on line 826 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
ICAST_IDIV_CAST_TO_DOUBLE
Integral division result cast to double or float in org.metricshub.ssh.SshClient.executeCommand(String, int)
Raw output
This code casts the result of an integral division (e.g., int or long division) operation to double or float. Doing division on integers truncates the result to the integer value closest to zero. The fact that the result was cast to double suggests that this precision should have been retained. What was probably meant was to cast one or both of the operands to double before performing the division. Here is an example:
int x = 2;
int y = 5;
// Wrong: yields result 0.0
double value1 = x / y;
// Right: yields result 0.4
double value2 = x / (double) y;
Check warning on line 866 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
DM_DEFAULT_ENCODING
Found reliance on default encoding in org.metricshub.ssh.SshClient$2.run(): String.getBytes()
Raw output
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 behavior to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.
Check warning on line 731 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD
Unread public/protected field: org.metricshub.ssh.SshClient$CommandResult.executionTime
Raw output
This field is never read. The field is public or protected, so perhaps it is intended to be used with classes not seen as part of the analysis. If not, consider removing it from the class.
Check warning on line 737 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD
Unread public/protected field: org.metricshub.ssh.SshClient$CommandResult.exitStatus
Raw output
This field is never read. The field is public or protected, so perhaps it is intended to be used with classes not seen as part of the analysis. If not, consider removing it from the class.
Check warning on line 742 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD
Unread public/protected field: org.metricshub.ssh.SshClient$CommandResult.result
Raw output
This field is never read. The field is public or protected, so perhaps it is intended to be used with classes not seen as part of the analysis. If not, consider removing it from the class.
Check warning on line 725 in src/main/java/org/metricshub/ssh/SshClient.java
github-actions / spotbugs
URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD
Unread public/protected field: org.metricshub.ssh.SshClient$CommandResult.success
Raw output
This field is never read. The field is public or protected, so perhaps it is intended to be used with classes not seen as part of the analysis. If not, consider removing it from the class.