Remove redundant await calls on synchronous globArray() results#5
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
Remove redundant await calls on synchronous globArray() results#5sonarqube-agent[bot] wants to merge 1 commit into
sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZpDOYbfFgknPiesr7Ge for typescript:S4123 rule - AZpDOYbfFgknPiesr7Gf for typescript:S4123 rule - AZpDOYbfFgknPiesr7Ga for typescript:S4123 rule - AZpDOYbfFgknPiesr7Gb for typescript:S4123 rule - AZpDOYbfFgknPiesr7Gc for typescript:S4123 rule Generated by SonarQube Agent (task: 1aeac710-66a8-4eef-8396-952ef61ee0af)
SonarQube reviewer guide
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




This change fixes 5 critical SonarQube issues (S4123) in docsFinder.ts where
awaitwas incorrectly applied to synchronousglobArray()calls. Removing these redundant awaits improves code correctness by ensuring non-Promise values are not treated as Thenable objects.View Project in SonarCloud
Fixed Issues
typescript:S4123 - Unexpected `await` of a non-Promise (non-"Thenable") value. • CRITICAL • View issue
Location:
packages/ansible-language-server/src/utils/docsFinder.ts:26Why is this an issue?
Promises are objects that represent the eventual completion or failure of an asynchronous operation. They provide a way to handle asynchronous operations in a more organized and manageable manner. To use
await, you need to ensure that you are calling a function or an expression that returns a promise.What changed
Removes the redundant
awaiton theglobArray()call at line 26, which returns a non-Promise (synchronous) value. The static analyzer flagged this as awaiting a non-Thenable value, so removingawaitfixes the warning.typescript:S4123 - Unexpected `await` of a non-Promise (non-"Thenable") value. • CRITICAL • View issue
Location:
packages/ansible-language-server/src/utils/docsFinder.ts:29Why is this an issue?
Promises are objects that represent the eventual completion or failure of an asynchronous operation. They provide a way to handle asynchronous operations in a more organized and manageable manner. To use
await, you need to ensure that you are calling a function or an expression that returns a promise.What changed
Removes the redundant
awaiton theglobArray()call at line 29, which returns a non-Promise (synchronous) value. The static analyzer flagged this as awaiting a non-Thenable value, so removingawaitfixes the warning.typescript:S4123 - Unexpected `await` of a non-Promise (non-"Thenable") value. • CRITICAL • View issue
Location:
packages/ansible-language-server/src/utils/docsFinder.ts:43Why is this an issue?
Promises are objects that represent the eventual completion or failure of an asynchronous operation. They provide a way to handle asynchronous operations in a more organized and manageable manner. To use
await, you need to ensure that you are calling a function or an expression that returns a promise.What changed
Removes the redundant
awaiton theglobArray()call at line 43, which returns a non-Promise (synchronous) value. The static analyzer flagged this as awaiting a non-Thenable value, so removingawaitfixes the warning.typescript:S4123 - Unexpected `await` of a non-Promise (non-"Thenable") value. • CRITICAL • View issue
Location:
packages/ansible-language-server/src/utils/docsFinder.ts:97Why is this an issue?
Promises are objects that represent the eventual completion or failure of an asynchronous operation. They provide a way to handle asynchronous operations in a more organized and manageable manner. To use
await, you need to ensure that you are calling a function or an expression that returns a promise.What changed
Removes the redundant
awaiton theglobArray()call at line 97, which returns a non-Promise (synchronous) value. The static analyzer flagged this as awaiting a non-Thenable value, so removingawaitfixes the warning.typescript:S4123 - Unexpected `await` of a non-Promise (non-"Thenable") value. • CRITICAL • View issue
Location:
packages/ansible-language-server/src/utils/docsFinder.ts:100Why is this an issue?
Promises are objects that represent the eventual completion or failure of an asynchronous operation. They provide a way to handle asynchronous operations in a more organized and manageable manner. To use
await, you need to ensure that you are calling a function or an expression that returns a promise.What changed
Removes the redundant
awaiton theglobArray()call at line 100, which returns a non-Promise (synchronous) value. The static analyzer flagged this as awaiting a non-Thenable value, so removingawaitfixes the warning.SonarQube Remediation Agent uses AI. Check for mistakes.