当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - NDepend Code Quality Metrics - Custom CQL - Brownfield development

问题描述:

I'm working on a brown-field project that was initially developed for .NET 1.1, and subsequently was retro-fitted to .NET 2.0, with a smattering of .NET 3.5

I'm curious what kind of metrics to use to begin finding optimization and modernization inflection points.

Are there any good CQL queries that anyone has found useful in cleaning up and refactoring 'legacy' .NET code?

网友答案:

NDepend now supports code rule over LINQ query (CQLinq) that is much more more powerful and flexible than CQL (still supported).

What really matters is what kind of refactoring make a code cleaner, according to you. Dozens of new code rules are provided but the real strength is that it has never been easier to write your own code convention and rule.

Here are 5 conventions worth to follow according to me:

  • Types that used to be 100% covered but not anymore
  • Types with disposable instance fields must be disposable
  • Avoid namespaces dependency cycles
  • UI layer shouldn't use directly DB types
  • API Breaking Changes: Methods

I wrote more about my preferences here:

Fighting Fabricated Complexity

Top 5 development practices you should care for

分享给朋友:
您可能感兴趣的文章:
随机阅读: