PowerShell / PowerShell/PSScriptAnalyzer

Add arity check to type compatibility method checking

Open
#1,153 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Rules Issue - Enhancement
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

The UseCompatibleTypes rule has access to information about how many parameters and what types methods take.

Type resolution in PowerShell would be fairly difficult, but checking the number of arguments of a method is pretty easy to do.

As a stretch, the overload could be determined and checked properly in cases where an argument is statically determinable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the UseCompatibleTypes rule and its method-checking logic. Verify how method parameter counts and types are represented, then make the arity check the done condition; overload resolution for statically determinable arguments is described as a stretch goal.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.