Skip to content

Potential fix for code scanning alert no. 5401: Unused variable, import, function or class#2726

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

Potential fix for code scanning alert no. 5401: Unused variable, import, function or class#2726
MSNev merged 2 commits intomainfrom
alert-autofix-5401

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/5401

Remove the unused PageView symbol from the named import list in extensions/applicationinsights-properties-js/src/PropertiesPlugin.ts.

  • General fix: for unused import findings, delete only the unused imported identifier while keeping the module import and all used identifiers intact.
  • Best minimal change here: in the @microsoft/applicationinsights-core-js import block (around lines 8–11), remove PageView and keep PageViewEnvelopeType (and all others) unchanged.
  • No new methods, definitions, or external dependencies are required.

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

…rt, function or class

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

Done. The branch has been updated with the latest changes from main (commit 8e250e21).

@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:23
@MSNev MSNev requested a review from a team as a code owner May 4, 2026 17:23
Copilot AI review requested due to automatic review settings May 4, 2026 17:23
@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 makes a minimal cleanup to address a code scanning alert by removing an unused named import from PropertiesPlugin.ts.

Changes:

  • Remove the unused PageView symbol from the @microsoft/applicationinsights-core-js import list.
  • Preserve all other imported identifiers, including PageViewEnvelopeType.
  • Limit the change to the reported unused import without altering runtime logic.

@MSNev MSNev merged commit 3a75a06 into main May 4, 2026
14 checks passed
@MSNev MSNev deleted the alert-autofix-5401 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