forked from strict-lang/Strict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStrict.ndproj
13435 lines (12091 loc) · 570 KB
/
Strict.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="Strict" Platform="DotNet" FileWrittenByProductVersion="2021.1.0.9500">
<OutputDir KeepXmlFiles="False">.\NDependOut</OutputDir>
<IDEFiles>
<IDEFile FilePath=".\Strict.sln" Filters="-test" Configuration="DEBUG|AnyCPU" />
</IDEFiles>
<Assemblies />
<FrameworkAssemblies>
<Name>System.Runtime</Name>
<Name>System.Diagnostics.Debug</Name>
<Name>System.Collections</Name>
<Name>System.Runtime.Extensions</Name>
<Name>System.Linq</Name>
<Name>System.IO.FileSystem</Name>
<Name>mscorlib</Name>
</FrameworkAssemblies>
<Dirs>
<Dir>C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0</Dir>
<Dir>C:\Program Files\dotnet\sdk\NuGetFallbackFolder</Dir>
<Dir>C:\Users\Administrator\.nuget\packages</Dir>
<Dir>C:\Users\Benjamin\.nuget\packages</Dir>
</Dirs>
<MergeCodeGeneratedByCompiler>True</MergeCodeGeneratedByCompiler>
<ZipSourceFiles>True</ZipSourceFiles>
<Report Kind="0" SectionsEnabled="110591" XslPath="" Flags="261120" />
<BuildComparisonSetting ProjectMode="CurrentProject" BuildMode="NDaysAgoAnalysisResult" ProjectFileToCompareWith="" BuildFileToCompareWith="" NDaysAgo="30" />
<BaselineInUISetting ProjectMode="CurrentProject" BuildMode="NDaysAgoAnalysisResult" ProjectFileToCompareWith="" BuildFileToCompareWith="" NDaysAgo="30" />
<CoverageFiles CoverageDir="" UncoverableAttribute="" />
<TrendMetrics UseCustomLog="False" LogRecurrence="3" LogLabel="2" UseCustomDir="False" CustomDir="">
<Chart Name="Size" ShowInReport="True">
<Serie MetricName="# Lines of Code" MetricUnit="Loc" Color="#FF00BFFF" ChartType="Line" ScaleExp="0" />
<Serie MetricName="# Lines of Code Covered" MetricUnit="Loc" Color="#FF32CD32" ChartType="Area" ScaleExp="0" />
<Serie MetricName="# Lines of Code (NotMyCode)" MetricUnit="Loc" Color="#FFA9A9A9" ChartType="Area" ScaleExp="0" />
<Serie MetricName="# Lines of Comments" MetricUnit="Lines" Color="#FF008000" ChartType="Line" ScaleExp="0" />
</Chart>
<Chart Name="% Coverage and % Debt" ShowInReport="True">
<Serie MetricName="Percentage Code Coverage" MetricUnit="%" Color="#FF32CD32" ChartType="Area" ScaleExp="0" />
<Serie MetricName="Percentage Debt (Metric)" MetricUnit="%" Color="#FFFF0000" ChartType="Line" ScaleExp="0" />
</Chart>
<Chart Name="Issues" ShowInReport="True">
<Serie MetricName="# New Issues since Baseline" MetricUnit="issues" Color="#FFFF0000" ChartType="Line" ScaleExp="0" />
<Serie MetricName="# Issues Fixed since Baseline" MetricUnit="issues" Color="#FF32CD32" ChartType="Line" ScaleExp="0" />
<Serie MetricName="# Blocker/Critical/High Issues" MetricUnit="issues" Color="#FFFF8C00" ChartType="Line" ScaleExp="0" />
<Serie MetricName="# Issues" MetricUnit="issues" Color="#FFFFD700" ChartType="Line" ScaleExp="-2" />
</Chart>
<Chart Name="Rules" ShowInReport="True">
<Serie MetricName="# Rules" MetricUnit="Rules" Color="#FF66CDAA" ChartType="Line" ScaleExp="0" />
<Serie MetricName="# Rules Violated" MetricUnit="Rules" Color="#FFFF8C00" ChartType="Area" ScaleExp="0" />
<Serie MetricName="# Critical Rules Violated" MetricUnit="Rules" Color="#FFFF0000" ChartType="Area" ScaleExp="0" />
</Chart>
<Chart Name="Quality Gates" ShowInReport="True">
<Serie MetricName="# Quality Gates Fail" MetricUnit="quality gates" Color="#FFFF0000" ChartType="Line" ScaleExp="0" />
<Serie MetricName="# Quality Gates Warn" MetricUnit="quality gates" Color="#FFFF8C00" ChartType="Line" ScaleExp="0" />
<Serie MetricName="# Quality Gates" MetricUnit="quality gates" Color="#FF32CD32" ChartType="Line" ScaleExp="0" />
</Chart>
<Chart Name="Debt" ShowInReport="True">
<Serie MetricName="Debt (Metric)" MetricUnit="man-days" Color="#FFFF0000" ChartType="Line" ScaleExp="0" />
<Serie MetricName="Annual Interest (Metric)" MetricUnit="man-days" Color="#FFFF8C00" ChartType="Line" ScaleExp="0" />
</Chart>
</TrendMetrics>
<HistoricAnalysisResult PersistRecurrence="3" UseCustomDir="False" CustomDir="" />
<SourceFileRebasing FromPath="" ToPath="" />
<PathVariables />
<RuleFiles />
<GraphFiles />
<ProjectRules AreActive="True" />
<ProjectDebtSettings DebtSettingsStorage="0" SettingsFilePath="">
<DebtSettings>
<DebtFactor>1</DebtFactor>
<AnnualInterestFactor>1</AnnualInterestFactor>
<DebtDefault>0</DebtDefault>
<AnnualInterestDefault>0</AnnualInterestDefault>
<DebtStringFormat>$ManDay$</DebtStringFormat>
<MoneyPerManHour>50</MoneyPerManHour>
<Currency>USD</Currency>
<CurrencyLocation>After</CurrencyLocation>
<EstimatedNumberOfManDayToDevelop1000LogicalLinesOfCode>18</EstimatedNumberOfManDayToDevelop1000LogicalLinesOfCode>
<NumberOfWorkDayPerYear>240</NumberOfWorkDayPerYear>
<NumberOfWorkHourPerDay>8</NumberOfWorkHourPerDay>
<A2B_RatingThreshold>5</A2B_RatingThreshold>
<B2C_RatingThreshold>10</B2C_RatingThreshold>
<C2D_RatingThreshold>20</C2D_RatingThreshold>
<D2E_RatingThreshold>50</D2E_RatingThreshold>
<Low2Medium_SeverityThreshold>1200000000</Low2Medium_SeverityThreshold>
<Medium2High_SeverityThreshold>12000000000</Medium2High_SeverityThreshold>
<High2Critical_SeverityThreshold>72000000000</High2Critical_SeverityThreshold>
<Critical2Blocker_SeverityThreshold>360000000000</Critical2Blocker_SeverityThreshold>
</DebtSettings>
</ProjectDebtSettings>
<Queries>
<Group Name="Code Quality" Active="True" ShownInReport="False">
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>Methods too complex - critical</Name>
warnif count > 0 from m in JustMyCode.Methods where
m.ILCyclomaticComplexity > 25 &&
m.ILNestingDepth > 6 &&
m.FullName != "NVorbis.VorbisResidue+Residue0.Decode(DataPacket,Boolean[],Int32,Int32)" &&
m.Name != "GetSimpleName(String)" &&
!m.Name.StartsWith("FindChildren") ||
m.ILCyclomaticComplexity > 40 &&
m.Name != ".ctor()"
orderby m.ILCyclomaticComplexity descending, m.ILNestingDepth descending
select new { m, m.ILCyclomaticComplexity, m.ILNestingDepth }
//<Description>
// This rule matches methods where *CyclomaticComplexity* > 30
// or *ILCyclomaticComplexity* > 60
// or *ILNestingDepth* > 6.
// Such method is typically hard to understand and maintain.
//
// Maybe you are facing the **God Method** phenomenon.
// A "God Method" is a method that does way too many processes in the system
// and has grown beyond all logic to become *The Method That Does Everything*.
// When need for new processes increases suddenly some programmers realize:
// why should I create a new method for each processe if I can only add an *if*.
//
// See the definition of the *CyclomaticComplexity* metric here:
// http://www.ndepend.com/docs/code-metrics#CC
//
// See the definition of the *ILCyclomaticComplexity* metric here:
// http://www.ndepend.com/docs/code-metrics#ILCC
//
// See the definition of the *ILNestingDepth* metric here:
// http://www.ndepend.com/docs/code-metrics#ILNestingDepth
//</Description>
//<HowToFix>
// A large and complex method should be split in smaller methods,
// or even one or several classes can be created for that.
//
// During this process it is important to question the scope of each
// variable local to the method. This can be an indication if
// such local variable will become an instance field of the newly created class(es).
//
// Large *switch.case* structures might be refactored through the help
// of a set of types that implement a common interface, the interface polymorphism
// playing the role of the *switch cases tests*.
//
// Unit Tests can help: write tests for each method before extracting it
// to ensure you don't break functionality.
//</HowToFix>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>Types too big - critical</Name>
warnif count > 0 from t in JustMyCode.Types where
t.Name != "Entity" &&
t.Name != "EntityRenderer" &&
t.Name != "Matrix" &&
t.Name != "GLCore" &&
t.Name != "Scene" &&
t.Name != "AppRunner" &&
t.Name != "SceneEntityRepository" &&
!t.FullName.StartsWith("NVorbis") &&
!t.Name.EndsWith("Tests") &&
(t.NbLinesOfCode > 300 ||
t.NbILInstructions > 2200)
orderby t.NbLinesOfCode descending
select new { t, t.NbLinesOfCode, t.NbILInstructions, t.Methods, t.Fields }
//<Description>
// This rule matches types with more than 500 lines of code.
//
// Types where *NbLinesOfCode > 500* are extremely complex
// to develop and maintain.
// See the definition of the NbLinesOfCode metric here
// http://www.ndepend.com/docs/code-metrics#NbLinesOfCode
//
// Maybe you are facing the **God Class** phenomenon:
// A **God Class** is a class that controls way too many other classes
// in the system and has grown beyond all logic to become
// *The Class That Does Everything*.
//
// 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/docs/code-metrics#NbILInstructions
//</Description>
//<HowToFix>
// Types with many lines of code
// should be split in a group of smaller types.
//
// To refactor a *God Class* you'll need patience,
// and you might even need to recreate everything from scratch.
// Here are a few advices:
//
// - Think before pulling out methods: on what data does this method operate?
// What responsibility does it have?
//
// - Try to maintain the interface of the god class at first
// and delegate calls to the new extracted classes.
// In the end the god class should be a pure facade without own logic.
// Then you can keep it for convenience
// or throw it away and start to use the new classes only.
//
// - Unit Tests can help: write tests for each method before extracting it
// to ensure you don't break functionality.
//</HowToFix>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="True"><![CDATA[// <Name>Methods with too many parameters - critical</Name>
warnif count > 0 from m in JustMyCode.Methods where
!m.ParentType.IsRecord &&
!m.HasAttribute("System.Runtime.InteropServices.DllImportAttribute".AllowNoMatch()) &&
!m.ParentType.Name.EndsWith("PropertyDescriptor") &&
!m.ParentType.Name.EndsWith("Message") &&
!m.ParentType.Name.EndsWith("Trigger") &&
!m.ParentType.ParentNamespace.Name.EndsWith("Messages") &&
!m.Name.StartsWith("On") &&
!m.Name.StartsWith("Add") &&
!m.Name.StartsWith("Create") &&
!m.Name.StartsWith("FillEntity") &&
m.NbParameters > 4
orderby m.NbParameters descending
select new { m, m.NbParameters, m.ParentType }
//<Description>
// This rule matches methods with more than 8 parameters.
// Such method is painful to call and might degrade performance.
// See the definition of the *NbParameters* metric here:
// http://www.ndepend.com/docs/code-metrics#NbParameters
//</Description>
//<HowToFix>
// More properties/fields can be added to the declaring type to
// handle numerous states. An alternative is to provide
// a class or a structure dedicated to handle arguments passing.
// For example see the class *System.Diagnostics.ProcessStartInfo*
// and the method *System.Diagnostics.Process.Start(ProcessStartInfo)*.
//</HowToFix>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods too big</Name>
warnif count > 0 from m in JustMyCode.Methods where
m.Name != "GetPixelAverageColor(ColorImage,BoundingBox)" &&
m.Name != "GetValidDistance(DepthData,Int32,Int32,Single,Single)" &&
m.Name != "SearchForValidDistance(DepthData,Int32,Int32)" &&
m.Name != "InitAlignFilterBlock()"&&
!m.Name.StartsWith("AddVertices") &&
!m.Name.StartsWith("FillLineVertices") &&
!m.Name.StartsWith("SaveIfIsPrimitiveData") &&
!m.Name.StartsWith("LoadPrimitiveData") &&
!m.Name.StartsWith("Copy") &&
!m.FullName.Contains(".Scene") &&
!m.FullName.Contains(".Frameworks") &&
!m.IsClassConstructor && //should be ignored as some classes simply initialize a bunch of fields and this adds up, there is no code for this anyway
// should be mostly below 10, but NDepend is calculating this from the PDB, which adds some
// brackets and code we did not actually write (around 3 header + method block + 2 generated
// for blocks * 4, no method should be more complex than this upper limit). Some methods will
// slightly go above that and either need to be simplified and split up or should be excluded
// like above (if they are optimized methods, we should not have many of those).
m.NbLinesOfCode > 20+5 //see
orderby m.NbLinesOfCode descending, m.NbILInstructions descending
select new { m, lines=m.NbLinesOfCode-5, m.NbILInstructions }
//<Description>
// This rule matches methods where *NbLinesOfCode > 30* or
// (commented per default) *NbILInstructions > 200*.
// Such method can be hard to understand and maintain.
//
// However rules like *Methods too complex* or *Methods with too many variables*
// might be more relevant to detect *painful to maintain* methods,
// because complexity is more related to numbers of *if*,
// *switch case*, loops. than to just number of lines.
//
// See the definition of the *NbLinesOfCode* metric here
// http://www.ndepend.com/docs/code-metrics#NbLinesOfCode
//</Description>
//<HowToFix>
// Usually too big methods should be split in smaller methods.
//
// But long methods with no branch conditions, that typically initialize some data,
// are not necessarily a problem to maintain nor to test, and might not need
// refactoring.
//</HowToFix>IsClassConstructor]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods with too many parameters</Name>
warnif count > 0 from m in JustMyCode.Methods where
!m.ParentType.IsRecord &&
!m.HasAttribute("System.Runtime.InteropServices.DllImportAttribute".AllowNoMatch()) &&
!m.ParentType.Name.Contains("Renderer") &&
!m.FullName.Contains("NVorbis") &&
!m.FullName.Contains(".Frameworks") &&
!m.FullName.Contains(".WebCam") &&
m.ParentType.Name != "BinaryDataLoader" &&
m.ParentType.Name != "Drawing" &&
m.ParentType.Name != "CircularBuffer" &&
m.ParentType.Name != "Drawing+RenderGeometry" &&
m.ParentType.Name != "SpriteSheetAnimationUpdater" &&
m.ParentType.Name != "InputTriggerUpdater" &&
!m.Name.StartsWith("ReflectIfHittingBorder") &&
!m.ParentType.Name.EndsWith("Template") &&
!m.ParentType.Name.EndsWith("AssemblyExtensions") &&
!m.ParentType.Name.StartsWith("BinaryData") &&
!m.ParentType.Name.EndsWith("Tests") &&
!m.Name.StartsWith("AddVertices") &&
!m.Name.StartsWith("FillVerticesWithRotation(") &&
!m.Name.StartsWith("FillLineVertices(") &&
!m.Name.StartsWith("GetImageDifference(") &&
!m.Name.StartsWith("CopyRgb16DataToRgba(") &&
!m.Name.StartsWith("Create") &&
!m.Name.StartsWith("FillEntity(") &&
m.ParentType.Name != "GamePadButtonValueTrigger" &&
m.ParentType.Name != "EntityProcessor" &&
!m.Name.StartsWith("On") &&
!m.Name.StartsWith(".ctor(") &&
m.NbParameters > 5
orderby m.NbParameters descending
select new { m, m.NbParameters }
//<Description>
// This rule matches methods with more than 5 parameters.
// Such method might be painful to call and might degrade performance.
// See the definition of the *NbParameters* metric here:
// http://www.ndepend.com/docs/code-metrics#NbParameters
//</Description>
//<HowToFix>
// More properties/fields can be added to the declaring type to
// handle numerous states. An alternative is to provide
// a class or a structure dedicated to handle arguments passing.
// For example see the class *System.Diagnostics.ProcessStartInfo*
// and the method *System.Diagnostics.Process.Start(ProcessStartInfo))*.
//</HowToFix>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Methods with too many overloads</Name>
warnif count > 0 from m in JustMyCode.Methods where
m.NbOverloads > 6 &&
!m.Name.Contains("Visit") &&
!m.IsOperator // Don't report operator overload
orderby m.NbOverloads descending
let overloads =
m.IsConstructor ? m.ParentType.Constructors :
m.ParentType.Methods.Where(m1 => m1.SimpleName == m.SimpleName)
select new { m, overloads }
//<Description>
// Method overloading is the ability to create multiple methods of the same name
// with different implementations, and various set of parameters.
//
// This rule matches sets of method with more than 6 overloads.
//
// Such method set might be a problem to maintain
// and provokes higher coupling than necessary.
//
// See the definition of the *NbOverloads* metric here
// http://www.ndepend.com/docs/code-metrics#NbOverloads
//</Description>
//<HowToFix>
// Typically the *too many overloads* phenomenon appears when an algorithm
// takes a various set of in-parameters. Each overload is presented as
// a facility to provide a various set of in-parameters.
// In such situation, the C# and VB.NET language feature named
// *Named and Optional arguments* should be used.
//
// The *too many overloads* phenomenon can also be a consequence of the usage
// of the **visitor design pattern** http://en.wikipedia.org/wiki/Visitor_pattern
// since a method named *Visit()* must be provided for each sub type.
// In such situation there is no need for fix.
//</HowToFix>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types with too many methods</Name>
warnif count > 0 from t in JustMyCode.Types where
// Optimization: Fast discard of non-relevant types
t.Name != "Shader" &&
t.Name != "Entity" &&
t.Name != "EntityRenderer" &&
t.Name != "SceneSerializer" &&
t.Name != "Settings" &&
t.Name != "EditorService" &&
!t.Name.EndsWith("Tests") &&
t.InstanceMethods.Count() >
(t.FullName.Contains("Extensions") ||
t.FullName.Contains("Datatypes") ||
t.FullName.Contains("Collections") ||
t.FullName.Contains("Graphics") ||
t.Name.EndsWith("Device") ||
t.Name.EndsWith("Tests") ||
t.Name.StartsWith("Test") ||
t.Name == "ContentFileLoader" ||
t.Name == "EntityRenderer" ||
t.Name == "XmlData" ||
t.Name == "TcpClient" ||
t.Name == "Mouse" ||
t.Name == "AppRunner" ||
t.Name == "ReloadableDomainRunner" ||
t.Name == "TcpSocket" ||
t.Name.EndsWith("OnlineContentFileLoader") ||
t.Name == "InParentDrawAreaTrigger" ||
t.Name == "EntityInstance2D" ||
t.Name == "EntityInstance3D" ||
t.Name == "EntityRepository" ||
t.Name == "BaseEntityRepository" ||
t.Name == "SceneEntityRepository" ||
t.Name == "SceneRepository" ||
t.Name == "Scene" ||
t.Name == "Resolver" ||
t.Name == "Renderable" ||
t.Name == "EngineTypesResolver" ||
t.Name.EndsWith("Window") ||
t.Name.EndsWith("View") ||
t.Name.EndsWith("Commands") ||
t.Name.EndsWith("RenderData") ||
t.Name.StartsWith("RenderData") ||
t.Name.EndsWith("SystemInformation") ||
t.Name == "MicrosoftLogWriterAdapter" // Implementing interface has this many methods
? 48 : 24)
// Don't match these methods
let methods = t.Methods.Where(
m => !(m.IsGeneratedByCompiler ||
m.IsConstructor || m.IsClassConstructor ||
m.IsPropertyGetter || m.IsPropertySetter ||
m.IsEventAdder || m.IsEventRemover))
where methods.Count() > 20
orderby methods.Count() descending
select new { t,
nbMethods = methods.Count(),
instanceMethods = methods.Where(m => !m.IsStatic),
staticMethods = methods.Where(m => m.IsStatic)}
//<Description>
// This rule matches types with more than 20 methods.
// Such type might be hard to understand and maintain.
//
// Notice that methods like constructors or property
// and event accessors are not taken account.
//
// Having many methods for a type might be a symptom
// of too many responsibilities implemented.
//
// Maybe you are facing the **God Class** phenomenon:
// A **God Class** is a class that controls way too many other classes
// in the system and has grown beyond all logic to become
// *The Class That Does Everything*.
//</Description>
//<HowToFix>
// To refactor such type and increase code quality and maintainability,
// certainly you'll have to split the type into several smaller types
// that together, implement the same logic.
//
// To refactor a *God Class* you'll need patience,
// and you might even need to recreate everything from scratch.
// Here are a few advices:
//
// - Think before pulling out methods:
// What responsibility does it have?
// Can you isolate some subsets of methods that operate on the same subsets of fields?
//
// - Try to maintain the interface of the god class at first
// and delegate calls to the new extracted classes.
// In the end the god class should be a pure facade without own logic.
// Then you can keep it for convenience
// or throw it away and start to use the new classes only.
//
// - Unit Tests can help: write tests for each method before extracting it
// to ensure you don't break functionality.
//</HowToFix>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types with too many fields</Name>
warnif count > 0 from t in JustMyCode.Types
// Optimization: Fast discard of non-relevant types
where !t.IsEnumeration &&
t.Fields.Count() > 20 &&
!t.FullName.Contains(".Scene")
// Count instance fields and non-constant static fields
let fields = t.Fields.Where(f =>
!f.IsGeneratedByCompiler &&
!f.IsLiteral &&
!(f.IsStatic && f.IsInitOnly) &&
JustMyCode.Contains(f) )
where fields.Count() > 20
orderby fields.Count() descending
select new { t,
instanceFields = fields.Where(f => !f.IsStatic),
staticFields = fields.Where(f => f.IsStatic),
// See definition of Size of Instances metric here:
// http://www.ndepend.com/docs/code-metrics#SizeOfInst
t.SizeOfInst
}
//<Description>
// This rule matches types with more than 20 fields.
// Such type might be hard to understand and maintain.
//
// Notice that constant fields and static-readonly fields are not counted.
// Enumerations types are not counted also.
//
// Having many fields for a type might be a symptom
// of too many responsibilities implemented.
//</Description>
//<HowToFix>
// To refactor such type and increase code quality and maintainability,
// certainly you'll have to group subsets of fields into smaller types
// and dispatch the logic implemented into the methods
// into these smaller types.
//</HowToFix>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="False" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types with poor cohesion</Name>
warnif count > 0 from t in JustMyCode.Types where
(t.LCOM > 0.91 || t.LCOMHS > 0.94) &&
t.NbFields > 12 &&
t.NbMethods > 12 &&
t.Name != "Mouse" &&
!t.Name.EndsWith("ContentFileLoader") &&
t.Name != "OnlineServiceConnection" &&
t.Name != "SetDataPropertyProcessor" &&
t.Name != "AssemblyTypeLoader" &&
t.Name != "AppRunner" &&
t.Name != "MainWindow" &&
t.Name != "RegisterScene" &&
t.Name != "TcpSocket" &&
t.Name != "EntityProcessor" &&
t.Name != "EditorService" &&
t.Name != "Entity" &&
!t.FullName.Contains("NVorbis") &&
!t.FullName.Contains(".Frameworks") &&
!t.FullName.Contains(".WebCam")
orderby t.LCOM descending, t.LCOMHS descending
select new { t, t.LCOM, t.LCOMHS,
t.NbMethods, t.NbFields }
//<Description>
// This rule is based on the *LCOM code metric*,
// LCOM stands for **Lack Of Cohesion of Methods**.
// See the definition of the LCOM metric here
// http://www.ndepend.com/docs/code-metrics#LCOM
//
// The LCOM metric measures the fact that most methods are using most fields.
// A class is considered utterly cohesive (which is good)
// if all its methods use all its instance fields.
//
// Only types with enough methods and fields are taken account to avoid bias.
// The LCOM takes its values in the range [0-1].
//
// This rule matches types with LCOM higher than 0.8.
// Such value generally pinpoints a **poorly cohesive class**.
//
// There are several LCOM metrics.
// The LCOM HS (HS stands for Henderson-Sellers) takes its values in the range [0-2].
// A LCOM HS value higher than 1 should be considered alarming.
//</Description>
//<HowToFix>
// To refactor a poorly cohesive type and increase code quality and maintainability,
// certainly you'll have to split the type into several smaller and more cohesive types
// that together, implement the same logic.
//</HowToFix>]]></Query>
</Group>
<Group Name="Quality Gates" Active="False" ShownInReport="False">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Quality Gates Evolution</Name>
from qg in QualityGates
let qgBaseline = qg.OlderVersion()
let relyOnDiff = qgBaseline == null
let evolution = relyOnDiff ? (TrendIcon?)null :
// When a quality gate relies on diff between now and baseline
// it is not executed against the baseline
qg.ValueDiff() == 0d ?
TrendIcon.Constant :
(qg.ValueDiff() > 0 ?
( qg.MoreIsBad ? TrendIcon.RedUp: TrendIcon.GreenUp) :
(!qg.MoreIsBad ? TrendIcon.RedDown: TrendIcon.GreenDown))
select new { qg,
Evolution = evolution,
BaselineStatus = relyOnDiff? (QualityGateStatus?) null : qgBaseline.Status,
Status = qg.Status,
BaselineValue = relyOnDiff? (null) : qgBaseline.ValueString,
Value = qg.ValueString,
}
// <Description>
// Show quality gates evolution between baseline and now.
//
// When a quality gate relies on diff between now and baseline (like *New Debt since Baseline*)
// it is not executed against the baseline and as a consequence its evolution is not available.
//
// Double-click a quality gate for editing.
// </Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Percentage Coverage" Unit="%" />
failif value < 70%
warnif value < 80%
codeBase.PercentageCoverage
//<Description>
// Code coverage is a measure used to describe the degree to which the source code of a program
// is tested by a particular test suite. A program with high code coverage, measured as a percentage,
// has had more of its source code executed during testing which suggests it has a lower chance of
// containing undetected software bugs compared to a program with low code coverage.
//
// Code coverage is certainly the most important quality code metric. But coverage is not enough
// the team needs to ensure that results are checked at test-time. These checks can be done both
// in test code, and in application code through assertions. The important part is that a test
// must fail explicitely when a check gets unvalidated during the test execution.
//
// This quality gate define a warn threshold (70%) and a fail threshold (80%). These are
// indicative thresholds and in practice the more the better. To achieve high coverage and
// low risk, make sure that new and refactored classes gets 100% covered by tests and that
// the application and test code contains as many checks/assertions as possible.
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Percentage Coverage on New Code" Unit="%" />
failif value < 70%
warnif value < 80%
let newMethods = Application.Methods.Where(m => m.WasAdded() && m.NbLinesOfCode > 0)
let locCovered = newMethods.Sum(m => m.NbLinesOfCodeCovered)
let loc = newMethods.Sum(m => m.NbLinesOfCode)
select 100d * locCovered / loc
//<Description>
// *New Code* is defined as methods added since the baseline.
//
// To achieve high code coverage it is essential that new code gets properly
// tested and covered by tests. It is advised that all non-UI new classes gets
// 100% covered.
//
// Typically 90% of a class is easy to cover by tests and 10% is hard to reach
// through tests. It means that this 10% remaining is not easily testable, which
// means it is not well designed, which often means that this code is especially
// **error-prone**. This is the reason why it is important to reach 100% coverage
// for a class, to make sure that potentially *error-prone* code gets tested.
//</Description>
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Percentage Coverage on Refactored Code" Unit="%" />
failif value < 70%
warnif value < 80%
let newMethods = Application.Methods.Where(m => m.CodeWasChanged() && m.NbLinesOfCode > 0)
let locCovered = newMethods.Sum(m => m.NbLinesOfCodeCovered)
let loc = newMethods.Sum(m => m.NbLinesOfCode)
select 100d * locCovered / loc
//<Description>
// *Refactored Code* is defined as methods where *code was changed* since the baseline.
//
// Comment changes and formatting changes are not considerd as refactoring.
//
// To achieve high code coverage it is essential that refactored code gets properly
// tested and covered by tests. It is advised that when refactoring a class
// or a method, it is important to also write tests to make sure it gets 100% covered.
//
// Typically 90% of a class is easy to cover by tests and 10% is hard to reach
// through tests. It means that this 10% remaining is not easily testable, which
// means it is not well designed, which often means that this code is especially
// **error-prone**. This is the reason why it is important to reach 100% coverage
// for a class, to make sure that potentially *error-prone* code gets tested.
//</Description>
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Blocker Issues" Unit="issues" />
failif count > 0 issues
from i in Issues
where i.Severity == Severity.Blocker
select new { i, i.Severity, i.Debt, i.AnnualInterest }
//<Description>
// An issue with the severity **Blocker** cannot move to production, it must be fixed.
//
// The severity of an issue is either defined explicitely in the rule source code,
// either inferred from the issue *annual interest* and thresholds defined in the
// NDepend Project Properties > Issue and Debt.
//</Description>
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Critical Issues" Unit="issues" />
failif count > 10 issues
warnif count > 0 issues
from i in Issues
where i.Severity == Severity.Critical
select new { i, i.Severity, i.Debt, i.AnnualInterest }
//<Description>
// An issue with a severity level **Critical** shouldn't move to production.
// It still can for business imperative needs purposes, but at worst it must
// be fixed during the next iterations.
//
// The severity of an issue is either defined explicitely in the rule source code,
// either inferred from the issue *annual interest* and thresholds defined in the
// NDepend Project Properties > Issue and Debt.
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="New Blocker / Critical / High Issues" Unit="issues" />
failif count > 0 issues
from i in Issues
where i.Severity.EqualsAny(Severity.Blocker, Severity.Critical, Severity.High) &&
// Count both the new issues and the issues that became at least Critical
(i.WasAdded() || i.OlderVersion().Severity < Severity.High)
select new { i, i.Severity, i.Debt, i.AnnualInterest }
//<Description>
// An issue with the severity **Blocker** cannot move to production, it must be fixed.
//
// An issue with a severity level **Critical** shouldn't move to production.
// It still can for business imperative needs purposes, but at worth it must be fixed
// during the next iterations.
//
// An issue with a severity level **High** should be fixed quickly, but can wait until
// the next scheduled interval.
//
// The severity of an issue is either defined explicitely in the rule source code,
// either inferred from the issue *annual interest* and thresholds defined in the
// NDepend Project Properties > Issue and Debt.
//</Description>
]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Critical Rules Violated" Unit="rules" />
failif count > 0 rules
from r in Rules where r.IsCritical && r.IsViolated()
select new { r, issues = r.Issues() }
//<Description>
// The concept of critical rule is useful to pinpoint certain rules that
// should not be violated.
//
// A rule can be made critical just by checking the *Critical button* in the
// rule edition control and then saving the rule.
//
// This quality gate fails if any critical rule gets any violations.
//
// When no baseline is available, rules that rely on diff are not counted.
// If you observe that this quality gate count slightly decreases with no apparent reason,
// the reason is certainly that rules that rely on diff are not counted
// because the baseline is not defined.
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Percentage Debt" Unit="%" />
failif value > 30%
warnif value > 20%
let timeToDev = codeBase.EffortToDevelop()
let debt = Issues.Sum(i => i.Debt)
select 100d * debt.ToManDay() / timeToDev.ToManDay()
// <Description>
// % Debt total is defined as a percentage on:
//
// • the estimated total effort to develop the code base
//
// • and the the estimated total time to fix all issues (the Debt)
//
// Estimated total effort to develop the code base is inferred from
// # lines of code of the code base and from the
// *Estimated number of man-day to develop 1000 logicial lines of code*
// setting found in NDepend Project Properties > Issue and Debt.
//
// Debt documentation: https://www.ndepend.com/docs/technical-debt#Debt
//
// This quality gates fails if the estimated debt is more than 30%
// of the estimated effort to develop the code base, and warns if the
// estimated debt is more than 20% of the estimated effort to develop
// the code base
// </Description>]]></Query>
<Query Active="False" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Debt" Unit="man-days" />
failif value > 50 man-days
warnif value > 30 man-days
Issues.Sum(i => i.Debt).ToManDay()
//<Description>
// This Quality Gate is disabled per default because the fail and warn
// thresholds of unacceptable Debt in man-days can only depend on the
// project size, number of developers and overall context.
//
// However you can refer to the default Quality Gate **Percentage Debt**.
//
// The Debt is defined as the sum of estimated effort to fix all issues.
// Debt documentation: https://www.ndepend.com/docs/technical-debt#Debt
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="New Debt since Baseline" Unit="man-days" />
failif value > 2 man-days
warnif value > 0 man-days
let debt = Issues.Sum(i => i.Debt)
let debtInBaseline = IssuesInBaseline.Sum(i => i.Debt)
select (debt - debtInBaseline).ToManDay()
//<Description>
// This Quality Gate fails if the estimated effort to fix new or worsened
// issues (what is called the *New Debt since Baseline*) is higher
// than 2 man-days.
//
// This Quality Gate warns if this estimated effort is positive.
//
// Debt documentation: https://www.ndepend.com/docs/technical-debt#Debt
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Debt Rating per Namespace" Unit="namespaces" />
failif count > 0 namespaces
from n in Application.Namespaces
where n.DebtRating() != null &&
n.DebtRating().Value.EqualsAny(DebtRating.E, DebtRating.D)
select new {
n,
debtRating = n.DebtRating(),
debtRatio = n.DebtRatio(), // % of debt from which DebtRating is inferred
devTimeInManDay = n.EffortToDevelop().ToDebt(),
debtInManDay = n.AllDebt(),
issues = n.AllIssues()
}
// <Description>
// Forbid namespaces with a poor Debt Rating equals to **E** or **D**.
//
// The **Debt Rating** for a code element is estimated by the value of the **Debt Ratio**
// and from the various rating thresholds defined in this project *Debt Settings*.
//
// The **Debt Ratio** of a code element is a percentage of **Debt Amount** (in floating man-days)
// compared to the **estimated effort to develop the code element** (also in floating man-days).
//
// The **estimated effort to develop the code element** is inferred from the code elements
// number of lines of code, and from the project *Debt Settings* parameters
// *estimated number of man-days to develop 1000* **logical lines of code**.
//
// The **logical lines of code** corresponds to the number of debug breakpoints in a method
// and doesn't depend on code formatting nor comments.
//
// The Quality Gate can be modified to match assemblies, types or methods
// with a poor Debt Rating, instead of matching namespaces.
// </Description>]]></Query>
<Query Active="False" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="Annual Interest" Unit="man-days" />
failif value > 50 man-days
warnif value > 30 man-days
Issues.Sum(i => i.AnnualInterest).ToManDay()
//<Description>
// This Quality Gate is disabled per default because the fail and warn
// thresholds of unacceptable Annual-Interest in man-days can only depend
// on the project size, number of developers and overall context.
//
// However you can refer to the default Quality Gate
// **New Annual Interest since Baseline**.
//
// The Annual-Interest is defined as the sum of estimated annual cost
// in man-days, to leave all issues unfixed.
//
// Each rule can either provide a formula to compute the Annual-Interest
// per issue, or assign a **Severity** level for each issue. Some thresholds
// defined in *Project Properties > Issue and Debt > Annual Interest* are
// used to infer an Annual-Interest value from a Severity level.
// Annual Interest documentation: https://www.ndepend.com/docs/technical-debt#AnnualInterest
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <QualityGate Name="New Annual Interest since Baseline" Unit="man-days" />
failif value > 2 man-days
warnif value > 0 man-days
let ai = Issues.Sum(i => i.AnnualInterest)
let aiInBaseline = IssuesInBaseline.Sum(i => i.AnnualInterest)
select (ai - aiInBaseline).ToManDay()
//<Description>
// This Quality Gate fails if the estimated annual cost to leave all issues
// unfixed, increased from more than 2 man-days since the baseline.
//
// This Quality Gate warns if this estimated annual cost is positive.
//
// This estimated annual cost is named the **Annual-Interest**.
//
// Each rule can either provide a formula to compute the Annual-Interest
// per issue, or assign a **Severity** level for each issue. Some thresholds
// defined in *Project Properties > Issue and Debt > Annual Interest* are
// used to infer an Annual-Interest value from a Severity level.
// Annual Interest documentation: https://www.ndepend.com/docs/technical-debt#AnnualInterest
//</Description>]]></Query>
</Group>
<Group Name="Hot Spots" Active="True" ShownInReport="True">
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types Hot Spots</Name>
from t in JustMyCode.Types
where t.AllDebt() > Debt.Zero &&
t.AllAnnualInterest() > AnnualInterest.Zero
orderby t.AllDebt().Value.TotalMinutes descending
select new { t,
Debt = t.AllDebt(),
Issues = t.AllIssues(), // AllIssues = {types issues} union {members issues}
AnnualInterest = t.AllAnnualInterest(),
BreakingPoint = t.AllBreakingPoint(),
t.NbLinesOfCode,
// t.PercentageCoverage, to uncomment if coverage data is imported
DebtRating = t.DebtRating(),
DebtRatio = t.DebtRatio()
}
//<Description>
// This query lists **types with most Debt**,
// or in other words, types with issues that would need
// the largest effort to get fixed.
//
// Both issues on the type and its members are
// taken account.
//
// Since untested code often generates a lot of
// Debt, the type size and percentage coverage is shown
// (just uncomment *t.PercentageCoverage* in the query
// source code once you've imported the coverage data).
//
// The *Debt Rating* and *Debt Ratio* are also shown
// for informational purpose.
//
// --
//
// The amount of *Debt* is not a measure to prioritize
// the effort to fix issues, it is an estimation of how far
// the team is from clean code that abides by the rules set.
//
// For each issue the *Annual Interest* estimates the annual
// cost to leave the issues unfixed. The *Severity* of an issue
// is estimated through thresholds from the *Annual Interest*.
//
// The **Debt Breaking Point** represents the duration
// from now when the estimated cost to leave the issue unfixed
// costs as much as the estimated effort to fix it.
//
// Hence the shorter the **Debt Breaking Point**
// the largest the **Return on Investment** for fixing
// the issue. The **Breaking Point is the right metric
// to prioritize issues fix**.
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Types to Fix Priority</Name>
from t in JustMyCode.Types
where t.AllBreakingPoint() > TimeSpan.Zero &&
t.AllDebt().Value > 30.ToMinutes()
orderby t.AllBreakingPoint().TotalMinutes ascending
select new { t,
BreakingPoint = t.AllBreakingPoint(),
Debt = t.AllDebt(),
AnnualInterest = t.AllAnnualInterest(),
Issues = t.AllIssues(),
t.NbLinesOfCode,
// t.PercentageCoverage, to uncomment if coverage data is imported
DebtRating = t.DebtRating(),
DebtRatio = t.DebtRatio()
}
//<Description>
// This query lists types per increasing
// **Debt Breaking Point**.
//
// For each issue the *Debt* estimates the
// effort to fix the issue, and the *Annual Interest*
// estimates the annual cost to leave the issue unfixed.
// The *Severity* of an issue is estimated through
// thresholds from the *Annual Interest* of the issue.
//
// The **Debt Breaking Point** represents the duration
// from now when the estimated cost to leave the issue unfixed
// costs as much as the estimated effort to fix it.
//
// Hence the shorter the **Debt Breaking Point**
// the largest the **Return on Investment** for fixing
// the issues.
//
// Often new and refactored types since baseline will be
// listed first, because issues on these types get a
// higher *Annual Interest* because it is important to
// focus first on new issues.
//
//
// --
//
// Both issues on the type and its members are
// taken account.
//
// Only types with at least 30 minutes of Debt are listed
// to avoid parasiting the list with the numerous
// types with small *Debt*, on which the *Breaking Point*
// value makes less sense.
//
// The *Annual Interest* estimates the cost per year
// in man-days to leave these issues unfixed.
//
// Since untested code often generates a lot of
// Debt, the type size and percentage coverage is shown
// (just uncomment *t.PercentageCoverage* in the query
// source code once you've imported the coverage data).
//
// The *Debt Rating* and *Debt Ratio* are also shown
// for informational purpose.
//</Description>]]></Query>
<Query Active="True" DisplayList="True" DisplayStat="True" DisplaySelectionView="False" IsCriticalRule="False"><![CDATA[// <Name>Issues to Fix Priority</Name>
from i in Issues
// Don't show first issues with BreakingPoint equals to zero.
orderby i.BreakingPoint != TimeSpan.Zero ? i.BreakingPoint : TimeSpan.MaxValue
select new { i,
Debt = i.Debt,
AnnualInterest = i.AnnualInterest,
BreakingPoint = i.BreakingPoint,
CodeElement = i.CodeElement
}
//<Description>
// This query lists issues per increasing
// **Debt Breaking Point**.
//
// Double-click an issue to edit its rule and
// select the issue in the rule result. This way
// you can view all information concerning the issue.
//
// For each issue the *Debt* estimates the
// effort to fix the issue, and the *Annual Interest*
// estimates the annual cost to leave the issue unfixed.
// The *Severity* of an issue is estimated through
// thresholds from the *Annual Interest* of the issue.
//
// The **Debt Breaking Point** represents the duration
// from now when the estimated cost to leave the issue unfixed