René's URL Explorer Experiment


Title: Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator by bergmeister · Pull Request #935 · PowerShell/PSScriptAnalyzer · GitHub

Open Graph Title: Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator by bergmeister · Pull Request #935 · PowerShell/PSScriptAnalyzer

X Title: Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator by bergmeister · Pull Request #935 · PowerShell/PSScriptAnalyzer

Description: PR Summary Hooray, this is the fix for the most common false positive of PSSA. The main issue was that it was treating += as assignment. There are more special cases that need to be looked at like e.g. if the scriptblock is in the context of dot-sourcing but this is a different story, therefore getting the false positives fixed first, will, make the overall experience in most cases much better since some people are excluding the rule due to the many false positives. Fixes #699 Fixes #827 Fixes #903 # Note to myself that other bugs in the comment of this issue should be extracted Fixes PowerShell/vscode-powershell#776 PR Checklist Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets. Please mark anything not applicable to this PR NA. PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes User facing documentation needed Change is not breaking Make sure you've added a new test if existing tests do not effectively test the code changed This PR is ready to merge and is not work in progress If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

Open Graph Description: PR Summary Hooray, this is the fix for the most common false positive of PSSA. The main issue was that it was treating += as assignment. There are more special cases that need to be looked at like ...

X Description: PR Summary Hooray, this is the fix for the most common false positive of PSSA. The main issue was that it was treating += as assignment. There are more special cases that need to be looked at like ...

Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/pull/935

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:de229c82-e0db-7760-0624-6a13c111843f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8B32:176800:28EACC:3873F5:6AFD0A91
html-safe-nonce3d9aa56c5b4c6358b888c8298724662cde48fb7940b02081fa251814f61f9021
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjMyOjE3NjgwMDoyOEVBQ0M6Mzg3M0Y1OjZBRkQwQTkxIiwidmlzaXRvcl9pZCI6Ijc2OTY5NzAzMzEyODU0MjQ3ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace109f30ef3c1e6e256f08bd2039cdbbbae73e7b8e8611f3bc34288b84beaa11d
hovercard-subject-tagpull_request:175114163
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
twitter:imagehttps://avatars.githubusercontent.com/u/9250262?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9250262?s=400&v=4
og:image:altPR Summary Hooray, this is the fix for the most common false positive of PSSA. The main issue was that it was treating += as assignment. There are more special cases that need to be looked at like ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb29de2abb97b6307b16270785efeb58b51a117d5a9b659acf00b77aa00e7043b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id33149177
octolytics-dimension-repository_nwoPowerShell/PSScriptAnalyzer
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id33149177
octolytics-dimension-repository_network_root_nwoPowerShell/PSScriptAnalyzer
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c9e619def6d670dc18a45d3b02cea938c1c7e47
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F935%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F935%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=PowerShell%2FPSScriptAnalyzer
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
PowerShellhttps://github.com/PowerShell
PSScriptAnalyzerhttps://github.com/PowerShell/PSScriptAnalyzer
Codehttps://github.com/PowerShell/PSScriptAnalyzer
Issues407 (407)https://github.com/PowerShell/PSScriptAnalyzer/issues
Pull requests34 (34)https://github.com/PowerShell/PSScriptAnalyzer/pulls
Discussionshttps://github.com/PowerShell/PSScriptAnalyzer/discussions
Actionshttps://github.com/PowerShell/PSScriptAnalyzer/actions
Projectshttps://github.com/PowerShell/PSScriptAnalyzer/projects
Wikihttps://github.com/PowerShell/PSScriptAnalyzer/wiki
Security and qualityhttps://github.com/PowerShell/PSScriptAnalyzer/security
Insightshttps://github.com/PowerShell/PSScriptAnalyzer/insights
Sign up for GitHub https://github.com/signup?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
James Truher (JamesWTruher)https://github.com/JamesWTruher
PowerShell:developmenthttps://github.com/PowerShell/PSScriptAnalyzer/tree/development
bergmeister:UseDeclaredVarsMoreThanAssignments_FixFalsePositiveshttps://github.com/bergmeister/PSScriptAnalyzer/tree/UseDeclaredVarsMoreThanAssignments_FixFalsePositives
Conversation 3 https://github.com/PowerShell/PSScriptAnalyzer/pull/935
Commits 5 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/commits
Checks 0 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/checks
Files changed https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#top
Show all changes 5 commits https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
c9f97de fix false positives such as '$a=@(); $b | foreach-object { $a+=$c}' b… bergmeister Mar 14, 2018 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/commits/c9f97de464f07f1e69ea4fd70f6019339d7c6b55
7daf5a4 add test (it turns out a regression happened for 'flags strongly type… bergmeister Mar 14, 2018 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/commits/7daf5a4fdb9f639e8b4eb37e4d3f676c59ab9603
bc1c007 fix regression for strongly typed variables by being more selective a… bergmeister Mar 14, 2018 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/commits/bc1c0079cd2dd3cc0c0c7dc35fc8c363cd325ce9
077d035 add additional test case for unassigned variable bergmeister Mar 16, 2018 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/commits/077d0353bda9417a696d052ea7e17c3a4cd23fb0
647efe7 Merge branch 'development' of https://github.com/PowerShell/PSScriptA… bergmeister Mar 16, 2018 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/commits/647efe7d9017ff6b03b459e2fb642913890f6119
Clear filters https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
UseDeclaredVarsMoreThanAssignments.cs https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#diff-91092df8f2f2d9a383000d9f9b88ed7f23dbba1b89ada7bdd6210161c43d3fa9
UseDeclaredVarsMoreThanAssignments.tests.ps1 https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#diff-c3a9e2c8611b9a5f523851b5c888234fdb67c35368374fb4d7a03e46231f047e
Rules/UseDeclaredVarsMoreThanAssignments.cshttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#diff-91092df8f2f2d9a383000d9f9b88ed7f23dbba1b89ada7bdd6210161c43d3fa9
View file https://github.com/bergmeister/PSScriptAnalyzer/blob/647efe7d9017ff6b03b459e2fb642913890f6119/Rules/UseDeclaredVarsMoreThanAssignments.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/935/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#diff-91092df8f2f2d9a383000d9f9b88ed7f23dbba1b89ada7bdd6210161c43d3fa9
https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#diff-91092df8f2f2d9a383000d9f9b88ed7f23dbba1b89ada7bdd6210161c43d3fa9
Tests/Rules/UseDeclaredVarsMoreThanAssignments.tests.ps1https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#diff-c3a9e2c8611b9a5f523851b5c888234fdb67c35368374fb4d7a03e46231f047e
View file https://github.com/bergmeister/PSScriptAnalyzer/blob/647efe7d9017ff6b03b459e2fb642913890f6119/Tests/Rules/UseDeclaredVarsMoreThanAssignments.tests.ps1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/935/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#diff-c3a9e2c8611b9a5f523851b5c888234fdb67c35368374fb4d7a03e46231f047e
James Truher (JamesWTruher)https://github.com/JamesWTruher
Mar 16, 2018https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#r175191231
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Christoph Bergmeister (bergmeister)https://github.com/bergmeister
Mar 16, 2018https://github.com/PowerShell/PSScriptAnalyzer/pull/935/files#r175230653
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/935/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.