4

A client I work for has begun using NDepend as a replacement for FXCop, and the "architect" has compiled a list of practically unusable CQL queries, which I gather he has taken from advice from the NDepend website.

An example of what "I think" is an unhelpful query

WARN IF Count > 0 IN 
SELECT METHODS WHERE PercentageComment < 20 
AND NbLinesOfCode > 10

ie: must have at least 2 lines of comment for each 10 lines of code

So what I trying to gather is a useful set of queries that we can use as developers.

Please only provide a single query per response (with description) so that it can be voted accordingly. Please only provide a single query per response (with description) so that it can be voted accordingly.

Xian
  • 76,121
  • 12
  • 43
  • 49
  • 4
    If your architect is concentrating on the percentage number of comments, you have a bigger problem than the best CQL queries! – Mitch Wheat Feb 15 '09 at 12:51
  • It depends. Your product, existing code base, people in your team will all affect the rules that are important to you. I would personally remove the rule on comments. – Fenton Sep 05 '12 at 13:52

1 Answers1

4

Xian, now that CQLinq (Code Rule over LINQ Query) is released, dozens of new default rules are available and most existing ones have been enhanced.

Here are ten of my preferred ones:

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92
  • Hi Patrick.. thanks for the response.. Would you possibly be able to break each of these rules into individual answers so they can be voted independently? – Xian Feb 15 '09 at 18:12