Skip to content

Potential fix for code scanning alert no. 5402: Semicolon insertion#2727

Merged
MSNev merged 2 commits intomainfrom
alert-autofix-5402
May 4, 2026
Merged

Potential fix for code scanning alert no. 5402: Semicolon insertion#2727
MSNev merged 2 commits intomainfrom
alert-autofix-5402

Conversation

@MSNev
Copy link
Copy Markdown
Collaborator

@MSNev MSNev commented Apr 21, 2026

Potential fix for https://github.com/microsoft/ApplicationInsights-JS/security/code-scanning/5402

Add an explicit semicolon after the _self.throwInternal = (...) => { ... } assignment in shared/AppInsightsCore/src/diagnostics/DiagnosticLogger.ts (the block ending at current line 170).

Best fix without changing functionality:

  • Change the closing } of that assignment statement to };.
  • Do not alter logic, imports, or surrounding methods.

No new methods/imports/definitions are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@MSNev
Copy link
Copy Markdown
Collaborator Author

MSNev commented Apr 23, 2026

@copilot update this PR by updating the branch

Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

@copilot update this PR by updating the branch

Branch has been updated by merging the latest changes from main (commit 2ad0bf19).

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Collaborator Author

@MSNev MSNev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MSNev MSNev marked this pull request as ready for review May 4, 2026 17:22
@MSNev MSNev requested a review from a team as a code owner May 4, 2026 17:22
Copilot AI review requested due to automatic review settings May 4, 2026 17:22
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR addresses the code scanning alert about possible semicolon insertion by making the arrow-function assignment in DiagnosticLogger.ts terminate explicitly with a semicolon, without changing behavior.

Changes:

  • Add an explicit semicolon after the _self.throwInternal = (...) => { ... } assignment.
  • Leave surrounding logic, imports, and method structure unchanged.

@MSNev MSNev merged commit afdb5dd into main May 4, 2026
14 checks passed
@MSNev MSNev deleted the alert-autofix-5402 branch May 4, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants