Skip to content

Use method shorthand syntax in wizard.html template#472

Open
sonarqube-agent[bot] wants to merge 1 commit into
mainfrom
remediate-main-20260704-050230-0ad69d78
Open

Use method shorthand syntax in wizard.html template#472
sonarqube-agent[bot] wants to merge 1 commit into
mainfrom
remediate-main-20260704-050230-0ad69d78

Conversation

@sonarqube-agent

Copy link
Copy Markdown

This PR was automatically created by the Remediation Agent's Scheduled backlog remediation feature.

Why these issues? Both issues share the same SonarQube rule (javascript:S3498) within a single file, forming a cohesive fix. The issues are well-scoped to specific methods in the wizard component and represent a straightforward, reliable refactoring that modernizes the codebase without functional changes.

Convert two object methods from traditional function expressions to ES6 method shorthand syntax in the wizard.html template. This eliminates redundant function keywords and resolves SonarQube code smell violations while improving code readability and consistency with modern JavaScript conventions.

View Project in SonarCloud


Fixed Issues

javascript:S3498 - Expected method shorthand. • MINORView issue 1
javascript:S3498 - Expected method shorthand. • MINORView issue 2

Location: go/internal/gui/templates/wizard.html:893

Why is this an issue?

In JavaScript, object shorthand syntax is a more concise way to define properties on objects. It was introduced to make object literals more readable and expressive.

What changed

This hunk converts onInputKey: function(e) { to the method shorthand syntax onInputKey(e) {, eliminating the redundant function keyword. This directly fixes the 'Expected method shorthand' code smell for the onInputKey method at line 899 of wizard.html. Since there are only two hunks in the patch, this hunk also addresses any remaining method shorthand warnings in this area of the file.

--- a/go/internal/gui/templates/wizard.html
+++ b/go/internal/gui/templates/wizard.html
@@ -899,1 +899,1 @@ var Wizard = (function() {
-		onInputKey: function(e) {
+		onInputKey(e) {

Have a suggestion or found an issue? Share your feedback here.


SonarQube Remediation Agent uses AI. Check for mistakes.

Fixed issues:
- AZ8eSZHTzwJaVhGCbjFF for javascript:S3498 rule
- AZ8eSZHTzwJaVhGCbjFG for javascript:S3498 rule

Generated by SonarQube Agent (task: be93144b-8067-45ac-b003-36382973fe59)
@sonarqube-agent sonarqube-agent AI requested a review from a team as a code owner July 4, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant