IEP-1018 Automation of hints viewer #449
SpotBugs Source Code Analyzer report
506 violation(s) found
Annotations
github-actions / spotbugs
MS_EXPOSE_REP
Public static com.espressif.idf.core.IDFCorePlugin.getPlugin() may expose internal representation by returning IDFCorePlugin.plugin
Raw output
A public static method returns a reference to an array that is part of the static state of the class. Any code that calls this method can freely modify the underlying array. One fix is to return a copy of the array.
github-actions / spotbugs
THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION
Method lists Exception in its throws clause.
Raw output
Method lists Exception in its throws clause.
When declaring a method, the types of exceptions in the throws clause should be the most specific. Therefore, using Exception in the throws clause would force the caller to either use it in its own throws clause, or use it in a try-catch block (when it does not necessarily contain any meaningful information about the thrown exception).
For more information, see the SEI CERT ERR07-J rule [https://wiki.sei.cmu.edu/confluence/display/java/ERR07-J.+Do+not+throw+RuntimeException%2C+Exception%2C+or+Throwable].
github-actions / spotbugs
THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION
Method lists Exception in its throws clause.
Raw output
Method lists Exception in its throws clause.
When declaring a method, the types of exceptions in the throws clause should be the most specific. Therefore, using Exception in the throws clause would force the caller to either use it in its own throws clause, or use it in a try-catch block (when it does not necessarily contain any meaningful information about the thrown exception).
For more information, see the SEI CERT ERR07-J rule [https://wiki.sei.cmu.edu/confluence/display/java/ERR07-J.+Do+not+throw+RuntimeException%2C+Exception%2C+or+Throwable].
github-actions / spotbugs
MS_SHOULD_BE_FINAL
com.espressif.idf.core.IDFEnvironmentVariables.IDF_PATH isn't final but should be
Raw output
This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
github-actions / spotbugs
MS_SHOULD_BE_FINAL
com.espressif.idf.core.IDFEnvironmentVariables.IDF_PYTHON_ENV_PATH isn't final but should be
Raw output
This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
github-actions / spotbugs
MS_SHOULD_BE_FINAL
com.espressif.idf.core.IDFEnvironmentVariables.OPENOCD_SCRIPTS isn't final but should be
Raw output
This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
github-actions / spotbugs
MS_SHOULD_BE_FINAL
com.espressif.idf.core.IDFEnvironmentVariables.PATH isn't final but should be
Raw output
This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
github-actions / spotbugs
EI_EXPOSE_REP
com.espressif.idf.core.IDFProjectNature.getProject() may expose internal representation by returning IDFProjectNature.project
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
github-actions / spotbugs
EI_EXPOSE_REP2
com.espressif.idf.core.IDFProjectNature.setProject(IProject) may expose internal representation by storing an externally mutable object into IDFProjectNature.project
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
github-actions / spotbugs
DM_DEFAULT_ENCODING
Found reliance on default encoding in com.espressif.idf.core.IDFVersionsReader.getVersions(): 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.
github-actions / spotbugs
DM_DEFAULT_ENCODING
Found reliance on default encoding in com.espressif.idf.core.InputStreamThread.run(): 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.
github-actions / spotbugs
DM_DEFAULT_ENCODING
Found reliance on default encoding in com.espressif.idf.core.OutputStreamThread.run(): new java.io.OutputStreamWriter(OutputStream)
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.
github-actions / spotbugs
EI_EXPOSE_REP2
new com.espressif.idf.core.OutputStreamThread(OutputStream, String, String) may expose internal representation by storing an externally mutable object into OutputStreamThread.out
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
github-actions / spotbugs
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
Redundant nullcheck of errorGobbler, which is known to be non-null in com.espressif.idf.core.ProcessBuilderFactory.processData(InputStream, InputStream, OutputStream, Process)
Raw output
This method contains a redundant check of a known non-null value against the constant null.
github-actions / spotbugs
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
Redundant nullcheck of readerGobbler, which is known to be non-null in com.espressif.idf.core.ProcessBuilderFactory.processData(InputStream, InputStream, OutputStream, Process)
Raw output
This method contains a redundant check of a known non-null value against the constant null.
github-actions / spotbugs
OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE
com.espressif.idf.core.ZipUtility.decompress(ZipInputStream, File, int) may fail to clean up java.io.OutputStream on checked exception
Raw output
This method may fail to clean up (close, dispose of) a stream, database object, or other resource requiring an explicit cleanup operation.
In general, if a method opens a stream or other resource, the method should use a try/finally block to ensure that the stream or resource is cleaned up before the method returns.
This bug pattern is essentially the same as the OS_OPEN_STREAM and ODR_OPEN_DATABASE_RESOURCE bug patterns, but is based on a different (and hopefully better) static analysis technique. We are interested is getting feedback about the usefulness of this bug pattern. For sending feedback, check:
* contributing guideline [https://github.com/spotbugs/spotbugs/blob/master/.github/CONTRIBUTING.md]
* mailinglist [https://github.com/spotbugs/discuss/issues?q=]
In particular, the false-positive suppression heuristics for this bug pattern have not been extensively tuned, so reports about false positives are helpful to us.
See Weimer and Necula, Finding and Preventing Run-Time Error Handling Mistakes (PDF [https://people.eecs.berkeley.edu/~necula/Papers/rte_oopsla04.pdf]), for a description of the analysis technique.
github-actions / spotbugs
EI_EXPOSE_REP2
new com.espressif.idf.core.build.ActiveLaunchConfigurationProvider(ILaunchBarManager) may expose internal representation by storing an externally mutable object into ActiveLaunchConfigurationProvider.launchBarManager
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
github-actions / spotbugs
EI_EXPOSE_REP2
new com.espressif.idf.core.build.EspIdfErrorParser(List) may expose internal representation by storing an externally mutable object into EspIdfErrorParser.reHintsList
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
github-actions / spotbugs
DM_DEFAULT_ENCODING
Found reliance on default encoding in com.espressif.idf.core.build.IDFBuildConfiguration.linkBuildComponents(): new java.io.FileReader(File)
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.
github-actions / spotbugs
EI_EXPOSE_REP
com.espressif.idf.core.build.IDFBuildConfiguration.getToolChainFile() may expose internal representation by returning IDFBuildConfiguration.toolChainFile
Raw output
Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.
github-actions / spotbugs
EI_EXPOSE_REP2
new com.espressif.idf.core.build.IDFBuildConfiguration(IBuildConfiguration, String, IToolChain, ICMakeToolChainFile, String) may expose internal representation by storing an externally mutable object into IDFBuildConfiguration.toolChainFile
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
github-actions / spotbugs
EI_EXPOSE_REP2
com.espressif.idf.core.build.IDFBuildConfiguration.build(int, Map, IConsole, IProgressMonitor) may expose internal representation by storing an externally mutable object into IDFBuildConfiguration.monitor
Raw output
This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.
github-actions / spotbugs
RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
Exceptional return value of java.io.File.mkdir() ignored in com.espressif.idf.core.build.IDFBuildConfiguration.build(int, Map, IConsole, IProgressMonitor)
Raw output
This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.
github-actions / spotbugs
RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
Exceptional return value of java.io.File.mkdirs() ignored in com.espressif.idf.core.build.IDFBuildConfiguration.getBuildContainerPath()
Raw output
This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.
github-actions / spotbugs
RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
Exceptional return value of java.io.File.mkdirs() ignored in com.espressif.idf.core.build.IDFBuildConfiguration.getIDFComponentsFolder()
Raw output
This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.