PowerShell / PowerShell/PSScriptAnalyzer
The rule PSUseShouldProcessForStateChangingFunctions is far too simple
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
You can't determine if a command is "State Changing" based purely on the verb. This is the sort of stuff that makes me SO upset at this module that I just want to throw it out -- it takes too much time to go through and review stuff when most of the warnings/errors are wrong.
For one example, I'm getting that warning on a bunch of XML document commands like "New-XElement" and "New-XAttribute" which obviously don't modify system state, they just create xml nodes and attributes which can at least hypothetically be added to a document in memory.
For another example, almost every single command in the ShowUI module uses the "New" verb to generate UI elements on windows, not to modify the system state.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Überprüfung der Regel PSUseShouldProcessForStateChangingFunctions und der gemeldeten Fälle der Befehle New-XElement, New-XAttribute und ShowUI. Bestimme, wie die Regel Befehle unterscheiden sollte, die XML- oder UI-Elemente im Speicher erstellen, von Befehlen, die den Systemzustand ändern, und füge anschließend Abdeckung hinzu, die zeigt, dass die False-Positive-Warnungen verschwunden sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, powershell
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100