GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix length check in `PSSnapinQualifiedName.GetInstance()` by hvitved · Pull Request #8837 · PowerShell/PowerShell

Conversation

@hvitved

@hvitved Tom Hvitved (hvitved) commented Feb 6, 2019

Copy link
Copy Markdown
Contributor

Hi,

I came across this when looking at the alerts for this project on LGTM.com (full disclosure: I work on the C# analysis there). The existing check splitName.Length < 0 is redundant, and I believe it should have been splitName.Length == 0, since the constructor of PSSnapinQualifiedName expects an array of length 1 or 2.

You can see the original alert on LGTM.com here: https://lgtm.com/projects/g/PowerShell/PowerShell/alerts/?mode=tree&ruleFocus=1506101336231

Best regards,
Tom

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hvitved
Fix length check in PSSnapinQualifiedName.GetInstance()
eb73a8f
@hvitved
Tom Hvitved (hvitved) requested review from Bruce Payette (BrucePay) and Dongbo Wang (daxian-dbw) as code owners February 6, 2019 14:51
RDIL
Reece Dunham (RDIL) approved these changes Feb 6, 2019
View reviewed changes
bergmeister
Christoph Bergmeister (bergmeister) reviewed Feb 6, 2019
View reviewed changes

@bergmeister Christoph Bergmeister (bergmeister) left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Snapins are not supported any more and this looks like left-over code. Maybe we should (if we can) add this file to the list files to be excluded from compilation in the csproj instead? There is a separate issue to cleanup snapin related code btw

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

RDIL reacted with eyes emoji
All reactions
  • 👀 1 reaction
iSazonov
Ilya (iSazonov) approved these changes Feb 7, 2019
View reviewed changes
@iSazonov

Ilya (iSazonov) commented Feb 7, 2019

Copy link
Copy Markdown
Collaborator

Christoph Bergmeister (@bergmeister) The code is used for modules. If I remember correctly most of SnapIn code already was removed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iSazonov

Ilya (iSazonov) commented Feb 7, 2019

Copy link
Copy Markdown
Collaborator

Tom Hvitved (@hvitved) Please add empty commit with '[Feature]' in the commit header to run all tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iSazonov Ilya (iSazonov) self-assigned this Feb 7, 2019
@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Feb 7, 2019
@bergmeister

Christoph Bergmeister (bergmeister) commented Feb 7, 2019

Copy link
Copy Markdown
Contributor

Ok, thanks. Sorry, this was not clear to me given the surrounding variable names.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hvitved
[Feature]
4028653
@iSazonov
Ilya (iSazonov) merged commit 5f59a9d into PowerShell:master Feb 8, 2019
@iSazonov

Ilya (iSazonov) commented Feb 8, 2019

Copy link
Copy Markdown
Collaborator

Tom Hvitved (@hvitved) Thanks for your contribution!

hvitved reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hvitved
Tom Hvitved (hvitved) deleted the ps-snaping-qualified-name-get-instance branch February 11, 2019 11:07
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@hvitved @iSazonov
Fix length check in PSSnapinQualifiedName.GetInstance() (PowerShell…
44e0644
…#8837)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iSazonov Ilya (iSazonov) iSazonov approved these changes
@BrucePay Bruce Payette (BrucePay) Awaiting requested review from BrucePay
@daxian-dbw Dongbo Wang (daxian-dbw) Awaiting requested review from daxian-dbw
+2 more reviewers
@bergmeister Christoph Bergmeister (bergmeister) bergmeister left review comments
@RDIL Reece Dunham (RDIL) RDIL approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@iSazonov Ilya (iSazonov)

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hvitved @iSazonov @bergmeister @RDIL
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.