I am usin开发者_JAVA技巧g code analysis tool of VS 2010..two things that i have noticed was not provided:
- Proper casing of variable,method and properties names
- xml comments for each method,event and other activities
Point - 2 can be address by Stylecop - enter link description here. Assuming your using c#.
FxCop does handle one of those things. Are you sure you've turned on all of the rules?
Under the Microsoft.Naming FxCop rules you have rules such as CA1702: "Compound words should be cased correctly."
Missing XML comments is actually a compiler wanring (warning 1591). I suspect you have to turn on XML documentation generation in the project for that to occur, though. Under the build tab of your project properties, make sure the "Xml documentation file" checkbox is marked.
If you have any money to spend, I'd recommend Resharper. If you don't have any to spend, download the trial anyway and give it a go. It'll highlight casing as you code in accordance with configurable rules.
StyleCop will warn of public methods without sufficient comments. There's a good answer on the difference between FXCop and StyleCop here: Stylecop vs FXcop
Code analysis only checks for good coding practise such as remembering to dispose disposable objects etc
StyleCop will help address the other two scenarios you outlined above.
精彩评论