-
Notifications
You must be signed in to change notification settings - Fork 1
/
Morning1.ndproj
2861 lines (2563 loc) · 146 KB
/
Morning1.ndproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<NDepend AppName="Morning" Platform="DotNet">
<OutputDir KeepHistoric="True" KeepXmlFiles="True">C:\Users\bfoster\Dropbox\DEV\Morning\Morning\NDependOut1</OutputDir>
<Assemblies>
<Name>View</Name>
<Name>ViewModel</Name>
<Name>Model</Name>
<Name>BaseInterfaceLibrary</Name>
<Name>Services</Name>
<Name>Messenger</Name>
<Name>ServiceTests</Name>
<Name>Factory</Name>
<Name>FactoryTest</Name>
<Name>WindowNavigator</Name>
<Name>DependencyInjector</Name>
<Name>SampleViewModelData</Name>
<Name>EntryPoint</Name>
</Assemblies>
<FrameworkAssemblies>
<Name>PresentationFramework</Name>
<Name>System.Xaml</Name>
<Name>System</Name>
<Name>mscorlib</Name>
<Name>PresentationCore</Name>
<Name>Ninject</Name>
<Name>System.Core</Name>
<Name>System.Web.Services</Name>
<Name>System.Xml</Name>
<Name>Microsoft.VisualStudio.QualityTools.UnitTestFramework</Name>
<Name>System.Windows.Forms</Name>
<Name>System.Drawing</Name>
</FrameworkAssemblies>
<Dirs>
<Dir>C:\windows\Microsoft.NET\Framework\v4.0.30319</Dir>
<Dir>C:\windows\Microsoft.NET\Framework\v4.0.30319\WPF</Dir>
<Dir>C:\Users\bfoster\Dropbox\DEV\Morning\Morning\Morning\bin\Debug</Dir>
<Dir>C:\Users\bfoster\Dropbox\DEV\Morning\Morning\Services\bin\Debug</Dir>
<Dir>C:\Users\bfoster\Dropbox\DEV\Morning\Morning\ServiceTests\bin\Debug</Dir>
<Dir>C:\Users\bfoster\Dropbox\DEV\Morning\Morning\Factory\bin\Debug</Dir>
<Dir>C:\Users\bfoster\Dropbox\DEV\Morning\Morning\FactoryTest\bin\Debug</Dir>
<Dir>C:\Users\bfoster\Dropbox\DEV\Morning\Morning\WindowNavigator\bin\Debug</Dir>
<Dir>C:\Users\bfoster\Dropbox\DEV\Morning\Morning\EntryPoint\bin\Debug</Dir>
</Dirs>
<Report Kind="0" SectionsEnabled="12287" XslPath="" Flags="64512">
<Section Enabled="True">Application Metrics</Section>
<Section Enabled="True">.NET Assemblies Metrics</Section>
<Section Enabled="True">Treemap Metric View</Section>
<Section Enabled="True">.NET Assemblies Abstractness vs. Instability</Section>
<Section Enabled="True">.NET Assemblies Dependencies</Section>
<Section Enabled="True">.NET Assemblies Dependency Graph</Section>
<Section Enabled="True">.NET Assemblies Build Order</Section>
<Section Enabled="True">Analysis Log</Section>
<Section Enabled="True">CQL Rules Violated</Section>
<Section Enabled="True">Types Metrics</Section>
<Section Enabled="False">Types Dependencies</Section>
</Report>
<BuildComparisonSetting ProjectMode="DontCompare" BuildMode="MostRecentBuildAvailable" ProjectFileToCompareWith="" BuildFileToCompareWith="" NDaysAgo="1" />
<BaselineInUISetting ProjectMode="DontCompare" BuildMode="MostRecentBuildAvailable" ProjectFileToCompareWith="" BuildFileToCompareWith="" NDaysAgo="1" />
<CoverageFiles UncoverableAttribute="" />
<SourceFileRebasing FromPath="" ToPath="" />
<Queries>
<Group Name="Code Quality" Active="True" ShownInReport="False">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>Methods too complex - critical (ILCyclomaticComplexity)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
ILCyclomaticComplexity > 40 AND
ILNestingDepth > 4
ORDER BY ILCyclomaticComplexity DESC
// METHODS WHERE ILCyclomaticComplexity > 40
// are really too complex and should be split
// in smaller methods, or even types.
// (except if they are automatically generated by a tool).
// See the definition of the ILCyclomaticComplexity metric here
// http://www.ndepend.com/Metrics.aspx#ILCC
// See the definition of the ILNestingDepth metric here
// http://www.NDepend.com/Metrics.aspx#ILNestingDepth]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>Methods with too many parameters - critical (NbParameters)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
NbParameters > 8
ORDER BY NbParameters DESC
// METHODS WHERE NbParameters > 8 might be painful to call
// and might degrade performance. You should prefer using
// additional properties/fields to the declaring type to
// handle numerous states. Another alternative is to provide
// a class or structure dedicated to handle arguments passing
// (for example see the class System.Diagnostics.ProcessStartInfo
// and the method System.Diagnostics.Process.Start(ProcessStartInfo))
// See the definition of the NbParameters metric here
// http://www.ndepend.com/Metrics.aspx#NbParameters
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Quick summary of methods to refactor</Name>
WARN IF Count > 0 IN SELECT
METHODS /*OUT OF "YourGeneratedCode" */ WHERE
// Metrics' definitions
( NbLinesOfCode > 30 OR // http://www.ndepend.com/Metrics.aspx#NbLinesOfCode
NbILInstructions > 200 OR // http://www.ndepend.com/Metrics.aspx#NbILInstructions
CyclomaticComplexity > 20 OR // http://www.ndepend.com/Metrics.aspx#CC
ILCyclomaticComplexity > 50 OR // http://www.ndepend.com/Metrics.aspx#ILCC
ILNestingDepth > 4 OR // http://www.ndepend.com/Metrics.aspx#ILNestingDepth
NbParameters > 5 OR // http://www.ndepend.com/Metrics.aspx#NbParameters
NbVariables > 8 OR // http://www.ndepend.com/Metrics.aspx#NbVariables
NbOverloads > 6 ) // http://www.ndepend.com/Metrics.aspx#NbOverloads
AND
// Here are some ways to avoid taking account of generated methods.
!( NameIs "InitializeComponent()" OR
// NDepend.CQL.GeneratedAttribute is defined in
// the redistributable assembly $NDependInstallDir$\Lib\NDepend.CQL.dll
// You can define your own attribute to mark "Generated".
HasAttribute "OPTIONAL:NDepend.CQL.GeneratedAttribute") ]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods too big (NbLinesOfCode)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
NbLinesOfCode > 30
ORDER BY NbLinesOfCode DESC
// METHODS WHERE NbLinesOfCode > 30 are extremely complex
// and should be split in smaller methods
// (except if they are automatically generated by a tool).
// See the definition of the NbLinesOfCode metric here
// http://www.ndepend.com/Metrics.aspx#NbLinesOfCode]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods too big (NbILInstructions)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
NbILInstructions > 200
ORDER BY NbILInstructions DESC
// METHODS WHERE NbILInstructions > 200 are extremely complex
// and should be split in smaller methods
// (except if they are automatically generated by a tool).
// See the definition of the NbILInstructions metric here
// http://www.ndepend.com/Metrics.aspx#NbILInstructions]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods too complex (CyclomaticComplexity)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
CyclomaticComplexity > 20
ORDER BY CyclomaticComplexity DESC
// METHODS WHERE CyclomaticComplexity > 15 are hard to understand and maintain.
// METHODS WHERE CyclomaticComplexity > 30 are extremely complex
// and should be split in smaller methods
// (except if they are automatically generated by a tool).
// See the definition of the CyclomaticComplexity metric here
// http://www.ndepend.com/Metrics.aspx#CC]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods too complex (ILCyclomaticComplexity)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
ILCyclomaticComplexity > 40
ORDER BY ILCyclomaticComplexity DESC
// METHODS WHERE ILCyclomaticComplexity > 20
// are hard to understand and maintain.
// METHODS WHERE ILCyclomaticComplexity > 40
// are extremely complex and should be split
// in smaller methods
// (except if they are automatically generated by a tool).
// See the definition of the ILCyclomaticComplexity metric here
// http://www.ndepend.com/Metrics.aspx#ILCC]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods too complex (ILNestingDepth)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
ILNestingDepth > 4
ORDER BY ILNestingDepth DESC
// METHODS WHERE ILNestingDepth > 4 are hard
// to understand and maintain.
// METHODS WHERE ILNestingDepth > 8 is higher
// than 8 are extremely complex
// and should be split in smaller methods
// (except if they are automatically generated by a tool).
// See the definition of the NbILInstructions metric here
// http://www.NDepend.com/Metrics.aspx#ILNestingDepth]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods poorly commented (PercentageComment)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
PercentageComment < 20 AND
NbLinesOfCode > 10
ORDER BY PercentageComment ASC
// METHODS WHERE %Comment < 20 and that have
// at least 10 lines of code should be more commented.
// See the definition of the PercentageComment metric here
// http://www.ndepend.com/Metrics.aspx#PercentageComment]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods with too many parameters (NbParameters)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
NbParameters > 5
ORDER BY NbParameters DESC
// METHODS WHERE NbParameters > 5 might be painful to call
// and might degrade performance. You should prefer using
// additional properties/fields to the declaring type to
// handle numerous states. Another alternative is to provide
// a class or structure dedicated to handle arguments passing
// (for example see the class System.Diagnostics.ProcessStartInfo
// and the method System.Diagnostics.Process.Start(ProcessStartInfo))
// See the definition of the NbParameters metric here
// http://www.ndepend.com/Metrics.aspx#NbParameters]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods with too many local variables (NbVariables)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
NbVariables > 15
ORDER BY NbVariables DESC
// METHODS WHERE NbVariables > 8 are hard to understand and maintain.
// METHODS WHERE NbVariables > 15 are extremely complex
// and should be split in smaller methods
// (except if they are automatically generated by a tool).
// See the definition of the Nbvariables metric here
// http://www.ndepend.com/Metrics.aspx#Nbvariables]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods with too many overloads (NbOverloads)</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
NbOverloads > 6 AND
!IsOperator // Don't report operator overload
ORDER BY NbOverloads DESC
// METHODS WHERE NbOverloads > 6 might
// be a problem to maintain and provoke higher coupling
// than necessary.
// This might also reveal a potential misused of the
// C# and VB.NET language that since C#3 and VB9 support
// object initialization. This feature helps reducing the number
// of constructors of a class.
// See the definition of the NbOverloads metric here
// http://www.ndepend.com/Metrics.aspx#NbOverloads]]></Query>
<Group Name="Type Metrics" Active="True" ShownInReport="False">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>Types too big - critical (NbLinesOfCode)</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
NbLinesOfCode > 500 OR
NbILInstructions > 3000
ORDER BY NbLinesOfCode DESC
// METHODS WHERE NbLinesOfCode > 500 are extremely complex
// and should be split in a smaller group of types.
// (except if they are automatically generated by a tool).
// See the definition of the NbLinesOfCode metric here
// http://www.ndepend.com/Metrics.aspx#NbLinesOfCode
// In average, a line of code is compiled to around
// 6 IL instructions. This is why the code metric
// NbILInstructions is used here, in case the
// code metric NbLinesOfCode is un-available because
// of missing assemblies corresponding PDB files.
// See the definition of the NbILInstructions metric here
// http://www.ndepend.com/Metrics.aspx#NbILInstructions
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types with too many methods</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
NbMethods > 20
ORDER BY NbMethods DESC
// TYPES WHERE NbMethods > 20 might be hard to
// understand and maintain
// but there might be cases where it is relevant
// to have a high value for NbMethods.
// For example, the System.Windows.Forms.DataGridView
// standard class has more than 1000 methods.
// See the definition of the NbMethods metric here
// http://www.ndepend.com/Metrics.aspx#NbMethods]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types with too many fields</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
NbFields > 20 AND
!IsEnumeration
ORDER BY NbFields DESC
// TYPES WHERE NbFields > 20 AND !IsEnumeration
// might be hard to understand and maintain
// but there might be cases where it is relevant
// to have a high value for NbFields.
// For example, the System.Windows.Forms.Control
// standard class has more than 200 fields.
// The value of the metric NbFields might be a better
// indicator of complex type.
// See the definition of the NbFields metric here
// http://www.ndepend.com/Metrics.aspx#NbFields]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types with poor cohesion (LCOM)</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
LCOM > 0.8 AND
NbFields > 10 AND
NbMethods >10
ORDER BY LCOM DESC
// TYPES WHERE LCOM > 0.8 AND NbFields > 10
// AND NbMethods >10 might be problematic.
// However, it is very hard to avoid such
// non-cohesive types. The LCOMHS metric
// is often considered as more efficient to
// detect non-cohesive types.
// See the definition of the LCOM metric here
// http://www.ndepend.com/Metrics.aspx#LCOM]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types with poor cohesion (LCOMHS)</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
LCOMHS > 0.95 AND
NbFields > 10 AND
NbMethods >10
ORDER BY LCOMHS DESC
// TYPES WHERE LCOMHS > 1.0 AND NbFields > 10 AND
// NbMethods >10 should be avoided.
// Note that this rule is stronger
// than the rule
// TYPES WHERE LCOM > 0.8 AND NbFields > 10 AND NbMethods >10.
// See the definition of the LCOMHS metric here
// http://www.ndepend.com/Metrics.aspx#LCOMHS]]></Query>
</Group>
</Group>
<Group Name="Design" Active="True" ShownInReport="False">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Assembly should not contain namespaces dependency cycles</Name>
WARN IF Count > 0 IN SELECT ASSEMBLIES WHERE
ContainsNamespaceDependencyCycle
// Dependency cycles between namespaces must be avoided
// in order to have a levelized and comprehensive design.
// More info available on the screencast 'Reduce the complexity'
// http://s3.amazonaws.com/NDependOnlineDemos/NDependReducingComplexity_viewlet_swf.html
// You can also read this article
// http://www.theserverside.net/tt/articles/showarticle.tss?id=ControllingDependencies
// For any assembly matched, to display internal namespaces dependency cycle(s),
// just right-click the assembly and select:
// --> View internal Dependency Cycles on Graph ... or ...
// --> View internal Dependency Cycles on Matrix (Recommended)
// In the Matrix, dependency cycles are represented with red squares and black cells.
// To browse easily dependency cycles, the Matrix comes with the option:
// --> Display Direct and Indirect Dependencies
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Avoid partitioning the code base through too many Assemblies</Name>
WARN IF Count > 50 IN
SELECT ASSEMBLIES WHERE !IsFrameworkAssembly
// Each .NET Assembly represents one or several physical file.
// Having too many .NET Assemblies is a symptom of considering
// physical .NET Assemblies as logical components.
// We advise having less, and bigger, .NET Assemblies
// and using the concept of namespaces to define logical components.
// Benefits are:
// - Much faster compilation time
// (compilation time divided by 10 wouldn't be surprising)
// - Faster startup time for your program
// - Easier deploiement thanks to less files to manage.
// - If you are developing a Framework,
// less .NET assemblies to reference and manage for your users
//
// More information can be found here:
// http://codebetter.com/blogs/patricksmacchia/archive/2008/12/08/advices-on-partitioning-code-through-net-assemblies.aspx
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Type should not have too many responsibilities (Efferent Coupling)</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
TypeCe > 50
ORDER BY TypeCe DESC
// The Efferent Coupling (TypeCe) for a particular type is
// the number of types it directly depends on. Notice that
// types declared in third party assemblies are taken into account.
// Types that depends on too many others type (more than 50)
// are complex and have more than one responsibility. They
// are good candidate for refactoring.
// More information available in this article:
// http://codebetter.com/blogs/patricksmacchia/archive/2008/02/15/code-metrics-on-coupling-dead-code-design-flaws-and-re-engineering.aspx
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>A stateless class or structure might be turned into a static type</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
SizeOfInst ==0 AND
// For accuracy, this rule doesn't take
// account of types that implement some interfaces.
// and classes that have a base class and don't
// derive directly from System.Object, or classes
// that have sub-classes children.
NbInterfacesImplemented == 0 AND
((IsClass AND DepthOfInheritance == 1
AND NbChildren == 0)
OR IsStructure) AND
!IsStatic AND
!IsGeneric
// this rule indicates stateless types that might
// eventually be turned into static classes.
// See the definition of the SizeOfInst metric here
// http://www.ndepend.com/Metrics.aspx#SizeOfInst]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Class shouldn't be too deep in inheritance tree </Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
DepthOfInheritance >= 6
ORDER BY DepthOfInheritance DESC
// Branches too long in the derivation should be avoided.
// See the definition of the DepthOfInheritance metric here
// http://www.ndepend.com/Metrics.aspx#DIT
// You can discard specific classes with by-design high
// DepthOfInheritance with such condition for example:
// AND !DeriveFrom "System.Windows.Forms.Form" ]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Class with no descendant should be sealed if possible</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
IsClass AND
NbChildren ==0 AND
!IsSealed AND
!IsStatic
// AND !IsPublic <-- You might want to add this condition
// if you are developping a framework
// with classes that are intended to be
// sub-classed by your clients.
ORDER BY NbLinesOfCode]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Classes that are candidate to be turned into Structures</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
IsClass AND
!IsStatic AND
SizeOfInst > 0 AND
SizeOfInst <= 16 AND // Structure instance must not be too big,
// else it degrades performance.
NbChildren == 0 AND // Must not have children
DepthOfInheritance == 1 // Must derive directly from System.Object
// AND IsSealed <-- You might want to add this condition
// to restreint the set.
// AND IsImmutable <-- Structures should be immutable type.
// AND !IsPublic <-- You might want to add this condition if
// you are developping a framework with classes
// that are intended to be sub-classed by
// your clients.
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Avoid namespaces with few types</Name>
WARN IF Count > 0 IN SELECT NAMESPACES WHERE
NbTypes < 5
ORDER BY NbTypes ASC
// Make sure that there is a logical organization
// to each of your namespaces, and that there is a
// valid reason for putting types in a sparsely
// populated namespace. Namespaces should contain
// types that are used together in most scenarios.
// When their applications are mutually exclusive,
// types should be located in separate namespaces]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Nested types should not be visible</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
IsNested AND
!IsPrivate AND
!IsInFrameworkAssembly
// A nested type is a type declared within the
// scope of another type. Nested types are useful
// for encapsulating private implementation details
// of the containing type. Used for this purpose,
// nested types should not be externally visible.
// Do not use externally visible nested types for
// logical grouping or to avoid name collisions;
// instead, use namespaces.]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Avoid empty interfaces</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
IsInterface AND
NbMethods == 0
// Interfaces define members that provide a behavior
// or usage contract. The functionality described by
// the interface can be adopted by any type,
// regardless of where the type appears in the
// inheritance hierarchy. A type implements an
// interface by providing implementations for the
// interface's members. An empty interface does not
// define any members, and as such, does not define
// a contract that can be implemented.
// If your design includes empty interfaces that
// types are expected to implement, you are probably
// using an interface as a marker, or a way of
// identifying a group of types. If this identification
// will occur at runtime, the correct way to accomplish
// this is to use a custom attribute. Use the presence
// or absence of the attribute, or the attribute's
// properties, to identify the target types. If the
// identification must occurs at compile time, then using
// an empty interface is acceptable.]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Avoid interfaces with too many methods</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
IsInterface AND
NbMethods > 20
// An interface should abstract a clear and well-defined concept.
// Such concept shoudln't be represented with too many methods.
// Here the metric NbMethods might be a bit biased by the fact
// that a read/write property lead to 2 accessor methods,
// the getter and the setter. The same remark applies with event
// add and remove accessor.
// See the definition of the NbMethods metric here
// http://www.ndepend.com/Metrics.aspx#NbMethods
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Declare types in namespaces</Name>
WARN IF Count > 0 IN SELECT NAMESPACES WHERE
NameIs "" AND
!IsInFrameworkAssembly
// Types are declared within namespaces to
// prevent name collisions, and as a way of
// organizing related types in an object hierarchy.
// Types outside any named namespace are in a
// global namespace that cannot be referenced
// in code. If an anonymous namespace can be found,
// it means that it contains types outside of namespaces.]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Empty static constructor can be discarded</Name>
WARN IF Count > 0 IN SELECT METHODS WHERE
IsClassConstructor AND
NbLinesOfCode == 0
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Assemblies with poor cohesion (RelationalCohesion)</Name>
WARN IF Count > 0 IN SELECT ASSEMBLIES WHERE
NbTypes > 20 AND // Relational Cohesion metrics is relevant only if there are several types
(RelationalCohesion < 1.5 OR
RelationalCohesion > 4.0)
// As classes inside an assembly should be strongly related,
// the cohesion should be high. On the other hand, a value
// which is too high may indicate over-coupling. A good range
// for RelationalCohesion is 1.5 to 4.0.
// See the definition of the RelationalCohesion metric here
// http://www.ndepend.com/Metrics.aspx#RelationalCohesion]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Assemblies that don't satisfy the Abstractness/Instability principle</Name>
WARN IF Percentage > 15 IN SELECT ASSEMBLIES WHERE
NormDistFromMainSeq > 0.7
ORDER BY NormDistFromMainSeq DESC
// See the definition of the NormDistFromMainSeq metric here
// http://www.ndepend.com/Metrics.aspx#DitFromMainSeq]]></Query>
<Group Name="Performance" Active="True" ShownInReport="False">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Instances size shouldn't be too big (SizeOfInst)</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
SizeOfInst > 64
ORDER BY SizeOfInst DESC
// TYPES WHERE SizeOfInst > 64 might degrade performance
// (depending on the number of instances created at runtime)
// and might be hard to maintain. However it is not a rule
// since sometime there is no alternative (the size of
// instances of the System.Net.NetworkInformation.SystemIcmpV6Statistics
// standard class is 2064 bytes).
// See the definition of the SizeOfInst metric here
// http://www.ndepend.com/Metrics.aspx#SizeOfInst]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Boxing/unboxing should be avoided (Method)</Name>
WARN IF Percentage > 5 IN SELECT METHODS WHERE
IsUsingBoxing OR
IsUsingUnboxing
// Thanks to generics, boxing and unboxing should be rare.]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Boxing/unboxing should be avoided (Type)</Name>
WARN IF Percentage > 5 IN SELECT TYPES WHERE
IsUsingBoxing OR
IsUsingUnboxing
// Thanks to generics, boxing and unboxing should be rare.]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Attribute classes should be sealed</Name>
WARN IF Count > 0 IN SELECT TYPES WHERE
IsAttributeClass AND
!IsSealed AND
!IsAbstract AND
IsPublic AND
!IsInFrameworkAssembly
// The .NET Framework class library provides methods
// for retrieving custom attributes. By default,
// these methods search the attribute inheritance
// hierarchy; for example System.Attribute.GetCustomAttribute
// searches for the specified attribute type, or any
// attribute type that extends the specified attribute
// type. Sealing the attribute eliminates the search
// through the inheritance hierarchy, and can improve
// performance.]]></Query>
</Group>
</Group>
<Group Name="Code Diff" Active="True" ShownInReport="True">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>API Breaking Changes: Types</Name>
WARN IF Count > 0 IN SELECT TYPES
WHERE IsPublic AND (VisibilityWasChanged OR WasRemoved)
// This rule warns if a public type is not public anymore or if it has been removed.
// This can break the code of your clients.
// More information on breaking changes here:
// http://codebetter.com/blogs/patricksmacchia/archive/2008/01/20/avoid-api-breaking-changes.aspx
// To run this rule properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison
// This can be done at analysis time throught the menu:
// Project Properties -> Analysis -> Analysis Comparison
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods added</Name>
SELECT METHODS WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods where code was changed</Name>
SELECT METHODS WHERE CodeWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Public Types added</Name>
SELECT TYPES WHERE WasAdded AND IsPublic
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types added</Name>
SELECT TYPES WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types where code was changed</Name>
SELECT TYPES WHERE CodeWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Namespaces added</Name>
SELECT NAMESPACES WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Namespaces where code was changed</Name>
SELECT NAMESPACES WHERE CodeWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Types that were not used and that are now used</Name>
SELECT TYPES WHERE IsUsedRecently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Methods that were not used and that are now used</Name>
SELECT METHODS WHERE IsUsedRecently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Group Name="API Breaking Changes" Active="True" ShownInReport="False">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>API Breaking Changes: Methods</Name>
WARN IF Count > 0 IN SELECT METHODS
WHERE
IsPublic AND
(VisibilityWasChanged OR WasRemoved)
// This rule warns if a public method is
// not public anymore or if it has been removed.
// This can break the code of your clients.
// More information on breaking changes here:
// http://codebetter.com/blogs/patricksmacchia/archive/2008/01/20/avoid-api-breaking-changes.aspx
// To run this rule properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison
// This can be done at analysis time throught the menu:
// Project Properties -> Analysis -> Analysis Comparison
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>API Breaking Changes: Types</Name>
WARN IF Count > 0 IN SELECT TYPES
WHERE IsPublic AND (VisibilityWasChanged OR WasRemoved)
// This rule warns if a public type is not public anymore or if it has been removed.
// This can break the code of your clients.
// More information on breaking changes here:
// http://codebetter.com/blogs/patricksmacchia/archive/2008/01/20/avoid-api-breaking-changes.aspx
// To run this rule properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison
// This can be done at analysis time throught the menu:
// Project Properties -> Analysis -> Analysis Comparison
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>API Breaking Changes: Interfaces</Name>
WARN IF Count > 0 IN SELECT TYPES
WHERE IsInterface AND IsPublic AND (WasChanged AND !CommentsWereChanged)
// This rule warns if a public interface has been changed, but not because of comment change.
// This can break the code of your clients that implements such interface.
// More information on breaking changes here:
// http://codebetter.com/blogs/patricksmacchia/archive/2008/01/20/avoid-api-breaking-changes.aspx
// To run this rule properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison
// This can be done at analysis time throught the menu:
// Project Properties -> Analysis -> Analysis Comparison]]></Query>
</Group>
<Group Name="Changes Summary" Active="False" ShownInReport="False">
<Group Name="Methods" Active="False" ShownInReport="False">
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods added</Name>
SELECT METHODS WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison
]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods removed</Name>
SELECT METHODS WHERE WasRemoved
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods where code was changed</Name>
SELECT METHODS WHERE CodeWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods where comments were changed</Name>
SELECT METHODS WHERE CommentsWereChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods where visibility was changed</Name>
SELECT METHODS WHERE VisibilityWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods that became obsolete</Name>
SELECT METHODS WHERE BecameObsolete
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
</Group>
<Group Name="Fields" Active="False" ShownInReport="False">
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Fields added</Name>
SELECT FIELDS WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Fields removed</Name>
SELECT FIELDS WHERE WasRemoved
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
</Group>
<Group Name="Types" Active="False" ShownInReport="False">
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types added</Name>
SELECT TYPES WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types removed</Name>
SELECT TYPES WHERE WasRemoved
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types where code was changed</Name>
SELECT TYPES WHERE CodeWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types where comments were changed</Name>
SELECT TYPES WHERE CommentsWereChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types where visibility was changed</Name>
SELECT TYPES WHERE VisibilityWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types that became obsolete</Name>
SELECT TYPES WHERE BecameObsolete
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
</Group>
<Group Name="Namespaces" Active="False" ShownInReport="False">
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Namespaces added</Name>
SELECT NAMESPACES WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Namespaces removed</Name>
SELECT NAMESPACES WHERE WasRemoved
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Namespaces where code was changed</Name>
SELECT NAMESPACES WHERE CodeWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Namespaces where comments were changed</Name>
SELECT NAMESPACES WHERE CommentsWereChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
</Group>
<Group Name="Assemblies" Active="False" ShownInReport="False">
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Assemblies added</Name>
SELECT ASSEMBLIES WHERE WasAdded
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Assemblies removed</Name>
SELECT ASSEMBLIES WHERE WasRemoved
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Assemblies where code was changed</Name>
SELECT ASSEMBLIES WHERE CodeWasChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Assemblies where comments were changed</Name>
SELECT ASSEMBLIES WHERE CommentsWereChanged
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
</Group>
<Group Name="Third party Code Usage" Active="False" ShownInReport="False">
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Methods that were not used and that are now used</Name>
SELECT METHODS WHERE IsUsedRecently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Methods that were used and that are not used anymore</Name>
SELECT METHODS WHERE IsNotUsedAnymore
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Types that were not used and that are now used</Name>
SELECT TYPES WHERE IsUsedRecently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Types that were used and that are not used anymore</Name>
SELECT TYPES WHERE IsNotUsedAnymore
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Types where usage changed</Name>
SELECT TYPES WHERE IsUsedDifferently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Namespaces that were not used and that are now used</Name>
SELECT NAMESPACES WHERE IsUsedRecently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Namespaces that were used and that are not used anymore</Name>
SELECT NAMESPACES WHERE IsNotUsedAnymore
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Namespaces where usage changed</Name>
SELECT NAMESPACES WHERE IsUsedDifferently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Assemblies that were not used and that are now used</Name>
SELECT ASSEMBLIES WHERE IsUsedRecently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Assemblies that were used and that are not used anymore</Name>
SELECT ASSEMBLIES WHERE IsNotUsedAnymore
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Assemblies where usage changed</Name>
SELECT ASSEMBLIES WHERE IsUsedDifferently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Fields that were not used and that are now used</Name>
SELECT FIELDS WHERE IsUsedRecently
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
<Query Active="False" DisplayList="False" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Third party Fields that were used and that are not used anymore</Name>
SELECT FIELDS WHERE IsNotUsedAnymore
// To run this query properly 2 analysis
// must be compared.
// This can be done throught the menu:
// NDepend -> Compare -> Define the project's Baseline for Comparison]]></Query>
</Group>
</Group>
</Group>
<Group Name="Code Coverage" Active="True" ShownInReport="True">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Complex methods should be 100% covered by tests</Name>
WARN IF Count > 0 IN SELECT METHODS
/*OUT OF "YourGeneratedCode" */
WHERE
// These metrics' definitions are available here:
// http://www.ndepend.com/Metrics.aspx#MetricsOnMethods
( NbLinesOfCode > 30 OR
ILCyclomaticComplexity > 50 OR
ILNestingDepth > 4 OR
NbParameters > 5 OR
NbVariables > 8 OR
NbOverloads > 6 ) AND
// Take care only of complex methods
// already covered a bit, but not completely covered.
PercentageCoverage > 0 AND
PercentageCoverage < 100
ORDER BY NbLinesOfCode DESC,
NbLinesOfCodeNotCovered ,
PercentageCoverage
// To run this rule properly coverage data must be
// gathered from NCover™ or Visual Studio™ Coverage.
// This can be done throught the menu:
// NDepend -> Coverage -> Import Coverage Files
// This can be done at analysis time throught the menu:
// Project Properties -> Analysis -> Code Coverage
// More information on how to import coverage data here:
// http://www.ndepend.com/Coverage.aspx]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Method changed poorly covered</Name>
SELECT METHODS WHERE
PercentageCoverage < 30 AND