Adding a problem to rule during AfterAnalysis event
The rule i've written uses several of the check overrides to collect statistics about the target assemblies. Its not until the AfterAnalysis event on a rule that i can analyze the statistics and determine if i need to add a problem or not.
But it looks like you can only add a Problem during the check overloads, because nothing shows up in the results pane in when FxCop is finished running the rules.
I have several rules i'd like to implement that would behave in the same fashon. Is there any way to add a Problem during the AfterAnalysis event?
Hi John,
We currently don't support customized analysis that needs to run over the binaries in two passes. You can kind of work around this though by doing your analysis in BeforeAnalysis and doing the reporitng in the Check overloads. You can get access to the assemblies being analyzed via RuleUtilities.AnalysisAssemblies.
Please note that this type of analysis is not tested by us at all, so no guarentees that your analysis will work ok.
Regards,
Jeffrey
Thats too bad because its the check methods that give me easy access to information i'm gathering statistics about. This makes my code very easy to write and understand.
I'll see if I can do it in the Before Analysis instead.