<p>I am interested in writing static code analyzer for vb.net to see if it conforms to my company standard coding guidelines. Please advise from where i have to start.</p>

[{'answer_id': 74573, 'author': 'Haacked', 'author_id': 598, 'author_profile': 'https://Stackoverflow.com/users/598', 'pm_score': 4, 'selected': False, 'text': '<p>Rather than write your own static code analyzer, I recommend you use <a href="http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx" rel="noreferrer">FxCop</a>: and instead, write custom FxCop rules for your needs. It\'ll save you a lot of time.\n<a href="http://www.binarycoder.net/fxcop/" rel="noreferrer">http://www.binarycoder.net/fxcop/</a></p>\n'}, {'answer_id': 74578, 'author': 'Jonathan Rupp', 'author_id': 12502, 'author_profile': 'https://Stackoverflow.com/users/12502', 'pm_score': 0, 'selected': False, 'text': "<p>Start with FxCop.  If you can't do what you're trying there, try something like NStatic or NDepend.</p>\n"}, {'answer_id': 74609, 'author': 'Alex Fort', 'author_id': 12624, 'author_profile': 'https://Stackoverflow.com/users/12624', 'pm_score': 2, 'selected': False, 'text': "<p>I would suggest you use Mono's Gendarme. It's a very nice tool, with plenty of built in rules. It also generates nice HTML reports.</p>\n"}, {'answer_id': 74636, 'author': 'Scott Dorman', 'author_id': 1559, 'author_profile': 'https://Stackoverflow.com/users/1559', 'pm_score': 0, 'selected': False, 'text': '<p>The best options are to use FxCop or StyleCop and write custom rules if necessary.</p>\n'}, {'answer_id': 74736, 'author': 'David B Heise', 'author_id': 13124, 'author_profile': 'https://Stackoverflow.com/users/13124', 'pm_score': 2, 'selected': True, 'text': '<p><a href="http://go.microsoft.com/fwlink/?LinkId=70294" rel="nofollow noreferrer">FXCop</a> is a good start for coding problems/mistakes, <a href="http://blogs.msdn.com/sourceanalysis/" rel="nofollow noreferrer">StyleCop</a> is good for coding style (obviously), but if neither of those two work then you then you can either write a parser yourself or use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.vbcodeprovider.aspx" rel="nofollow noreferrer">VBCodeProvider</a> class in the .Net Framework</p>\n'}, {'answer_id': 74741, 'author': 'alnayyir', 'author_id': 13127, 'author_profile': 'https://Stackoverflow.com/users/13127', 'pm_score': 0, 'selected': False, 'text': "<p>Use FxCop, this isn't a project you want to undertake personally. The parsing/lexical rules involved and the possible catches would be insane. The only way I could imagine doing it while retaining a modicum of sanity would be to use Lisp thanks to the extreme amount of expressiveness, but again, best to use FxCop.</p>\n\n<p>If you must write a custom in-house tool for some (dogmatic?) reason, I'd recommend writing a Lisp program that does only basic rules-checking. Don't try to make it comprehensive, we're talking the kind of frontier that AI researchers are dealing with in terms of the parsing capabilities of a piece of software.</p>\n\n<p>Just use Lisp to find the possible obvious offenders, or just at catching whatever it ends up being good at catching in terms of non-compliant code, then subject it to a brief human eye scan. I highly recommend abusing macros if you do use Lisp to write the parser.</p>\n"}, {'answer_id': 74991, 'author': 'Krzysztof Kozmic', 'author_id': 13163, 'author_profile': 'https://Stackoverflow.com/users/13163', 'pm_score': 2, 'selected': False, 'text': "<p>if you need mroe architectural insight use NDepend. This tool does not stop to amaze me. It can do soo much more than FxCop. It's commercial though, but has a free trial version</p>\n"}, {'answer_id': 186607, 'author': 'aaimnr', 'author_id': 26444, 'author_profile': 'https://Stackoverflow.com/users/26444', 'pm_score': 0, 'selected': False, 'text': '<p>I agree with one of the posters that it would be a quite difficult taks, but rather than with Lisp I\'d start with F#, just like Microsoft did for their 3rd party windows drivers analysis tool:</p>\n\n<p><a href="http://arstechnica.com/journals/microsoft.ars/2005/11/10/1796" rel="nofollow noreferrer">http://arstechnica.com/journals/microsoft.ars/2005/11/10/1796</a></p>\n\n<p>F# shares Lisp\'s expressiveness (ok, almost) and works on CLR just like VB.NET, which would make the whole thing easier.</p>\n'}]
['https://Stackoverflow.com/questions/74561', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']