20. července 2005 18:51Hi
I am trying to parse a method body in a custom rule for FXCOP and filter some words.
The method.Body.Statements does not contain the text of the statement.
Is there any other method to get the result?
21. července 2005 2:55FxCop is a binary checker. The abstract syntax trees exposed by Method.Body are raised from IL. So, any information that's directly tied to source is lost. We are considering adding a source-based analysis in the future, but unfortunately it does not exist today.
VSTS Development: Code Analysis
21. července 2005 15:54Thanks .
This means I can not filter some words and/or phrases from my code base by designing a rule, at present,right?
21. července 2005 17:20That is correct. If you need to perform source-based analysis, you could consider writing a VS add-in and using the C# code model to do the work you're interested in.