fix: move default parameters to end in cypress.config.ts#24
Open
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
Open
fix: move default parameters to end in cypress.config.ts#24sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
Conversation
Fixed issues: - AZWU-tuTYJSZqVQVbSl6 for typescript:S1788 rule Generated by SonarQube Agent (task: 85053250-2682-4772-8070-b1c85b2be339)
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.
Removed the default value assignment from the
browserparameter in cypress.config.ts to comply with TypeScript best practices, where default parameters must come after non-default parameters. This resolves the SonarQube code smell and improves code quality by following proper parameter ordering conventions.View Project in SonarCloud
Fixed Issues
typescript:S1788 - Default parameters should be last. • MAJOR • View issue
Location:
cypress.config.ts:18Why is this an issue?
Default parameter values allow callers to specify as many or as few arguments as they want while getting the same functionality and minimizing boilerplate, wrapper code, making a function easier to use.
What changed
Removes the default value assignment
= {}from thebrowserparameter, which was declared before the non-defaultlaunchOptionsparameter. The static analysis rule requires that parameters with default values come after parameters without default values. By removing the unnecessary default value frombrowser, the function signature no longer has a default parameter preceding a non-default parameter, resolving the 'Default parameters should be last' code smell.SonarQube Remediation Agent uses AI. Check for mistakes.