IntelliTect / IntelliTect/CodingGuidelines
Add analyzer that flags var in pattern matching
Open
enhancement
- Dominant language
- C#
- Stars
- 12
- Forks
- 16
- Avg merge
- 2m
- Merged PRs (30d)
- 7
Description
Based on internal discussion.
Pattern matching with var provides little value since it effectively matches everything and ends up copying to a local value.
Match on this
```
if ( bar is var foo )
```
Suggested code change (just to help educate people)
```
var foo = bar;
if ( true )
```
Contributor guide
Research direction
No files, tests, or analyzer entry points are named in the issue. First locate the repository's analyzer implementation and test layout, then use the var-in-pattern example as the reproduction; done means the analyzer flags this pattern and the behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100