开发者

Visual Studio 2010 code analysis

开发者 https://www.devze.com 2023-02-22 01:35 出处:网络
I am usin开发者_JAVA技巧g code analysis tool of VS 2010..two things that i have noticed was not provided:

I am usin开发者_JAVA技巧g code analysis tool of VS 2010..two things that i have noticed was not provided:

  1. Proper casing of variable,method and properties names
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号