★ wanayoo — archive 1999 https://github.com/PowerShell/PSScriptAnalyzer/issues/315Nouvelle recherche | Portail wanayoo
Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Additional properties in the emitted diagnostic records #315

Closed
raghushantha opened this issue Oct 8, 2015 · 2 comments
Closed

Additional properties in the emitted diagnostic records #315

raghushantha opened this issue Oct 8, 2015 · 2 comments

Comments

@raghushantha
Copy link
Member

@raghushantha raghushantha commented Oct 8, 2015

There is suggestion to for diagnostic records to contain the following fields - ask for rule to emit additional meaningful metadata:

ImpactLevel
Doc Url for rule - provide feedback and learn about the rule author, optional verbose educational content explaining what the rule is about and what the measures are to improve the script, like FeedbackURL and AdviceURL

[Tobias]
Use the ImpactLevel attribute by the rule author to indicate how “expensive” the rule is in terms of time it takes to run.
So ImpactLevel = “Low” would indicate a rule that produces immediate results, whereas ImpactLevel = “High” would indicate a rule that does extensive analysis and may take considerable system resources. This type of info may be important to decide which rules to apply in different environments, i.e. when applied in real-time, no high impact rules would be evaluated or pushed to a separate thread.

[Raghu] Good suggestion. [Severity, Rule documentation, namespace etc] are some of the properties returned by the rule diagnostic record. ImpactLevel is a useful addition. Along with the URL property from your earlier suggestion.
Since there is a significant interest in making the rule metadata more informational, I will start a discussion on our page with the community.
Along with this, one can also use the Profile support in to customize the rules that can be run for a given environment [Dev/Test/Prod..]

@kapilmb
Copy link

@kapilmb kapilmb commented Oct 18, 2016

Closing this as there is no discussion happening as to which properties need to be added, why they should be added, and whether adding them is worth the engineering effort.

@kapilmb kapilmb closed this Oct 18, 2016
@LaurentDardenne
Copy link

@LaurentDardenne LaurentDardenne commented Oct 22, 2016

Perhaps it is too late to answer in this thread...

I have a rule to detect the possibles optimizations to the 'for' statement.
I can not add to the Diagnostic record an information to refactoring this line.

I must emit a Diagnostic record with the AST of the for statement, then analyze it again.
A property like Control.tag would be a solution.
I know, it is not a good design, but PSSA it is not a refactoring tool...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.