It is recommended to use the NDepend interactive UI capabilities
to make the most of NDepend by mastering all aspects of your code.
Diagrams
Application Metrics
Note: Further Application Statistics are available.
|
Quality Gates summary
902
can be stopped upon quality gate
failure. Online documentation.

be run on the baseline. Hence they
have blank trend and baseline value.
Name | Trend | Baseline Value | Value | Group | |||
---|---|---|---|---|---|---|---|
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | Project Rules \ Quality Gates | |||||
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | Project Rules \ Quality Gates | |||||
| ![]() | ![]() | ![]() | Project Rules \ Quality Gates | |||
| ![]() | Project Rules \ Quality Gates |
Rules summary
152111- Number of Rules or Queries with Error (syntax error, exception thrown, time-out): 0
- Number of Rules violated: 12

development-time, from within Visual
Studio. Online documentation.

run on the baseline. Hence they
have blank # Issues Fixed or Added.
Application Statistics
Stat | # Occurences | Avg | StdDev | Max |
---|---|---|---|---|
Properties on interfaces | 2 interfaces | 4 | 1 | 5 properties on Packt.CloudySkiesAir.Chapter12.Flight.Scheduling.IFlightInfo |
Methods on interfaces | 2 interfaces | 5 | 1 | 6 methods on Packt.CloudySkiesAir.Chapter12.Flight.Scheduling.IFlightInfo |
Arguments on methods on interfaces | 10 methods | 0.1 | 0.3 | 1 arguments on Packt.CloudySkiesAir.Chapter12.Flight.Scheduling.IFlightInfo.set_Status(FlightStatus) |
Public properties on classes | 24 Classes | 1.71 | 2.17 | 8 public properties on Packt.CloudySkiesAir.Chapter12.Flight.Scheduling.Search.FlightSearch |
Public methods on classes | 24 classes | 5.83 | 4.5 | 17 public methods on Packt.CloudySkiesAir.Chapter12.Flight.Scheduling.Search.FlightSearch |
Arguments on public methods on classes | 140 methods | 0.55 | 0.66 | 4 arguments on Packt.CloudySkiesAir.Chapter12.Flight.Baggage.BaggageCalculator.CalculatePrice(Int32,Int32,Int32,Boolean) |
IL instructions in non-abstract methods | 152 methods | 13.47 | 28.08 | 274 IL instructions in Packt.CloudySkiesAir.Chapter12.Flight.Scheduling.FlightScheduler.Search(FlightSearch) |
Cyclomatic complexity on non abstract Methods | 152 Methods | 1.8 | 3.05 | CC = 30 for Packt.CloudySkiesAir.Chapter12.Flight.Scheduling.FlightScheduler.Search(FlightSearch) |
Assemblies Metrics
Clicking column header arrows sorts values.
Clicking column header title text redirect to the online Code Metric definition.
Assemblies | # lines of code | # IL instruction | # Types | # Abstract Types | # lines of comment | % Comment | % Coverage | Afferent Coupling | Efferent Coupling | Relational Cohesion | Instability | Abstractness | Distance |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Chapter12 v1.0.0.0 | 246 | 2047 | 28 | 4 | 0 | 0 | - | 0 | 46 | 2.71 | 1 | 0.14 | 0.1 |
If you wish to define thresholds on types' Code Metrics, consider writing some Rule.
Clicking column header arrows sorts values.
Clicking column header title text redirect to the online Code Metric definition.
Types Metrics : Code Quality
Type Name | Type Rank | # Lines Of Code | # IL Instructions | # Lines Of Comment | % Comment | Cyclomatic Complexity | IL Cyclomatic Complexity | % Coverage | Afferent Coupling | Efferent Coupling | Type Namespace |
---|---|---|---|---|---|---|---|---|---|---|---|
NullableContextAttribute | 5.68 | 0 | 7 | - | - | - | 1 | - | 21 | 6 | System.Runtime.CompilerServices |
EmbeddedAttribute | 2.25 | 0 | 4 | - | - | - | 1 | - | 3 | 3 | Microsoft.CodeAnalysis |
IFlightInfo | 2.18 | - | - | - | - | - | - | - | 10 | 6 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
NullableAttribute | 2.06 | 0 | 19 | - | - | - | 2 | - | 12 | 7 | System.Runtime.CompilerServices |
AirportEvent | 1.53 | 6 | 166 | 0 | 0 | 5 | 25 | - | 6 | 18 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
Airport | 1.08 | 13 | 70 | 0 | 0 | 11 | 14 | - | 6 | 13 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
FlightStatus | 1.06 | - | - | - | - | - | - | - | 3 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FlightFilterBase | 0.85 | 0 | 4 | - | - | - | 1 | - | 4 | 5 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
FlightInfoBase | 0.66 | 12 | 78 | 0 | 0 | 12 | 12 | - | 3 | 18 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
ICargoItem | 0.42 | - | - | 0 | 0 | 2 | - | - | 2 | 6 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
BoardingStatus | 0.25 | - | - | - | - | - | - | - | 1 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
Passenger | 0.25 | 14 | 56 | 0 | 0 | 14 | 15 | - | 1 | 12 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
FlightSearch | 0.25 | 16 | 60 | 0 | 0 | 16 | 17 | - | 1 | 10 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
DateHelpers | 0.24 | 2 | 11 | 0 | 0 | 1 | 1 | - | 1 | 7 | Packt.CloudySkiesAir.Chapter12 .Helpers |
FlightScheduler | 0.24 | 34 | 357 | 0 | 0 | 24 | 39 | - | 1 | 24 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
BoardingProcessor | 0.15 | 41 | 295 | 0 | 0 | 18 | 37 | - | 0 | 23 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
BaggageCalculator | 0.15 | 27 | 167 | 0 | 0 | 10 | 11 | - | 0 | 12 | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage |
PassengerFlightInfo | 0.15 | 5 | 44 | 0 | 0 | 5 | 6 | - | 0 | 10 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FreightFlightInfo | 0.15 | 5 | 45 | 0 | 0 | 5 | 6 | - | 0 | 13 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
Flight | 0.15 | 1 | 14 | 0 | 0 | 1 | 2 | - | 0 | 4 | Packt.CloudySkiesAir.Chapter12 .Flight |
FlightTracker | 0.15 | 26 | 269 | 0 | 0 | 13 | 21 | - | 0 | 25 | Packt.CloudySkiesAir.Chapter12 .Flight |
RefSafetyRulesAttribute | 0.15 | 0 | 7 | - | - | - | 1 | - | 0 | 6 | System.Runtime.CompilerServices |
Program | 0.15 | 1 | 9 | 0 | 0 | 1 | 2 | - | 0 | 6 | Packt.CloudySkiesAir.Chapter12 |
AirportFilter | 0.15 | 7 | 43 | 0 | 0 | 6 | 8 | - | 0 | 14 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
CargoItem | 0.15 | 6 | 47 | 0 | 0 | 6 | 7 | - | 0 | 14 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
CharterFlightInfo | 0.15 | 11 | 78 | 0 | 0 | 5 | 7 | - | 0 | 21 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FlightDurationFilter | 0.15 | 9 | 84 | 0 | 0 | 9 | 17 | - | 0 | 10 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
FlightTimeFilter | 0.15 | 8 | 86 | 0 | 0 | 11 | 19 | - | 0 | 11 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
Types Metrics : Code Members and Inheritance
Type Name | # Instance Methods | Nb Static Methods | Nb Properties | # Fields | # Children Classes | Depth Of Inheritance Tree | Type Namespace |
---|---|---|---|---|---|---|---|
NullableContextAttribute | 1 | 0 | 0 | 1 | 0 | 2 | System.Runtime.CompilerServices |
EmbeddedAttribute | 1 | 0 | 0 | 0 | 0 | 2 | Microsoft.CodeAnalysis |
IFlightInfo | 6 | 0 | 5 | 0 | - | - | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
NullableAttribute | 2 | 0 | 0 | 1 | 0 | 2 | System.Runtime.CompilerServices |
AirportEvent | 14 | 2 | 3 | 2 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
Airport | 10 | 0 | 3 | 3 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
FlightStatus | - | - | - | - | - | - | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FlightFilterBase | 2 | 0 | 0 | 0 | 3 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
FlightInfoBase | 12 | 0 | 5 | 4 | 3 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
ICargoItem | 4 | 0 | 3 | 0 | - | - | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
BoardingStatus | - | - | - | - | - | - | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
Passenger | 15 | 0 | 7 | 6 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
FlightSearch | 17 | 0 | 8 | 8 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
DateHelpers | 0 | 1 | 0 | 0 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Helpers |
FlightScheduler | 6 | 0 | 0 | 1 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
BoardingProcessor | 8 | 0 | 2 | 3 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
BaggageCalculator | 4 | 2 | 1 | 4 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage |
PassengerFlightInfo | 6 | 0 | 1 | 1 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FreightFlightInfo | 6 | 0 | 2 | 2 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
Flight | 2 | 0 | 0 | 0 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight |
FlightTracker | 7 | 0 | 0 | 1 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight |
RefSafetyRulesAttribute | 1 | 0 | 0 | 1 | 0 | 2 | System.Runtime.CompilerServices |
Program | 1 | 1 | 0 | 0 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 |
AirportFilter | 6 | 0 | 2 | 2 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
CargoItem | 7 | 0 | 2 | 2 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
CharterFlightInfo | 3 | 0 | 1 | 1 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FlightDurationFilter | 6 | 0 | 2 | 2 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
FlightTimeFilter | 8 | 0 | 3 | 3 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
Types Metrics : Lack Of Cohesion Of Methods and Association Between Classes
Type Name | Lack Of Cohesion Of Methods | Lack Of Cohesion Of Methods HS | Association Between Classes | Type Namespace |
---|---|---|---|---|
NullableContextAttribute | 0 | 0 | 1 | System.Runtime.CompilerServices |
EmbeddedAttribute | 0 | 0 | 1 | Microsoft.CodeAnalysis |
IFlightInfo | - | - | 0 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
NullableAttribute | 0 | 0 | 1 | System.Runtime.CompilerServices |
AirportEvent | 0 | 0 | 12 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
Airport | 0 | 0 | 3 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
FlightStatus | - | - | 0 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FlightFilterBase | 0 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
FlightInfoBase | 0 | 0 | 10 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
ICargoItem | - | - | 6 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
BoardingStatus | - | - | 0 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
Passenger | 0 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
FlightSearch | 0 | 0 | 1 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
DateHelpers | 0 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Helpers |
FlightScheduler | 0 | 0 | 34 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
BoardingProcessor | 0.25 | 0.33 | 26 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
BaggageCalculator | 0 | 0 | 13 | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage |
PassengerFlightInfo | 0 | 0 | 7 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FreightFlightInfo | 0 | 0 | 3 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
Flight | 0 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 .Flight |
FlightTracker | 0.57 | 0.67 | 31 | Packt.CloudySkiesAir.Chapter12 .Flight |
RefSafetyRulesAttribute | 0 | 0 | 1 | System.Runtime.CompilerServices |
Program | 0 | 0 | 2 | Packt.CloudySkiesAir.Chapter12 |
AirportFilter | 0 | 0 | 4 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
CargoItem | 0 | 0 | 9 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
CharterFlightInfo | 0 | 0 | 16 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights |
FlightDurationFilter | 0 | 0 | 6 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
FlightTimeFilter | 0 | 0 | 8 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search |
Namespaces Metrics
Clicking column header arrows sorts values.
Clicking column header title text redirect to the online Code Metric definition.
Namespaces | # lines of code | # IL instruction | # Types | # lines of comment | % Comment | % Coverage | Afferent Coupling | Efferent Coupling |
---|---|---|---|---|---|---|---|---|
Microsoft.CodeAnalysis | 0 | 4 | 1 | - | - | - | 1 | 2 |
Chapter12.dll::System.Runtime .CompilerServices | 0 | 33 | 3 | - | - | - | 7 | 3 |
Packt.CloudySkiesAir.Chapter12 | 1 | 9 | 1 | 0 | 0 | - | 0 | 3 |
Packt.CloudySkiesAir.Chapter12 .Helpers | 2 | 11 | 1 | 0 | 0 | - | 1 | 4 |
Packt.CloudySkiesAir.Chapter12 .Flight | 27 | 283 | 2 | 0 | 0 | - | 0 | 10 |
Packt.CloudySkiesAir.Chapter12 .Flight.Boarding | 55 | 351 | 3 | 0 | 0 | - | 0 | 8 |
Packt.CloudySkiesAir.Chapter12 .Flight.Baggage | 27 | 167 | 1 | 0 | 0 | - | 0 | 4 |
Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling | 53 | 593 | 4 | 0 | 0 | - | 3 | 12 |
Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search | 40 | 277 | 5 | 0 | 0 | - | 1 | 5 |
Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights | 41 | 319 | 7 | 0 | 0 | - | 2 | 9 |
Quality Gates 902 |
|
![]() | Quality Gate Pass: Percentage Coverage |
Scalar Result: N/A %
![]() | Quality Gate Pass: Percentage Coverage on New Code |
Scalar Result: N/A %
![]() | Quality Gate Pass: Percentage Coverage on Refactored Code |
Scalar Result: N/A %
![]() | Quality Gate Pass: Blocker Issues |
No issue matched
![]() | Quality Gate Pass: Critical Issues |
No issue matched
![]() | Quality Gate Pass: New Blocker / Critical / High Issues |
No issue matched
![]() | Quality Gate Fail: Critical Rules Violated |
1 rule matched
1 rule | issues | Full Name |
---|---|---|
Avoid namespaces mutually dependent | 4 issues
| Rule |
![]() | Quality Gate Pass: Percentage Debt |
Scalar Result: 7.92 %
![]() | Quality Gate Pass: New Debt since Baseline |
Scalar Result: 0 man-days
![]() | Quality Gate Fail: Debt Rating per Namespace |
1 namespace matched
1 namespace | debtRating | debtRatio | devTimeInManDay | debtInManDay | issues | Full Name |
---|---|---|---|---|---|---|
![]() | D | 27.41 | 2d 0h | 4h 27min | First 5 of 10 issues
| Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
![]() | Quality Gate Pass: New Annual Interest since Baseline |
Scalar Result: 0 man-days
Hot Spots 000 |
Code Smells 000 |
Code Smells Regression 000 |
Object Oriented Design 000 |
Design 000 |
Architecture 000 |
API Breaking Changes 000 |
Code Coverage 000 |
Dead Code 000 |
Security 000 |
Visibility 000 |
Immutability 000 |
Naming Conventions 000 |
Source Files Organization 000 |
.NET Framework Usage 000 |
API Usage 000 |
Defining JustMyCode 000 |
Trend Metrics 000 |
Code Diff Summary 000 |
Rules extracted from Source Code 000 |
Code Smells 710 |
|
![]() | Rule Violated: Avoid methods potentially poorly commented |
• How to Fix Issues of this Rule: Typically add more comment. But code commenting is subject to controversy. While poorly written and designed code would needs a lot of comment to be understood, clean code doesn't need that much comment, especially if variables and methods are properly named and convey enough information. Unit-Test code can also play the role of code commenting. However, even when writing clean and well-tested code, one will have to write hacks at a point, usually to circumvent some API limitations or bugs. A hack is a non-trivial piece of code, that doesn't make sense at first glance, and that took time and web research to be found. In such situation comments must absolutely be used to express the intention, the need for the hacks and the source where the solution has been found. The estimated Debt, which means the effort to comment such method, varies linearly from 2 minutes for 10 lines of code not commented, up to 20 minutes for 200 or more, lines of code not commented.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1006:AvoidMethodsPotentiallyPoorlyCommented", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 method matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 method | Percentage Comment | # lines of code (LOC) | # lines of comment | nbLinesOfCodeNotCommented | Debt | Annual Interest | Full Name |
---|---|---|---|---|---|---|---|
![]() | 0 | 26 | 0 | 26 | 2min 36s | 16min | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler .Search(FlightSearch) |
Object Oriented Design 1130 |
![]() | Rule Violated: A stateless class or structure might be turned into a static type |
• How to Fix Issues of this Rule: Declare all methods as static and transform the class or structure into a static class. By default issues of this rule have a Low severity because they reflect more an advice than a problem.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1206:AStatelessClassOrStructureMightBeTurnedIntoAStaticType", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 type matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 type | methodsUsingMe | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | no method | 1min 0s | Low | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
![]() | Rule Violated: Non-static classes should be instantiated or turned to static |
• How to Fix Issues of this Rule: First it is important to investigate why the class is never instantiated. If the reason is the class hosts only static methods then the class can be safely declared as static. Others reasons like, the class is meant to be instantiated via reflection, or is meant to be instantiated only by client code should lead to adapt this rule code to avoid these matches.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1207:NonStaticClassesShouldBeInstantiatedOrTurnedToStatic", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
11 types matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
11 types | Visibility | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.FlightTracker |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingProcessor |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.Passenger |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage.BaggageCalculator |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Airport |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .AirportFilter |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightDurationFilter |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightSearch |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightTimeFilter |
![]() | Rule Violated: Methods should be declared static if possible |
• How to Fix Issues of this Rule: Declare matched methods as static. Since such method doesn't use any instance fields and methods of its type and base-types, you should consider if it makes sense, to move such a method to a static utility class.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1208:MethodsShouldBeDeclaredStaticIfPossible", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 method matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 method | staticFieldsUsed | methodsCallingMe | Debt | Severity | Full Name |
---|---|---|---|---|---|
![]() | no field | no method | 0min 30s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Flight.BuildMessage(String ,String) |
Design 1020 |
|
![]() | Rule Violated: Avoid namespaces with few types |
• How to Fix Issues of this Rule: To fix a violation of this rule, try to combine namespaces that contain just a few types into a single namespace.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1305:AvoidNamespacesWithFewTypes", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
5 namespaces matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
5 namespaces | types | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | 1 type | 5min | Low | Packt.CloudySkiesAir.Chapter12 |
![]() | 1 type | 5min | Low | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage |
![]() | 2 types | 5min | Low | Packt.CloudySkiesAir.Chapter12 .Flight |
![]() | 3 types
| 5min | Low | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
![]() | 4 types
| 5min | Low | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
![]() | Rule Violated: Don't use obsolete types, methods or fields |
• How to Fix Issues of this Rule: Typically when a code element is tagged with System.ObsoleteAttribute, a workaround message is provided to clients. This workaround message will tell you what to do to avoid using the obsolete code element. The estimated Debt, which means the effort to fix such issue, is 5 minutes per type, method or field used. Issues of this rule have a severity High because it is important to not rely anymore on obsolete code.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1311:DontUseObsoleteTypesMethodsOrFields", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 method matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 method | obsoleteUsage | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | 1 method | 5min | High | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights .CharterFlightInfo..ctor() |
Architecture 611 |
|
![]() | Critical Rule Violated: Avoid namespaces mutually dependent |
• How to Fix Issues of this Rule: Refactor the code to make sure that the low-level namespace doesn't use the high-level namespace. The rule lists in detail which low-level types and methods shouldn't use which high-level types and methods. The refactoring patterns that help getting rid of each listed dependency include: • Moving one or several types from the low-level namespaces to the high-level one, or do the opposite. • Use Inversion of Control (IoC): http://en.wikipedia.org/wiki/Inversion_of_control This consists in creating new interfaces in the low-level namespace, implemented by classes in the high-level namespace. This way low-level code can consume high-level code through interfaces, without using directly high-level implementations. Interfaces can be passed to low-level code through the high-level namespace code, or through even higher-level code. In related documentations you can see these interfaces named as callbacks, and the overall pattern is also known as Dependency Injection (DI): http://en.wikipedia.org/wiki/Dependency_injection That rule might not be applicable for frameworks that present public namespaces mutually dependent. In such situation the cost to break the API can be higher than the cost to let the code entangled. - The estimated Debt, which means the effort to fix such issue to make sure that the first namespace doesn't rely anymore on the second one, depends on the number of types and methods used. Because both namespace are now forming a super-component that cannot be partitioned in smaller components, the cost to unfix each issue is proportional to the size of this super-component. As a consequence, the estimated Annual Interest, which means the annual cost to let both namespaces mutually dependend, is equal to an hour plus a number of minutes proportional to the size (in lines of code) of both namespaces. The obtained Annual Interest value is then divided by the number of detailled issues listed. Often the estimated Annual Interest for each listed issue is higher than the Debt, which means that leaving such issue unfixed for a year costs more than taking the time to fix issue once. -- To explore the coupling between the two namespaces mutually dependent: 1) from the becauseNamespace right-click menu choose Copy to Matrix Columns to export this low-level namespace to the horizontal header of the dependency matrix. 2) from the shouldntUseNamespace right-click menu choose Copy to Matrix Rows to export this high-level namespace to the vertical header of the dependency matrix. 3) double-click the black matrix cell (it is black because of the mutual dependency). 4) in the matrix command bar, click the button: Remove empty Row(s) and Column(s). At this point, the dependency matrix shows types involved into the coupling. • Blue cells represent types from low-level namespace using types from high-level namespace • Green cells represent types from high-level namespace using types from low-level namespace • Black cells represent types from low-level and high-level namespaces that use each other. There are more green cells than blue and black cells because green cell represents correct coupling from high-level to low-level. The goal is to eliminate incorrect dependencies represented by blue and black cells.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1400:AvoidNamespacesMutuallyDependent", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
4 members matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
4 types and methods | shouldntUse | becauseNamespace | shouldntUseNamespace | Debt | Annual Interest | Full Name |
---|---|---|---|---|---|---|
![]() | 2 types
| ![]() | ![]() | 20min | 20min | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler |
![]() | First 5 of 8 methods 8 properties
| ![]() | ![]() | 1h 0min | 20min | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler .Search(FlightSearch) |
![]() | 1 method
| ![]() | ![]() | 15min | 20min | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler .Search(List<FlightFilterBase>) |
![]() | 1 type
| ![]() | ![]() | 15min | 1h 1min | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.IFlightInfo |
![]() | Rule Violated: Avoid namespaces dependency cycles |
• How to Fix Issues of this Rule: Removing first pairs of mutually dependent namespaces will eliminate most namespaces dependency cycles. This is why it is recommended to focus first on matches of the default rule Avoid namespaces mutually dependent before attempting to fix issues of the present rule. Once all mutually dependent namespaces occurrences are solved, remaining cycles matched by the present rule necessarily involve 3 or more namespaces like in: A is using B is using C is using A. To browse a cycle on the dependency graph or the dependency matrix, right click a cycle cell in the result of the present rule and export the matched namespaces to the dependency graph or matrix. This is illustrated here: https://www.ndepend.com/docs/visual-studio-dependency-graph#Entangled With such a cycle graph visualized, you can determine which dependencies should be discarded to break the cycle. To do so, you need to identify which namespace should be at low-level and which one should be at high-level. In the A is using B is using C is using A cycle example, if A should be at low level then C should be at a higher-level than A. As a consequence C shouldn't use A and this dependency should be removed. To remove a dependency you can refer to patterns described in the HowToFix section of the rule Avoid namespaces mutually dependent. Notice that the dependency matrix can also help visualizing and breaking cycles. In the matrix cycles are represented with red squares and black cells. To easily browse dependency cycles, the dependency matrix comes with an option: Display Direct and Indirect Dependencies. See related documentation here: https://www.ndepend.com/docs/dependency-structure-matrix-dsm#Cycle https://www.ndepend.com/docs/dependency-structure-matrix-dsm#Mutual The estimated Debt, which means the effort to fix such issue, doesn't depend on the cycle length. First because fixing the rule Avoid namespaces mutually dependent will fix most cycle reported here, second because even a long cycle can be broken by removing a single or a few dependencies.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1401:AvoidNamespacesDependencyCycles", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 namespace matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 namespace | cycle | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | 3 namespaces | 2h 0min | High | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
Immutability 1120 |
![]() | Rule Violated: Fields should be marked as ReadOnly when possible |
• How to Fix Issues of this Rule: Declare the field with the C# readonly keyword (ReadOnly in VB.NET). This way the intention that the field value shouldn't change is made explicit.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1900:FieldsShouldBeMarkedAsReadOnlyWhenPossible", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 field matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 field | MethodsReadingMeButNotAssigningMe | MethodsAssigningMe | Debt | Severity | Full Name |
---|---|---|---|---|---|
![]() | 3 methods | no method | 5min | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingProcessor ._priorityLaneGroups |
![]() | Rule Violated: Record classes should be immutable |
• How to Fix Issues of this Rule: To fix an issue of this rule you must make sure that the matched record becomes immutable. To do so mutable property setters (culpritSetters in the result) of the setter must be transformed in property initializers with the init C# keyword. Callers of the mutable property setters (methodsCallingCulpritSetters in the result) must be also refactored to avoid changing the record states. The estimated Debt, which means the effort to fix such issue, is equal to 8 minutes plus 3 minutes per mutable property setter and per method calling such mutable property setter.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1913:RecordClassesShouldBeImmutable", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 type matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 type | culpritSetters | methodsCallingCulpritSetters | Debt | Severity | Full Name |
---|---|---|---|---|---|
![]() | 1 method | 3 methods | 26min | High | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.AirportEvent |
Naming Conventions 1920 |
![]() | Rule Violated: Avoid prefixing type name with parent namespace name |
• How to Fix Issues of this Rule: To fix a violation of this rule, remove the prefix from the type name.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND2013:AvoidPrefixingTypeNameWithParentNamespaceName", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
5 types matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
5 types | namespaceName | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | Flight | 10min | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
![]() | Flight | 10min | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.FlightTracker |
![]() | Boarding | 10min | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingProcessor |
![]() | Boarding | 10min | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingStatus |
![]() | Baggage | 10min | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage.BaggageCalculator |
![]() | Rule Violated: Avoid naming types and namespaces with the same identifier |
• How to Fix Issues of this Rule: To fix a violation of this rule, renamed the concerned type or namespace.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND2014:AvoidNamingTypesAndNamespacesWithTheSameIdentifier", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 type matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 type | namespaces | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | 1 namespace | 12min | High | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
Hot Spots
![]() | Code Query: Types Hot Spots |
15 types matched
15 types | Debt | Issues | Annual Interest | Breaking Point | # lines of code (LOC) | DebtRating | DebtRatio | Full Name |
---|---|---|---|---|---|---|---|---|
![]() | 1h 39min | 5 issues
| 1h 19min | 1y 91d | 34 | D | 27.45 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler |
![]() | 26min | 1 issue
| 20min | 1y 109d | 6 | C | 10.75 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.AirportEvent |
![]() | 25min | 5 issues
| 26min | 357d | 1 | E | 73.78 | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
![]() | 17min | 3 issues
| 6min | 2y 304d | 41 | A | 3.58 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingProcessor |
![]() | 15min | 1 issue
| 1h 1min | 88d | N/A | C | 14.47 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.IFlightInfo |
![]() | 12min | 2 issues
| 4min 0s | 3y | 26 | A | 3.97 | Packt.CloudySkiesAir.Chapter12 .Flight.FlightTracker |
![]() | 12min | 2 issues
| 4min 0s | 3y | 27 | A | 3.56 | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage.BaggageCalculator |
![]() | 10min | 1 issue
| 2min 0s | 5y | N/A | D | 23.15 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingStatus |
![]() | 5min | 1 issue
| 20min | 91d | 11 | A | 3.4 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights .CharterFlightInfo |
![]() | 2min 0s | 1 issue
| 2min 0s | 1y | 14 | A | 0.54 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.Passenger |
![]() | 2min 0s | 1 issue
| 2min 0s | 1y | 13 | A | 0.77 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Airport |
![]() | 2min 0s | 1 issue
| 2min 0s | 1y | 7 | A | 1.29 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .AirportFilter |
![]() | 2min 0s | 1 issue
| 2min 0s | 1y | 9 | A | 1.16 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightDurationFilter |
![]() | 2min 0s | 1 issue
| 2min 0s | 1y | 16 | A | 0.46 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightSearch |
![]() | 2min 0s | 1 issue
| 2min 0s | 1y | 8 | A | 1.01 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightTimeFilter |
![]() | Code Query: Types to Fix Priority |
1 type matched
1 type | Breaking Point | Debt | Annual Interest | Issues | # lines of code (LOC) | DebtRating | DebtRatio | Full Name |
---|---|---|---|---|---|---|---|---|
![]() | 1y 91d | 1h 39min | 1h 19min | 5 issues
| 34 | D | 27.45 | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler |
![]() | Code Query: Issues to Fix Priority |
33 issues matched
33 issues | Debt | Annual Interest | Breaking Point | CodeElement | Full Name |
---|---|---|---|---|---|
Medium issue on: ![]() | 2min 36s | 16min | 59d | ![]() | Rule violated: Avoid methods potentially poorly commented |
{I:Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.IFlightInfo} | 15min | 1h 1min | 88d | ![]() | Rule violated: Avoid namespaces mutually dependent |
Medium issue on: ![]() | 0min 30s | 2min 0s | 91d | ![]() | Rule violated: Methods should be declared static if possible |
High issue on: ![]() | 5min | 20min | 91d | ![]() | Rule violated: Don't use obsolete types, methods or fields |
High issue on: ![]() | 12min | 20min | 219d | ![]() | Rule violated: Avoid naming types and namespaces with the same identifier |
High issue on: ![]() | 15min | 20min | 266d | ![]() | Rule violated: Avoid namespaces mutually dependent |
High issue on: ![]() | 20min | 20min | 355d | ![]() | Rule violated: Avoid namespaces mutually dependent |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
Medium issue on: ![]() | 2min 0s | 2min 0s | 1y | ![]() | Rule violated: Non-static classes should be instantiated or turned to static |
High issue on: ![]() | 26min | 20min | 1y 109d | ![]() | Rule violated: Record classes should be immutable |
Medium issue on: ![]() | 5min | 2min 0s | 2y 182d | ![]() | Rule violated: Fields should be marked as ReadOnly when possible |
High issue on: ![]() | 1h 0min | 20min | 2y 337d | ![]() | Rule violated: Avoid namespaces mutually dependent |
Medium issue on: ![]() | 10min | 2min 0s | 5y | ![]() | Rule violated: Avoid prefixing type name with parent namespace name |
Medium issue on: ![]() | 10min | 2min 0s | 5y | ![]() | Rule violated: Avoid prefixing type name with parent namespace name |
Medium issue on: ![]() | 10min | 2min 0s | 5y | ![]() | Rule violated: Avoid prefixing type name with parent namespace name |
{E:Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingStatus} | 10min | 2min 0s | 5y | ![]() | Rule violated: Avoid prefixing type name with parent namespace name |
Medium issue on: ![]() | 10min | 2min 0s | 5y | ![]() | Rule violated: Avoid prefixing type name with parent namespace name |
High issue on: ![]() | 2h 0min | 20min | 6y | ![]() | Rule violated: Avoid namespaces dependency cycles |
Low issue on: ![]() | 1min 0s | 0min 0s | 00:00:00 | ![]() | Rule violated: A stateless class or structure might be turned into a static type |
Low issue on: ![]() | 5min | 0min 0s | 00:00:00 | ![]() | Rule violated: Avoid namespaces with few types |
Low issue on: ![]() | 5min | 0min 0s | 00:00:00 | ![]() | Rule violated: Avoid namespaces with few types |
Low issue on: ![]() | 5min | 0min 0s | 00:00:00 | ![]() | Rule violated: Avoid namespaces with few types |
Low issue on: ![]() | 5min | 0min 0s | 00:00:00 | ![]() | Rule violated: Avoid namespaces with few types |
Low issue on: ![]() | 5min | 0min 0s | 00:00:00 | ![]() | Rule violated: Avoid namespaces with few types |
![]() | Code Query: Debt and Issues per Rule |
12 rules matched
12 rules | Issues | Debt | Annual Interest | Breaking Point | Category | Full Name |
---|---|---|---|---|---|---|
Avoid namespaces dependency cycles | 1 issue
| 2h 0min | 20min | 6y | Project Rules \ Architecture | Rule |
Avoid namespaces mutually dependent | 4 issues
| 1h 50min | 2h 3min | 326d | Project Rules \ Architecture | Rule |
Avoid prefixing type name with parent namespace name | 5 issues
| 50min | 10min | 5y | Project Rules \ Naming Conventions | Rule |
Record classes should be immutable | 1 issue
| 26min | 20min | 1y 109d | Project Rules \ Immutability | Rule |
Avoid namespaces with few types | 5 issues
| 25min | 0min 0s | 00:00:00 | Project Rules \ Design | Rule |
Non-static classes should be instantiated or turned to static | First 5 of 11 issues
| 22min | 22min | 1y | Project Rules \ Object Oriented Design | Rule |
Avoid naming types and namespaces with the same identifier | 1 issue
| 12min | 20min | 219d | Project Rules \ Naming Conventions | Rule |
Don't use obsolete types, methods or fields | 1 issue
| 5min | 20min | 91d | Project Rules \ Design | Rule |
Fields should be marked as ReadOnly when possible | 1 issue
| 5min | 2min 0s | 2y 182d | Project Rules \ Immutability | Rule |
Avoid methods potentially poorly commented | 1 issue
| 2min 36s | 16min | 59d | Project Rules \ Code Smells | Rule |
A stateless class or structure might be turned into a static type | 1 issue
| 1min 0s | 0min 0s | 00:00:00 | Project Rules \ Object Oriented Design | Rule |
Methods should be declared static if possible | 1 issue
| 0min 30s | 2min 0s | 91d | Project Rules \ Object Oriented Design | Rule |
![]() | Code Query: New Debt and Issues per Rule |
No rule matched
![]() | Code Query: Debt and Issues per Code Element |
24 code elements matched
24 code elements | Issues | Debt | Annual Interest | Breaking Point | Full Name |
---|---|---|---|---|---|
![]() | 2 issues
| 2h 5min | 20min | 6y 91d | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling |
![]() | 2 issues
| 1h 2min | 36min | 1y 260d | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler .Search(FlightSearch) |
![]() | 1 issue
| 26min | 20min | 1y 109d | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.AirportEvent |
![]() | 4 issues
| 25min | 24min | 1y 15d | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
![]() | 2 issues
| 22min | 22min | 356d | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler |
![]() | 1 issue
| 15min | 20min | 266d | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler .Search(List<FlightFilterBase>) |
![]() | 1 issue
| 15min | 1h 1min | 88d | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.IFlightInfo |
![]() | 2 issues
| 12min | 4min 0s | 3y | Packt.CloudySkiesAir.Chapter12 .Flight.FlightTracker |
![]() | 2 issues
| 12min | 4min 0s | 3y | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingProcessor |
![]() | 2 issues
| 12min | 4min 0s | 3y | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage.BaggageCalculator |
![]() | 1 issue
| 10min | 2min 0s | 5y | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingStatus |
![]() | 1 issue
| 5min | 0min 0s | 00:00:00 | Packt.CloudySkiesAir.Chapter12 |
![]() | 1 issue
| 5min | 0min 0s | 00:00:00 | Packt.CloudySkiesAir.Chapter12 .Flight |
![]() | 1 issue
| 5min | 0min 0s | 00:00:00 | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding |
![]() | 1 issue
| 5min | 2min 0s | 2y 182d | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingProcessor ._priorityLaneGroups |
![]() | 1 issue
| 5min | 0min 0s | 00:00:00 | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage |
![]() | 1 issue
| 5min | 20min | 91d | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Flights .CharterFlightInfo..ctor() |
![]() | 1 issue
| 2min 0s | 2min 0s | 1y | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.Passenger |
![]() | 1 issue
| 2min 0s | 2min 0s | 1y | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Airport |
![]() | 1 issue
| 2min 0s | 2min 0s | 1y | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .AirportFilter |
![]() | 1 issue
| 2min 0s | 2min 0s | 1y | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightDurationFilter |
![]() | 1 issue
| 2min 0s | 2min 0s | 1y | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightSearch |
![]() | 1 issue
| 2min 0s | 2min 0s | 1y | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightTimeFilter |
![]() | 1 issue
| 0min 30s | 2min 0s | 91d | Packt.CloudySkiesAir.Chapter12 .Flight.Flight.BuildMessage(String ,String) |
![]() | Code Query: New Debt and Issues per Code Element |
No code element matched
Object Oriented Design
|
![]() | Validated Rule: Avoid interfaces too big |
• How to Fix Issues of this Rule: Typically to fix such issue, the interface must be refactored in a grape of smaller single-responsibility interfaces. A classic example is a ISession large interface, responsible for holding states, run commands and offer various accesses and facilities. The classic problem for a large public interface is that it has many clients that consume it. As a consequence splitting it in smaller interfaces has an important impact and it is not always feasible. The estimated Debt, which means the effort to fix such issue, varies linearly from 20 minutes for an interface with 10 methods, up to 7 hours for an interface with 100 or more methods. The Debt is divided by two if the interface is not publicly visible, because in such situation only the current project is impacted by the refactoring.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1200:AvoidInterfacesTooBig", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Base class should not use derivatives |
• How to Fix Issues of this Rule: Understand the need for using derivatives, then imagine a new design, and then refactor. Typically an algorithm in the base class needs to access something from derived classes. You can try to encapsulate this access behind an abstract or a virtual method. If you see in the base class some conditions on typeof(DerivedClass) not only urgent refactoring is needed. Such condition can easily be replaced through an abstract or a virtual method. Sometime you'll see a base class that creates instance of some derived classes. In such situation, certainly using the factory method pattern http://en.wikipedia.org/wiki/Factory_method_pattern or the abstract factory pattern http://en.wikipedia.org/wiki/Abstract_factory_pattern will improve the design. The estimated Debt, which means the effort to fix such issue, is equal to 3 minutes per derived class used by the base class + 3 minutes per member of a derived class used by the base class.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1201:BaseClassShouldNotUseDerivatives", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Class shouldn't be too deep in inheritance tree |
• How to Fix Issues of this Rule: In Object-Oriented Programming, a well-known motto is Favor Composition over Inheritance. This is because inheritance comes with pitfalls. In general, the implementation of a derived class is very bound up with the base class implementation. Also a base class exposes implementation details to its derived classes, that's why it's often said that inheritance breaks encapsulation. On the other hands, Composition favors binding with interfaces over binding with implementations. Hence, not only the encapsulation is preserved, but the design is clearer, because interfaces make it explicit and less coupled. Hence, to break a long inheritance chain, Composition is often a powerful way to enhance the design of the refactored underlying logic. You can also read: http://en.wikipedia.org/wiki/Composition_over_inheritance and http://stackoverflow.com/questions/49002/prefer-composition-over-inheritance The estimated Debt, which means the effort to fix such issue, depends linearly upon the depth of inheritance.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1202:ClassShouldntBeTooDeepInInheritanceTree", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Class with no descendant should be sealed if possible |
• How to Fix Issues of this Rule: For each matched class, take the time to assess if it is really meant to be subclassed. Certainly most matched class will end up being declared as sealed.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1203:ClassWithNoDescendantShouldBeSealedIfPossible", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Overrides of Method() should call base.Method() |
• How to Fix Issues of this Rule: You should investigate if inheritance is the right choice to bind the base class implementation with the derived classes implementations. Does presenting the method with polymorphic behavior through an interface, would be a better design choice? In such situation, often using the design pattern template method http://en.wikipedia.org/wiki/Template_method_pattern might help improving the design.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1204:OverridesOfMethodShouldCallBaseMethod", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: Do not hide base class methods |
• How to Fix Issues of this Rule: To fix a violation of this rule, remove or rename the method, or change the parameter signature so that the method does not hide the base method. However method hiding is for those times when you need to have two things to have the same name but different behavior. This is a very rare situations, described here: http://blogs.msdn.com/b/ericlippert/archive/2008/05/21/method-hiding-apologia.aspx
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1205:DoNotHideBaseClassMethods", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Rule Violated: A stateless class or structure might be turned into a static type |
• How to Fix Issues of this Rule: Declare all methods as static and transform the class or structure into a static class. By default issues of this rule have a Low severity because they reflect more an advice than a problem.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1206:AStatelessClassOrStructureMightBeTurnedIntoAStaticType", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 type matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 type | methodsUsingMe | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | no method | 1min 0s | Low | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
![]() | Rule Violated: Non-static classes should be instantiated or turned to static |
• How to Fix Issues of this Rule: First it is important to investigate why the class is never instantiated. If the reason is the class hosts only static methods then the class can be safely declared as static. Others reasons like, the class is meant to be instantiated via reflection, or is meant to be instantiated only by client code should lead to adapt this rule code to avoid these matches.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1207:NonStaticClassesShouldBeInstantiatedOrTurnedToStatic", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
11 types matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
11 types | Visibility | Debt | Severity | Full Name |
---|---|---|---|---|
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Flight |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.FlightTracker |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.BoardingProcessor |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Boarding.Passenger |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Baggage.BaggageCalculator |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Airport |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.FlightScheduler |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .AirportFilter |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightDurationFilter |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightSearch |
![]() | Public | 2min 0s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Scheduling.Search .FlightTimeFilter |
![]() | Rule Violated: Methods should be declared static if possible |
• How to Fix Issues of this Rule: Declare matched methods as static. Since such method doesn't use any instance fields and methods of its type and base-types, you should consider if it makes sense, to move such a method to a static utility class.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1208:MethodsShouldBeDeclaredStaticIfPossible", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
1 method matched
-
Formatting: bold means added, underlined means code was changed,
strike-boldmeans removed (since baseline)
1 method | staticFieldsUsed | methodsCallingMe | Debt | Severity | Full Name |
---|---|---|---|---|---|
![]() | no field | no method | 0min 30s | Medium | Packt.CloudySkiesAir.Chapter12 .Flight.Flight.BuildMessage(String ,String) |
![]() | Validated Rule: Constructor should not call a virtual method |
• How to Fix Issues of this Rule: Violations reported can be solved by re-designing object initialisation or by declaring the parent class as sealed, if possible.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1209:ConstructorShouldNotCallAVirtualMethod", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: Avoid the Singleton pattern |
• How to Fix Issues of this Rule: This rule matches the classic syntax of singletons, where one static field hold the single instance of the parent class. We underline that the problem is this particular syntax, that plays against testability. The problem is not the fact that a single instance of the class lives at runtime. Hence to fix matches fo this rule, creates the single instance at the startup of the program, and pass it to all classes and methods that need to access it. If multiple singletons are identified, they actually form together a program execution context. Such context can be unified in a unique singleton context. Doing so will make it easier to propagate the context across the various program units. The estimated Debt, which means the effort to fix such issue, is equal to 3 minutes per method relying on the singleton. It is not rare that hundreds of methods rely on the singleton and that it takes hours to get rid of a singleton, refactoring the way just explained above. The severity of each singleton issue is Critical because as explained, using a the singleton pattern can really prevent the whole program to be testable.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1210:AvoidTheSingletonPattern", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Don't assign static fields from instance methods |
• How to Fix Issues of this Rule: If the static field is just assigned once in the program lifetime, make sure to declare it as readonly and assign it inline, or from the static constructor. In Object-Oriented-Programming the natural artifact to hold states that can be modified is instance fields. Hence to fix violations of this rule, make sure to hold assignable states through instance fields, not through static fields.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1211:DontAssignStaticFieldsFromInstanceMethods", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No field matched
![]() | Validated Rule: Avoid empty interfaces |
• How to Fix Issues of this Rule: Remove the interface or add members to it. If the empty interface is being used to label a set of types, replace the interface with a custom attribute. The estimated Debt, which means the effort to fix such issue, is equal to 10 minutes to discard an empty interface plus 3 minutes per type implementing an empty interface.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1212:AvoidEmptyInterfaces", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Avoid types initialization cycles |
• How to Fix Issues of this Rule: Types initialization cycles create confusion and unexpected behaviors. If several states hold by several classes must be initialized during the first access of any of those classes, a better design option is to create a dedicated class whose responsibility is to initialize and hold all these states. The estimated Debt, which means the effort to fix such issue, is equal to 20 minutes per cycle plus 10 minutes per type class constructor involved in the cycle.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1213:AvoidTypesInitializationCycles", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
API Breaking Changes
![]() | Validated Rule: API Breaking Changes: Types |
• How to Fix Issues of this Rule: Make sure that public types that used to be presented to clients, still remain public now, and in the future. If a public type must really be removed, you can tag it with System.ObsoleteAttribute with a workaround message during a few public releases, until it gets removed definitely. Notice that this rule doesn't match types removed that were tagged as obsolete. Issues of this rule have a severity equal to High because an API Breaking change can provoque significant friction with consumers of the API.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1500:APIBreakingChangesTypes", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: API Breaking Changes: Methods |
• How to Fix Issues of this Rule: Make sure that public methods that used to be presented to clients, still remain public now, and in the future. If a public method must really be removed, you can tag it with System.ObsoleteAttribute with a workaround message during a few public releases, until it gets removed definitely. Notice that this rule doesn't match methods removed that were tagged as obsolete. Issues of this rule have a severity equal to High because an API Breaking change can provoque significant friction with consumers of the API.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1501:APIBreakingChangesMethods", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: API Breaking Changes: Fields |
• How to Fix Issues of this Rule: Make sure that public fields that used to be presented to clients, still remain public now, and in the future. If a public field must really be removed, you can tag it with System.ObsoleteAttribute with a workaround message during a few public releases, until it gets removed definitely. Notice that this rule doesn't match fields removed that were tagged as obsolete. Issues of this rule have a severity equal to High because an API Breaking change can provoque significant friction with consumers of the API.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1502:APIBreakingChangesFields", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No field matched
![]() | Validated Rule: API Breaking Changes: Interfaces and Abstract Classes |
• How to Fix Issues of this Rule: Make sure that the public contracts of interfaces and abstract classes that used to be presented to clients, remain stable now, and in the future. If a public contract must really be changed, you can tag abstract methods that will be removed with System.ObsoleteAttribute with a workaround message during a few public releases, until it gets removed definitely. Issues of this rule have a severity equal to High because an API Breaking change can provoque significant friction with consummers of the API. The severity is not set to Critical because an interface is not necessarily meant to be implemented by the consummer of the API.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1503:APIBreakingChangesInterfacesAndAbstractClasses", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Broken serializable types |
• How to Fix Issues of this Rule: Make sure that the serialization process of serializable types remains stable now, and in the future. Else you'll have to deal with Version Tolerant Serialization that is explained here: https://msdn.microsoft.com/en-us/library/ms229752(v=vs.110).aspx Issues of this rule have a severity equal to High because an API Breaking change can provoque significant friction with consummers of the API.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1504:BrokenSerializableTypes", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Avoid changing enumerations Flags status |
• How to Fix Issues of this Rule: Make sure the FlagsAttribute status of each enumeration remains stable now, and in the future.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1505:AvoidChangingEnumerationsFlagsStatus", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
Code Coverage
|
![]() | Validated Rule: Code should be tested |
• How to Fix Issues of this Rule: Write unit tests to test and cover the methods and their parent classes matched by this rule.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1600:CodeShouldBeTested", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: New Methods should be tested |
• How to Fix Issues of this Rule: Write unit-tests to cover the code of most methods and classes added.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1601:NewMethodsShouldBeTested", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: Methods refactored should be tested |
• How to Fix Issues of this Rule: Write unit-tests to cover the code of most methods and classes refactored.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1602:MethodsRefactoredShouldBeTested", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: Assemblies Namespaces and Types should be tested |
• How to Fix Issues of this Rule: Write unit and integration tests to cover, even partially, code elements matched by this rule. Then use issues of the rules Code should be tested, New Methods should be tested and Methods refactored should be tested to write more tests where it matters most, and eventually refactor some code to make it more testable.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1603:AssembliesNamespacesAndTypesShouldBeTested", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No code element parent matched
![]() | Validated Rule: Types almost 100% tested should be 100% tested |
• How to Fix Issues of this Rule: Write more unit-tests dedicated to cover code not covered yet. If you find some hard-to-test code, it is certainly a sign that this code is not well designed and hence, needs refactoring.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1604:TypesAlmost100PercentTestedShouldBe100PercentTested", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Namespaces almost 100% tested should be 100% tested |
• How to Fix Issues of this Rule: Write more unit-tests dedicated to cover code not covered yet in the namespace. If you find some hard-to-test code, it is certainly a sign that this code is not well designed and hence, needs refactoring.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1605:NamespacesAlmost100PercentTestedShouldBe100PercentTested", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No namespace matched
![]() | Validated Rule: Types that used to be 100% covered by tests should still be 100% covered |
• How to Fix Issues of this Rule: Write more unit-tests dedicated to cover code not covered anymore. If you find some hard-to-test code, it is certainly a sign that this code is not well designed and hence, needs refactoring. You'll find code impossible to cover by unit-tests, like calls to MessageBox.Show(). An infrastructure must be defined to be able to mock such code at test-time.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1606:TypesThatUsedToBe100PercentCoveredByTestsShouldStillBe100PercentCovered", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: Types tagged with FullCoveredAttribute should be 100% covered |
• How to Fix Issues of this Rule: Write more unit-tests dedicated to cover code of matched classes not covered yet. If you find some hard-to-test code, it is certainly a sign that this code is not well designed and hence, needs refactoring.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1607:TypesTaggedWithFullCoveredAttributeShouldBe100PercentCovered", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: Types 100% covered should be tagged with FullCoveredAttribute |
• How to Fix Issues of this Rule: Just tag types 100% covered by tests with the FullCoveredAttribute that can be found in NDepend.API.dll, or by an attribute of yours defined in your own code (in which case this rule must be adapted).
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1608:Types100PercentCoveredShouldBeTaggedWithFullCoveredAttribute", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Methods should have a low C.R.A.P score |
• How to Fix Issues of this Rule: In such situation, it is recommended to both refactor the complex method logic into several smaller and less complex methods (that might belong to some new types especially created), and also write unit-tests to full cover the refactored logic. You'll find code impossible to cover by unit-tests, like calls to MessageBox.Show(). An infrastructure must be defined to be able to mock such code at test-time.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1609:MethodsShouldHaveALowCRAPScore", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
Dead Code
![]() | Validated Rule: Potentially Dead Types |
• How to Fix Issues of this Rule: Static analysis cannot provide an exact list of dead types, because there are several ways to use a type dynamically (like through reflection). For each type matched by this query, first investigate if the type is used somehow (like through reflection). If the type is really never used, it is important to remove it to avoid maintaining useless code. If you estimate the code of the type might be used in the future, at least comment it, and provide an explanatory comment about the future intentions. If a type is used somehow, but still is matched by this rule, you can tag it with the attribute IsNotDeadCodeAttribute found in NDepend.API.dll to avoid matching the type again. You can also provide your own attribute for this need, but then you'll need to adapt this code rule. Issues of this rule have a Debt equal to 15 minutes because it only takes a short while to investigate if a type can be safely discarded. The Annual Interest of issues of this rule, the annual cost to not fix such issue, is proportional to the type #lines of code, because the bigger the type is, the more it slows down maintenance.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1700:PotentiallyDeadTypes", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No type matched
![]() | Validated Rule: Potentially Dead Methods |
• How to Fix Issues of this Rule: Static analysis cannot provide an exact list of dead methods, because there are several ways to invoke a method dynamically (like through reflection). For each method matched by this query, first investigate if the method is invoked somehow (like through reflection). If the method is really never invoked, it is important to remove it to avoid maintaining useless code. If you estimate the code of the method might be used in the future, at least comment it, and provide an explanatory comment about the future intentions. If a method is invoked somehow, but still is matched by this rule, you can tag it with the attribute IsNotDeadCodeAttribute found in NDepend.API.dll to avoid matching the method again. You can also provide your own attribute for this need, but then you'll need to adapt this code rule. Issues of this rule have a Debt equal to 10 minutes because it only takes a short while to investigate if a method can be safely discarded. On top of these 10 minutes, the depth of usage of such method adds up 3 minutes per unity because dead method only called by dead code takes a bit more time to be investigated. The Annual Interest of issues of this rule, the annual cost to not fix such issue, is proportional to the type #lines of code, because the bigger the method is, the more it slows down maintenance.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1701:PotentiallyDeadMethods", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No method matched
![]() | Validated Rule: Potentially Dead Fields |
• How to Fix Issues of this Rule: Static analysis cannot provide an exact list of dead fields, because there are several ways to assign or read a field dynamically (like through reflection). For each field matched by this query, first investigate if the field is used somehow (like through reflection). If the field is really never used, it is important to remove it to avoid maintaining a useless code element. If a field is used somehow, but still is matched by this rule, you can tag it with the attribute IsNotDeadCodeAttribute found in NDepend.API.dll to avoid matching the field again. You can also provide your own attribute for this need, but then you'll need to adapt this code rule. Issues of this rule have a Debt equal to 10 minutes because it only takes a short while to investigate if a method can be safely discarded. The Annual Interest of issues of this rule, the annual cost to not fix such issue, is set by default to 8 minutes per unused field matched.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1702:PotentiallyDeadFields", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No field matched
![]() | Validated Rule: Wrong usage of IsNotDeadCodeAttribute |
• How to Fix Issues of this Rule: Just remove IsNotDeadCodeAttribute tagging of types, methods and fields matched by this rule because this tag is not useful anymore.
• How to Suppress an Issue of this Rule: In source code, tag the concerned code element with this attribute: [SuppressMessage("NDepend", "ND1703:WrongUsageOfIsNotDeadCodeAttribute", Justification="...")] This attribute requires the compilation symbol CODE_ANALYSIS to be set on each Visual Studio project relying on it. Without CODE_ANALYSIS symbol defined, the attribute is not compiled and the issues are not suppressed.
No member matched
Code Diff Summary
» Baseline for comparison : Baseline is same code base snapshot. |
|
![]() | Code Query: New assemblies |
No assembly matched
![]() | Code Query: Assemblies removed |
No assembly matched
![]() | Code Query: Assemblies where code was changed |
No assembly matched
![]() | Code Query: New namespaces |
No namespace matched
![]() | Code Query: Namespaces removed |
No namespace matched
![]() | Code Query: Namespaces where code was changed |
No namespace matched
![]() | Code Query: New types |
No type matched
![]() | Code Query: Types removed |
No type matched
![]() | Code Query: Types where code was changed |
No type matched
![]() | Code Query: Heuristic to find types moved from one namespace or assembly to another |
No type matched
![]() | Code Query: Types directly using one or several types changed |
No type matched
![]() | Code Query: Types indirectly using one or several types changed |
No type matched
![]() | Code Query: New methods |
No method matched
![]() | Code Query: Methods removed |
No method matched
![]() | Code Query: Methods where code was changed |
No method matched
![]() | Code Query: Methods directly calling one or several methods changed |
No method matched
![]() | Code Query: Methods indirectly calling one or several methods changed |
No method matched
![]() | Code Query: New fields |
No field matched
![]() | Code Query: Fields removed |
No field matched
![]() | Code Query: Third party types that were not used and that are now used |
No type matched
![]() | Code Query: Third party types that were used and that are not used anymore |
No type matched
![]() | Code Query: Third party methods that were not used and that are now used |
No method matched
![]() | Code Query: Third party methods that were used and that are not used anymore |
No method matched
![]() | Code Query: Third party fields that were not used and that are now used |
No field matched
![]() | Code Query: Third party fields that were used and that are not used anymore |
No field matched
Trend Charts
Size
% Coverage and % Debt
Issues
Rules
Quality Gates
Debt
Assemblies Dependencies
Assembly | Depends on | Is referenced by |
---|---|---|
Chapter12 v1.0.0.0 | System.Runtime v7.0.0.0 ; System.Console v7.0.0.0 ; System.Linq v7.0.0.0 ; System.Collections v7.0.0.0 ; | - |
Assemblies Build Order
- Chapter12
Assemblies Build Order
- Chapter12
Analysis Log : Information and Warnings
The Warnings can reveal potential flaws concerning the health of the build process.
A particular warn can be disabled through the NDepend interactive UI, panel Error List, tick the checkbox Disabled corresponding to the warn to disable.
Message | |
---|---|
![]() | Begin full analysis with NDepend v2023.1.1 |
![]() | Visual Studio solution file resolved to absolute file path: from {.\Chapter12FinalCode.sln} to {C:\Dev\repos\RefactoringWithCSharp\Chapter12\Ch12FinalCode\Chapter12FinalCode.sln} |
![]() | Output directory resolved to absolute directory path: C:\Dev\repos\RefactoringWithCSharp\Chapter12\Ch12FinalCode\NDependOut |
![]() | .NET Assembly resolved from the Visual Studio solution file {C:\Dev\repos\RefactoringWithCSharp\Chapter12\Ch12FinalCode\Chapter12FinalCode.sln} C:\Dev\repos\RefactoringWithCSharp\Chapter12\Ch12FinalCode\Chapter12\bin\Debug\net7.0\Chapter12.dll |
![]() | .NET Assembly filtered out from the Visual Studio solution file {C:\Dev\repos\RefactoringWithCSharp\Chapter12\Ch12FinalCode\Chapter12FinalCode.sln} Chapter12UnitTests |
![]() | Concurrent mode |
![]() | .NET Assemblies loaded from {C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.10} System.Linq.dll v7.0.0.0 System.Console.dll v7.0.0.0 System.Collections.dll v7.0.0.0 System.Runtime.dll v7.0.0.0 |
![]() | 20 source files parsed ; all source files found ; all source files in-sync with PDB |
![]() | 0 code rule has been extracted from code. |
![]() | No dependency cycle detected in assemblies referencement graph. |
![]() | Do merge code generated by compiler into application code. |
![]() | No SuppressMessageAttribute found in the analyzed code base. Since NDepend v2018.2 SuppressMessageAttribute can be used to suppress NDepend issues. Don't forget to set in your projects the compilation symbol CODE_ANALYSIS to use this attribute to suppress NDepend issues. |
![]() | Analyse dependencies of your application. |
![]() | Persisting code model snapshot in {C:\Dev\repos\RefactoringWithCSharp\Chapter12\Ch12FinalCode\NDependOut\NDependAnalysisResult_Chapter12FinalCode_2023Aug28_22h19m48.ndar} |
![]() | Log trend metrics values. |
![]() | Execute queries and rules. |
![]() | 2 quality gates fail: - 'Critical Rules Violated' value 1 rules greater than fail threshold 0 rules - 'Debt Rating per Namespace' value 1 namespaces greater than fail threshold 0 namespaces |
![]() | Building the report (standard). |
![]() | NDepend analysis done. Duration: 01:14.481 |
Abstractness versus Instability Diagram
The Abstractness versus Instability Diagram helps to detect which assemblies are potentially painful to maintain (i.e concrete and stable) and which assemblies are potentially useless (i.e abstract and instable).
- Abstractness:
If an assembly contains many abstract types (i.e interfaces and abstract classes) and few concrete types, it is considered as abstract.
- Instability: An assembly is considered stable if its types are used by a lot of types from other assemblies. In this context stable means painful to modify.
Online documentation: