Skip to content

New Rule Suggestion / Rule amendment - in response to #903 #904

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
kilasuit opened this issue Feb 21, 2018 · 3 comments
Open

New Rule Suggestion / Rule amendment - in response to #903 #904

kilasuit opened this issue Feb 21, 2018 · 3 comments

Comments

@kilasuit
Copy link
Contributor

In Issue #903 the rule in my opinion correctly throws on a += for simple defined arrays using the $var = @() method of defining an array to the var variable

I would suggest that a new rule is created that correctly identifies this method as being an expensive action and that a recommendation to use a fully defined Array collection would be a better suggestion, initially suggesting using a System.Collections.ArrayList

This rule should look for both @() & += and suggest converting these calls better scripting practices

@essentialexch
Copy link

#903 doesn't use an array.

@bergmeister
Copy link
Collaborator

I agree that we need a rule to catch the += on arrays due to the performance implications but I also agree that this issue is not really linked to the referenced issue. They are 2 separate issues to me.

@bergmeister
Copy link
Collaborator

bergmeister commented Mar 10, 2018

Going through some past issues reveals that this seems to be a duplicate of #806. I will close this issue in the next days then but plan to do a PoC of implementing such a rule in the next 1-2 months.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants