Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure clangd file exists before writing config attributes #925

Merged
merged 2 commits into from
Apr 5, 2024

fix: improve code readability

8bc318b
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

fix: ensure clangd file exists before writing config attributes #925

fix: improve code readability
8bc318b
Select commit
Loading
Failed to load commit list.
GitHub Actions / spotbugs completed Apr 4, 2024 in 0s

SpotBugs Source Code Analyzer report

545 violation(s) found

Annotations

Check warning on line 32 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFCorePlugin.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 49 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFCorePlugin.java

See this annotation in the file changed.

@github-actions 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].

Check warning on line 59 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFCorePlugin.java

See this annotation in the file changed.

@github-actions 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].

Check warning on line 33 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFEnvironmentVariables.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 35 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFEnvironmentVariables.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 39 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFEnvironmentVariables.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 37 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFEnvironmentVariables.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 25 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFProjectNature.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 31 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFProjectNature.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 42 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/IDFVersionsReader.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 49 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/InputStreamThread.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 39 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/OutputStreamThread.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 22 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/OutputStreamThread.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 113 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/ProcessBuilderFactory.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 108 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/ProcessBuilderFactory.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 91 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/ZipUtility.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 39 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/actions/ApplyTargetJob.java

See this annotation in the file changed.

@github-actions github-actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.actions.ApplyTargetJob(ILaunchBarManager, ILaunchTargetManager, String, IWizard) may expose internal representation by storing an externally mutable object into ApplyTargetJob.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.

Check warning on line 40 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/actions/ApplyTargetJob.java

See this annotation in the file changed.

@github-actions github-actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.actions.ApplyTargetJob(ILaunchBarManager, ILaunchTargetManager, String, IWizard) may expose internal representation by storing an externally mutable object into ApplyTargetJob.targetManager
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.

Check warning on line 41 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/actions/ApplyTargetJob.java

See this annotation in the file changed.

@github-actions github-actions / spotbugs

EI_EXPOSE_REP2

new com.espressif.idf.core.actions.ApplyTargetJob(ILaunchBarManager, ILaunchTargetManager, String, IWizard) may expose internal representation by storing an externally mutable object into ApplyTargetJob.wizard
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.

Check warning on line 31 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/ActiveLaunchConfigurationProvider.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 140 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/ErrorMarkerListener.java

See this annotation in the file changed.

@github-actions github-actions / spotbugs

SIC_INNER_SHOULD_BE_STATIC

Should com.espressif.idf.core.build.ErrorMarkerListener$ProjectRefreshJob be a _static_ inner class?
Raw output
This class is an inner class, but does not use its embedded reference to the object which created it.  This reference makes the instances of the class larger, and may keep the reference to the creator object alive longer than necessary.  If possible, the class should be made static.

Check warning on line 45 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/EspIdfErrorParser.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 663 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 304 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

See this annotation in the file changed.

@github-actions 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.

Check warning on line 160 in bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java

See this annotation in the file changed.

@github-actions 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.