Analytical Architecture Report Application: Pegasus ERP Cargo Management System is one of the software solutions for cargo industry, which is totally integrated with Accounts. Designed by experts from cargo and software industry it provides one stop solution for data entry and decision support. The implementation of detailed function level checks ensures reliability & date integrity of system. The embedded security through appropriate Access Controls allows complete control of user access and data manipulation. www.comsoftusa.us www.comsoftuae.com Development Environment: [Release-7, Web Version] Microsoft Visual Studio 2010, .Net 4.0, Silverlight 4.0, Infragistic GUI Controls, SQL Server 2008 Application Metrics Number of IL instructions: 737591 Number of lines of code: 102123 Number of lines of comment: 45003 Percentage comment: 30 Number of assemblies: 3 Number of classes: 1824 Number of types: 1846 Number of abstract classes: 3 Number of interfaces: 8 Number of value types: 2 Number of exception classes: 2 Number of attribute classes: 1 Number of delegate classes: 0 Number of enumerations classes: 12 Number of generic type definitions: 3 Number of generic method definitions: 2 Percentage of public types: 88.68% Percentage of public methods: 86.72% Percentage of classes with at least one public field: 5.2% Stat # Occurren ces Avg StdDev Max Properties on Interfaces 8 Interfac es 0 0 0 properties on PCMS_SL.SRBusinessManager.IBusinessManager
70
Embed
To study pcms pegasus erp cargo management system-release-7 from architecture perspective.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Analytical Architecture ReportApplication:Pegasus ERP Cargo Management System is one of the software solutions for cargo industry, which is totally integrated with Accounts. Designed by experts from cargo and software industry it provides one stop solution for data entry and decision support. The implementation of detailed function level checks ensures reliability & date integrity of system. The embedded security through appropriate Access Controls allows complete control of user access and data manipulation.
www.comsoftusa.us
www.comsoftuae.com
Development Environment: [Release-7, Web Version]Microsoft Visual Studio 2010, .Net 4.0, Silverlight 4.0, Infragistic GUI Controls, SQL Server 2008
Application MetricsNumber of IL instructions: 737591Number of lines of code: 102123Number of lines of comment: 45003Percentage comment: 30Number of assemblies: 3Number of classes: 1824Number of types: 1846Number of abstract classes: 3Number of interfaces: 8Number of value types: 2Number of exception classes: 2Number of attribute classes: 1Number of delegate classes: 0Number of enumerations classes: 12Number of generic type definitions: 3Number of generic method definitions: 2Percentage of public types: 88.68% Percentage of public methods: 86.72% Percentage of classes with at least one public field: 5.2%
Stat# Occurrences
AvgStdDev Max
Properties on Interfaces
8 Interface
s 0 0
0 properties on PCMS_SL.SRBusinessManager.IBusinessManager
Methods on Interfaces
8 Interface
s
197.5 361.47
1042 methods on PCMS_SL.SRBusinessManager.IBusinessManager
Arguments on Methods on Interfaces
1580 Methods 1.53 1.31
11 arguments on PCMS_SL.SRBusinessManager.IBusinessManager.BeginDTOPostUnpostGetByFilters(Int32,Int32,Int32,DateTi
85 public properties on Pegasus.BusinessObjects.ShippingLine.SHBLMaster
Public Methods on Classes
1824 Classes
17.96 59.75
2099 public methods on PCMS_SL.SRBusinessManager.BusinessManagerClient
Arguments on Public Methods on Classes
32767 Methods
0.8 2.05
57 arguments on Pegasus.BusinessObjects.MultiFreight.MultiMBL..ctor(String,String,String,Boolean,String,String,String,String,Boolean,CargoType,RateType,Int32,Decimal,Decimal,Decimal,DateTime,DateTime,String,String,String,FreightCategory,Client,Client,Client,CurrencyRate,Decimal,String,String,Locations,String,VesselMaster,String,String,String,Decimal,Units,Boolean,String,Decimal,String,String,String,FreightType,ShippingLines,ModuleMaster,Employees,String,MultiJobCard,IList,IList,IList,Company,Boolean,Employees,DateTime,Employees,DateTim
e)
IL Instructions in non-abstract Methods
38025 Methods 19.4 48.42
1868 IL instructions in Pegasus.BusinessObjects.PRCI.PRCICosting.getAllCosting(ISession,Int32,Int32,FreightType,ModuleMaster,Int
32,Int32)
Cyclomatic complexity on non abstract Methods
38025 Methods 1.93 4.64
CC = 156 for PCMS_SL.Web.DTOBusinessObjects.DTOTMS.DTOTraTr
NDepend information and warnings11/05/2010 09:38:55 Begin full analysis with NDepend v3.2.0No Baseline for Comparison loaded.Assemblies loaded from {C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319} mscorlib.dll v4.0.0.0 System.dll v4.0.0.0 System.ServiceModel.dll v4.0.0.0 System.Net.dll v4.0.0.0 System.Core.dll v4.0.0.0 Microsoft.VisualBasic.dll v10.0.0.0 System.Runtime.Serialization.dll v4.0.0.0 System.Data.dll v4.0.0.0 System.ServiceModel.Web.dll v4.0.0.0 System.Xml.dll v4.0.0.0 System.Web.dll v4.0.0.0Assemblies loaded from {D:\ShareMe\PCMS-SLApp-New\PCMS-SL\Bin\Debug} PCMS-SL.dll v1.0.0.0 Pegasus.Controls.dll v1.0.0.0 System.Windows.Controls.Navigation.dll v2.0.5.0 System.Windows.Controls.dll v2.0.5.0 System.Windows.Controls.Data.Input.dll v2.0.5.0 Infragistics.Silverlight.XamWebComboEditor.v10.1.dll v10.1.20101.2081 Infragistics.Silverlight.XamWebGrid.v10.1.dll v10.1.20101.2081 Infragistics.Silverlight.XamWebRibbon.v10.1.dll v10.1.20101.2081 Infragistics.Silverlight.XamWebDialogWindow.v10.1.dll v10.1.20101.2081 Infragistics.Silverlight.XamWebTree.v10.1.dll v10.1.20101.2081 Infragistics.Silverlight.XamWebEditors.v10.1.dll v10.1.20101.2081 Infragistics.Silverlight.v10.1.dll v10.1.20101.2081Assemblies loaded from {D:\ShareMe\PCMS-SLApp-New\PCMS-SL.Web\bin} PCMS-SL.Web.dll v1.0.0.0 NHibernate.dll v2.1.0.4000800 source files parsed ; all source files found ; all source files in-sync with PDB0 CQL constraint has been extracted from code.No dependency cycle detected in assemblies referencement graph.11/05/2010 09:39:06 Analyse dependencies of your application.11/05/2010 09:39:07 Building the report (standard).WARNING: Cant' load the assembly {System.Windows}: Can't find the .NET assembly {System.Windows} in specified folders. Has it been compiled properly? Is the NDepend project missing the containing folder of the .NET assembly?WARNING: Cant' load the assembly {System.Windows.Browser}: Can't find the .NET assembly {System.Windows.Browser} in specified folders. Has it been compiled properly? Is the NDepend project missing the containing folder of the .NET assembly?WARNING: Assembly {System.Net} doesn't contain any type.WARNING: No application or third party assembly found in directory {C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF}WARNING: Assembly {System.Windows} is referenced by {PCMS-SL} but is not found.WARNING: Assembly {System.Windows.Browser} is referenced by {PCMS-SL} but is not found.WARNING: Assembly {System.Windows} is referenced by {Pegasus.Controls} but is not found.
CQL Queries and Constraints{Code Quality} Some CQL constraints are not satisfied. {Code Quality \ Type Metrics} Some CQL constraints are not satisfied. {Code Quality from Now!} All CQL queries compile and all CQL contraints are satisfied. {Design} Some CQL constraints are not satisfied. {Design \ Performance} Some CQL constraints are not satisfied. {Unused Code / Dead Code} Some CQL constraints are not satisfied. {Encapsulation} Some CQL constraints are not satisfied. {Encapsulation \ Methods Optimal Encapsulation} Some CQL constraints are not satisfied. {Encapsulation \ Types Optimal Encapsulation} Some CQL constraints are not satisfied. {Encapsulation \ Fields Optimal Encapsulation} Some CQL constraints are not satisfied. {Diff / Changes / Evolution} All CQL queries compile and all CQL contraints are satisfied. {Diff / Changes / Evolution \ API Breaking Changes} All CQL queries compile and all CQL contraints are satisfied. {Test Coverage} Some CQL constraints are not satisfied. {Purity / Immutability / Side-Effects} Some CQL constraints are not satisfied. {Naming Conventions} Some CQL constraints are not satisfied. {Naming Conventions \ Name too long} Some CQL constraints are not satisfied. {Constraints extracted from Source Code} No active CQL query compiled.
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Quick summary of methods to refactor</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS /*OUT OF "YourGeneratedCode" */ WHERE
// Metrics' definitions ( NbLinesOfCode > 30 OR // http://www.ndepend.com/Metrics.aspx#NbLinesOfCode NbILInstructions > 200 OR // http://www.ndepend.com/Metrics.aspx#NbILInstructions CyclomaticComplexity > 20 OR // http://www.ndepend.com/Metrics.aspx#CC ILCyclomaticComplexity > 50 OR // http://www.ndepend.com/Metrics.aspx#ILCC ILNestingDepth > 4 OR // http://www.ndepend.com/Metrics.aspx#ILNestingDepth NbParameters > 5 OR // http://www.ndepend.com/Metrics.aspx#NbParameters NbVariables > 8 OR // http://www.ndepend.com/Metrics.aspx#NbVariables NbOverloads > 6 ) // http://www.ndepend.com/Metrics.aspx#NbOverloads AND
// Here are some ways to avoid taking account of generated methods. !( NameIs "InitializeComponent()" OR // NDepend.CQL.GeneratedAttribute is defined in // the redistributable assembly $NDependInstallDir$\Lib\NDepend.CQL.dll
// You can define your own attribute to mark "Generated". HasAttribute "OPTIONAL:NDepend.CQL.GeneratedAttribute")
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods too big (NbLinesOfCode)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE NbLinesOfCode > 30 ORDER BY NbLinesOfCode DESC
// METHODS WHERE NbLinesOfCode > 30 are extremely complex // and should be split in smaller methods // (except if they are automatically generated by a tool).// See the definition of the NbLinesOfCode metric here // http://www.ndepend.com/Metrics.aspx#NbLinesOfCode
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods too big (NbILInstructions)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE NbILInstructions > 200 ORDER BY NbILInstructions DESC
// METHODS WHERE NbILInstructions > 200 are extremely complex // and should be split in smaller methods // (except if they are automatically generated by a tool).// See the definition of the NbILInstructions metric here // http://www.ndepend.com/Metrics.aspx#NbILInstructions
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods too complex (CyclomaticComplexity)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE CyclomaticComplexity > 20 ORDER BY CyclomaticComplexity DESC
// METHODS WHERE CyclomaticComplexity > 15 are hard to understand and maintain.// METHODS WHERE CyclomaticComplexity > 30 are extremely complex // and should be split in smaller methods // (except if they are automatically generated by a tool).// See the definition of the CyclomaticComplexity metric here // http://www.ndepend.com/Metrics.aspx#CC
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods too complex (ILCyclomaticComplexity)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE ILCyclomaticComplexity > 40 ORDER BY ILCyclomaticComplexity DESC
// METHODS WHERE ILCyclomaticComplexity > 20 // are hard to understand and maintain.// METHODS WHERE ILCyclomaticComplexity > 40 // are extremely complex and should be split
// in smaller methods // (except if they are automatically generated by a tool).// See the definition of the ILCyclomaticComplexity metric here // http://www.ndepend.com/Metrics.aspx#ILCC
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods too complex (ILNestingDepth)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE ILNestingDepth > 4 ORDER BY ILNestingDepth DESC
// METHODS WHERE ILNestingDepth > 4 are hard // to understand and maintain. // METHODS WHERE ILNestingDepth > 8 is higher // than 8 are extremely complex // and should be split in smaller methods // (except if they are automatically generated by a tool). // See the definition of the NbILInstructions metric here // http://www.NDepend.com/Metrics.aspx#ILNestingDepth
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods poorly commented (PercentageComment)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE PercentageComment < 20 AND NbLinesOfCode > 10 ORDER BY PercentageComment ASC
// METHODS WHERE %Comment < 20 and that have // at least 10 lines of code should be more commented.// See the definition of the PercentageComment metric here // http://www.ndepend.com/Metrics.aspx#PercentageComment
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods with too many parameters (NbParameters)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE NbParameters > 5 ORDER BY NbParameters DESC
// METHODS WHERE NbParameters > 5 might be painful to call // and might degrade performance. You should prefer using // additional properties/fields to the declaring type to // handle numerous states. Another alternative is to provide // a class or structure dedicated to handle arguments passing // (for example see the class System.Diagnostics.ProcessStartInfo // and the method System.Diagnostics.Process.Start(ProcessStartInfo))// See the definition of the NbParameters metric here // http://www.ndepend.com/Metrics.aspx#NbParameters
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods with too many local variables (NbVariables)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE NbVariables > 15 ORDER BY NbVariables DESC
// METHODS WHERE NbVariables > 8 are hard to understand and maintain.// METHODS WHERE NbVariables > 15 are extremely complex // and should be split in smaller methods // (except if they are automatically generated by a tool).// See the definition of the Nbvariables metric here // http://www.ndepend.com/Metrics.aspx#Nbvariables
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Code Quality} // <Name>Methods with too many overloads (NbOverloads)</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE NbOverloads > 6 ORDER BY NbOverloads DESC
// METHODS WHERE NbOverloads > 6 might // be a problem to maintain and provoke higher coupling // than necessary. // This might also reveal a potential misused of the // C# and VB.NET language that since C#3 and VB9 support // object initialization. This feature helps reducing the number // of constructors of a class.// See the definition of the NbOverloads metric here // http://www.ndepend.com/Metrics.aspx#NbOverloads
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Code Quality \ Type Metrics} // <Name>Types with too many methods</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE NbMethods > 20 ORDER BY NbMethods DESC
// TYPES WHERE NbMethods > 20 might be hard to // understand and maintain // but there might be cases where it is relevant // to have a high value for NbMethods. // For example, the System.Windows.Forms.DataGridView // standard class has more than 1000 methods.// See the definition of the NbMethods metric here // http://www.ndepend.com/Metrics.aspx#NbMethods
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Code Quality \ Type Metrics} // <Name>Types with too many fields</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE NbFields > 20 AND !IsEnumeration ORDER BY NbFields DESC
// TYPES WHERE NbFields > 20 AND !IsEnumeration // might be hard to understand and maintain // but there might be cases where it is relevant // to have a high value for NbFields. // For example, the System.Windows.Forms.Control // standard class has more than 200 fields. // The value of the metric NbFields might be a better // indicator of complex type.// See the definition of the NbFields metric here // http://www.ndepend.com/Metrics.aspx#NbFields
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Code Quality \ Type Metrics} // <Name>Types with poor cohesion (LCOM)</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE LCOM > 0.8 AND NbFields > 10 AND NbMethods >10 ORDER BY LCOM DESC
// TYPES WHERE LCOM > 0.8 AND NbFields > 10 // AND NbMethods >10 might be problematic. // However, it is very hard to avoid such // non-cohesive types. The LCOMHS metric// is often considered as more efficient to // detect non-cohesive types.// See the definition of the LCOM metric here // http://www.ndepend.com/Metrics.aspx#LCOM
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Code Quality \ Type Metrics} // <Name>Types with poor cohesion (LCOMHS)</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE LCOMHS > 0.95 AND NbFields > 10 AND NbMethods >10 ORDER BY LCOMHS DESC
// TYPES WHERE LCOMHS > 1.0 AND NbFields > 10 AND // NbMethods >10 should be avoided. // Note that this constraint is stronger // than the constraint // TYPES WHERE LCOM > 0.8 AND NbFields > 10 AND NbMethods >10. // See the definition of the LCOMHS metric here // http://www.ndepend.com/Metrics.aspx#LCOMHS
WARNING: The following CQL constraint is not satisfied. 2 assemblies on 25 tested match the condition. --> Group {Design} // <Name>Assembly should not contain namespaces dependency cycles</Name>WARN IF Count > 0 IN SELECT TOP 10 ASSEMBLIES WHEREContainsNamespaceDependencyCycle
// Dependency cycles between namespaces must be avoided// in order to have a levelized and comprehensive design.// More info available on the screencast 'Reduce the complexity'// http://s3.amazonaws.com/NDependOnlineDemos/NDependReducingComplexity_viewlet_swf.html// You can also read this article// http://www.theserverside.net/tt/articles/showarticle.tss?id=ControllingDependencies
// For any assembly matched, to display internal namespaces dependency cycle(s),// just right-click the assembly and select:// --> View internal Dependency Cycles on Graph ... or ...// --> View internal Dependency Cycles on Matrix (Recommended)// In the Matrix, dependency cycles are represented with red squares and blac
k cells.// To browse easily dependency cycles, the Matrix comes with the option:// --> Display Direct and Indirect Dependencies
assemblies # lines of code (LOC)
Full Name
PCMS-SL 55 756 PCMS-SL
PCMS-SL.Web 45 939 PCMS-SL.Web
Sum: 101 695
Average: 50 847
Minimum: 45 939
Maximum: 55 756
Standard deviation:
4 908
Variance: 24 093 344
WARNING: The following CQL constraint is not satisfied. 10 types on 1846 tested match the condition. --> Group {Design} // <Name>Type should not have too many responsabilities (Efferent Coupling)</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE TypeCe > 50 ORDER BY TypeCe DESC
// The Efferent Coupling (TypeCe) for a particular type is // the number of types it directly depends on. Notice that // types declared in third party assemblies are taken into account.
// Types that depends on too many others type (more than 50) // are complex and have more than one responsability. They // are good candidate for refactoring.
// More information available in this article:// http://codebetter.com/blogs/patricksmacchia/archive/2008/02/15/code-metrics-on-coupling-dead-code-design-flaws-and-re-engineering.aspx
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Design} // <Name>A stateless class or structure might be turned into a static type</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE SizeOfInst ==0 AND
// For accuracy, this constraint doesn't take // account of types that implement some interfaces. // and classes that have a base class and don't // derive directly from System.Object, or classes // that have sub-classes children. NbInterfacesImplemented == 0 AND ((IsClass AND DepthOfInheritance == 1 AND NbChildren == 0) OR IsStructure) AND !IsStatic AND !IsGeneric // this rule indicates stateless types that might // eventually be turned into static classes. // See the definition of the SizeOfInst metric here // http://www.ndepend.com/Metrics.aspx#SizeOfInst
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Design} // <Name>Class with no descendant should be sealed if possible</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE IsClass AND NbChildren ==0 AND !IsSealed AND !IsStatic // AND !IsPublic <-- You might want to add this condition // if you are developping a framework // with classes that are intended to be // sub-classed by your clients. ORDER BY NbLinesOfCode
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Design} // <Name>Classes that are candidate to be turned into Structures</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE IsClass AND !IsStatic AND SizeOfInst > 0 AND SizeOfInst <= 16 AND // Structure instance must not be too big, // else it degrades performance.
NbChildren == 0 AND // Must not have children
DepthOfInheritance == 1 // Must derive directly from System.Object
// AND IsSealed <-- You might want to add this condition // to restreint the set. // AND IsImmutable <-- Structures should be immutable type. // AND !IsPublic <-- You might want to add this condition if // you are developping a framework with classes // that are intended to be sub-classed by // your clients.
WARNING: The following CQL constraint is not satisfied. 10 namespaces on 117 tested match the condition. --> Group {Design} // <Name>Avoid namespaces with few types</Name>WARN IF Count > 0 IN SELECT TOP 10 NAMESPACES WHERE NbTypes < 5 ORDER BY NbTypes ASC
// Make sure that there is a logical organization // to each of your namespaces, and that there is a // valid reason for putting types in a sparsely // populated namespace. Namespaces should contain // types that are used together in most scenarios. // When their applications are mutually exclusive, // types should be located in separate namespaces
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Design} // <Name>Nested types should not be visible</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE IsNested AND !IsPrivate AND !IsInFrameworkAssembly
// A nested type is a type declared within the // scope of another type. Nested types are useful // for encapsulating private implementation details // of the containing type. Used for this purpose, // nested types should not be externally visible. // Do not use externally visible nested types for // logical grouping or to avoid name collisions; // instead, use namespaces.
WARNING: The following CQL constraint is not satisfied. 1 types on 2145 tested match the condition. --> Group {Design} // <Name>Avoid empty interfaces</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE IsInterface AND NbMethods == 0
// Interfaces define members that provide a behavior // or usage contract. The functionality described by // the interface can be adopted by any type, // regardless of where the type appears in the // inheritance hierarchy. A type implements an // interface by providing implementations for the // interface's members. An empty interface does not // define any members, and as such, does not define // a contract that can be implemented.
// If your design includes empty interfaces that // types are expected to implement, you are probably // using an interface as a marker, or a way of // identifying a group of types. If this identification // will occur at runtime, the correct way to accomplish// this is to use a custom attribute. Use the presence // or absence of the attribute, or the attribute's // properties, to identify the target types. If the // identification must occurs at compile time, then using // an empty interface is acceptable.
WARNING: The following CQL constraint is not satisfied. 1 assemblies on 25 tested match the condition. --> Group {Design} // <Name>Assemblies with poor cohesion (RelationalCohesion)</Name>WARN IF Count > 0 IN SELECT TOP 10 ASSEMBLIES WHERE NbTypes > 20 AND // Relational Cohesion metrics is relevant only if there are several types (RelationalCohesion < 1.5 OR RelationalCohesion > 4.0)
// As classes inside an assembly should be strongly related, // the cohesion should be high. On the other hand, a value // which is too high may indicate over-coupling. A good range // for RelationalCohesion is 1.5 to 4.0.// See the definition of the RelationalCohesion metric here // http://www.ndepend.com/Metrics.aspx#RelationalCohesion
assemblies # Types
Relational cohesion
Full Name
PCMS-SL.Web 694 7.7392 PCMS-SL.Web
Sum: 694 7.7392
Average: 694 7.7392
Minimum: 694 7.7392
Maximum: 694 7.7392
Standard deviation:
0 NaN
Variance: 0 -4.437898E-07
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Design \ Performance} // <Name>Instances size shouldn't be too big (SizeOfInst)</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE SizeOfInst > 64 ORDER BY SizeOfInst DESC
// TYPES WHERE SizeOfInst > 64 might degrade performance // (depending on the number of instances created at runtime) // and might be hard to maintain. However it is not a rule // since sometime there is no alternative (the size of // instances of the System.Net.NetworkInformation.SystemIcmpV6Statistics // standard class is 2064 bytes).// See the definition of the SizeOfInst metric here // http://www.ndepend.com/Metrics.aspx#SizeOfInst
WARNING: The following CQL constraint is not satisfied. 381 types on 2145 tested match the condition. --> Group {Design \ Performance} // <Name>Boxing/unboxing should be avoided (Type)</Name>WARN IF Percentage > 5 IN SELECT TYPES WHERE IsUsingBoxing OR IsUsingUnboxing
// Thanks to generics, boxing and unboxing should be rare.
types # lines of code (LOC)
Full Name
Sum: 54 962
Average: 144.26
Minimum: 4
Maximum: 8 807
Standard deviation:
542.51
Variance: 294 320
WARNING: The following CQL constraint is not satisfied. 1 types on 2145 tested match the condition. --> Group {Design \ Performance} // <Name>Attribute classes should be sealed</Name>WARN IF Count > 0 IN SELECT TYPES WHERE IsAttributeClass AND !IsSealed AND !IsAbstract AND IsPublic AND !IsInFrameworkAssembly
// The .NET Framework class library provides methods // for retrieving custom attributes. By default, // these methods search the attribute inheritance // hierarchy; for example System.Attribute.GetCustomAttribute // searches for the specified attribute type, or any // attribute type that extends the specified attribute // type. Sealing the attribute eliminates the search // through the inheritance hierarchy, and can improve // performance.
WARNING: The following CQL constraint is not satisfied. 10 methods on 39605 tested match the condition. --> Group {Unused Code / Dead Code} // <Name>Potentially unused methods</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE MethodCa == 0 AND // Ca=0 -> No Afferent Coupling -> // The method is not used in the
// context of this application.
!IsPublic AND // Public methods might be used by // client applications of your assemblies.
!IsEntryPoint AND // Main() method is not used by-design.
!IsExplicitInterfaceImpl // The IL code never explicitely AND // calls explicit interface methods // implementation.
!IsClassConstructor AND // The IL code never explicitely // calls class constructors.
!IsFinalizer // The IL code never explicitely // calls finalizers.
WARNING: The following CQL constraint is not satisfied. 10 fields on 17591 tested match the condition. --> Group {Unused Code / Dead Code} // <Name>Potentially unused fields</Name>WARN IF Count > 0 IN SELECT TOP 10 FIELDS WHERE FieldCa == 0 AND // Ca=0 -> No Afferent Coupling -> // The field is not used in the // context of this application.
!IsPublic AND // Although not recommended, // public fields might be used by // client applications of your // assemblies.
!IsLiteral AND // The IL code never explicitely // uses literal fields.
!IsEnumValue AND // The IL code never explicitely // uses enumeration value.
!NameIs "value__" // Field named 'value__' are relative // to enumerations and the IL code // never explicitely uses them.
WARNING: The following CQL constraint is not satisfied. 5 types on 1846 tested match the condition. --> Group {Unused Code / Dead Code} // <Name>Potentially unused types</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE TypeCa == 0 AND // Ca=0 -> No Afferent Coupling -> // The type is not used in the // context of this application.
!IsPublic AND // Public types might be used // by client applications of your // assemblies.
!NameIs "Program" // Generally, types named Program // contain a Main() entry-point // method and this condition avoid // to consider such type as // unused code.
WARNING: The following CQL constraint is not satisfied. 10 fields on 17620 tested match the condition. --> Group {Encapsulation} // <Name>Fields should be declared as private</Name>WARN IF Count > 0 IN SELECT TOP 10 FIELDS WHERE !IsPrivate AND
// These conditions filter cases where fields // doesn't represent state that should be encapsulated. !IsInFrameworkAssembly AND !IsGeneratedByCompiler AND !IsSpecialName AND !IsInitOnly AND !IsLiteral AND !IsEnumValue
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Encapsulation \ Methods Optimal Encapsulation} // <Name>Methods that could be declared as 'internal' in C#, 'Friend' in VB.NET</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE
CouldBeInternal AND // Eliminate default constructor from the result. // Whatever the visibility of the declaring class, // default constructors are public and introduce noise // in the current rule. ! ( IsConstructor AND IsPublic AND NbILInstructions == 3)
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Encapsulation \ Methods Optimal Encapsulation} // <Name>Methods that could be declared as 'private' in C#, 'Private' in VB.NET</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE CouldBePrivate
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Encapsulation \ Types Optimal Encapsulation} // <Name>Types that could be declared as internal</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE CouldBeInternal
types # lines of code (LOC)
Full Name
Message 0 Pegasus.Controls.Message
PCMSResource 47 PCMS_SL.PCMSResource
MainPCMS 1 274 PCMS_SL.MainPCMS
ErrorWindow 22 PCMS_SL.ErrorWindow
LoginScreen 195 PCMS_SL.LoginScreen
WaitingWindow 9 PCMS_SL.WaitingWindow
App 25 PCMS_SL.App
PageTest 51 PCMS_SL.PageTest
SLSearchEngine 68 PCMS_SL.SLSearchEngine
ValidationException
4 PCMS_SL.ValidationException
Sum: 1 695
Average: 169.5
Minimum: 0
Maximum: 1 274
Standard deviation:
372.08
Variance: 138 443
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Encapsulation \ Types Optimal Encapsulation} // <Name>Types that could be declared as 'private' in C#, 'Private' in VB.NET</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE CouldBePrivate
WARNING: The following CQL constraint is not satisfied. 4 fields on 17620 tested match the condition. --> Group {Encapsulation \ Fields Optimal Encapsulation} // <Name>Fields that could be declared as internal</Name>WARN IF Count > 0 IN SELECT TOP 10 FIELDS WHERE CouldBeInternal
WARNING: The following CQL constraint is not satisfied. 10 fields on 17620 tested match the condition. --> Group {Encapsulation \ Fields Optimal Encapsulation} // <Name>Fields that could be declared as 'private' in C#, 'Private' in VB.NET</Name>WARN IF Count > 0 IN SELECT TOP 10 FIELDS WHERE CouldBePrivate
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Test Coverage} // <Name>Complex methods should be 100% covered by tests</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS /*OUT OF "YourGeneratedCode" */ WHERE // These metrics' definitions are available here: // http://www.ndepend.com/Metrics.aspx#MetricsOnMethods ( NbILInstructions > 200 OR ILCyclomaticComplexity > 50 OR ILNestingDepth > 4 OR NbParameters > 5 OR NbVariables > 8 OR NbOverloads > 6 ) AND PercentageCoverage < 100
// To run this constraint properly coverage data must be // gathered from NCover™ or Visual Studio™ Coverage.// This can be done throught the menu: // NDepend -> Coverage -> Import Coverage Files// This can be done at analysis time throught the menu: // Project Properties -> Analysis -> Code Coverage// More information on how to import coverage data here:// http://www.ndepend.com/Coverage.aspx
WARNING: The following CQL constraint is not satisfied. 1885 fields on 17620 tested match the condition. --> Group {Purity / Immutability / Side-Effects}
// <Name>Fields should be marked as ReadOnly when possible</Name>WARN IF Count > 0 IN SELECT FIELDS WHERE IsImmutable AND !IsInitOnly AND !IsGeneratedByCompiler
// A field that matches the condition IsImmutable // is a field that is assigned only by constructors // of its class.// For an instance field, this means its value // will remain constant throught the lifetime // of the object.// For a static field, this means its value will // remain constant throught the lifetime of the // program.// In both cases, such field can safely be marked // with the C# readonly keyword // (ReadOnly in VB.NET).
// The condition IsInitOnly matches fields that // are marked with the C# readonly keyword // (ReadOnly in VB.NET).
fields Size of instance
Full Name
Sum: 7 050
Average: 3.7401
Minimum: 0
Maximum: 4
Standard deviation:
0.81713
Variance: 0.66771
WARNING: The following CQL constraint is not satisfied. 2 types on 2145 tested match the condition. --> Group {Purity / Immutability / Side-Effects} // <Name>Structures should be immutable</Name>WARN IF Count > 0 IN SELECT TYPES WHERE IsStructure AND !IsImmutable AND !IsInFrameworkAssembly
// It is deemed as a good practice to make // your structure immutable.// An object is immutable if its state doesn’t // change once the object has been created. // Consequently, a structure is immutable if // its instances are immutable.// Immutable types naturally simplify code by // limiting side-effects.
// See some explanations on immutability and // how NDepend supports it here:// http://codebetter.com/blogs/patricksmacchia/archive/2008/01/13/immutable-types-understand-them-and-use-them.aspx
types # lines of code (LOC)
Full Name
Sum: 0
Average: 0
Minimum: 0
Maximum: 0
Standard deviation:
0
Variance: 0
WARNING: The following CQL constraint is not satisfied. 3 methods on 40132 tested match the condition. --> Group {Purity / Immutability / Side-Effects} // <Name>Instance Property Getter should be immutable</Name>WARN IF Count > 0 IN SELECT METHODS WHEREIsPropertyGetter AND!IsStatic ANDChangesObjectState
// This rule might be violated in the case of object lazy initialized// when the property getter is accessed the first time.
WARNING: The following CQL constraint is not satisfied. 6 methods on 40132 tested match the condition. --> Group {Purity / Immutability / Side-Effects} // <Name>Static Property Getter should be immutable</Name>WARN IF Count > 0 IN SELECT METHODS WHEREIsPropertyGetter AND
WARNING: The following CQL constraint is not satisfied. 10 fields on 17620 tested match the condition. --> Group {Naming Conventions} // <Name>Instance fields should be prefixed with a 'm_'</Name>WARN IF Count > 0 IN SELECT TOP 10 FIELDS WHERE !NameLike "^m_" AND !IsStatic AND !IsLiteral AND !IsGeneratedByCompiler AND !IsSpecialName AND !IsEventDelegateObject
// This naming convention provokes debate.// Don't hesitate to customize the regex of // NameLike to your preference.
WARNING: The following CQL constraint is not satisfied. 10 fields on 17620 tested match the condition. --> Group {Naming Conventions} // <Name>Static fields should be prefixed with a 's_'</Name>WARN IF Count > 0 IN SELECT TOP 10 FIELDS WHERE !NameLike "^s_" AND IsStatic AND !IsLiteral AND !IsGeneratedByCompiler AND !IsSpecialName AND !IsEventDelegateObject
// This naming convention provokes debate.// Don't hesitate to customize the regex of // NameLike to your preference.
WARNING: The following CQL constraint is not satisfied. 3 types on 2145 tested match the condition. --> Group {Naming Conventions} // <Name>Abstract base class should be suffixed with 'Base'</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE IsAbstract AND IsClass AND
// equivalent to: DepthOfDeriveFrom "System.Object" == 1 DepthOfInheritance == 1 AND
((!IsGeneric AND !NameLike "Base$") OR ( IsGeneric AND !NameLike "Base<"))
WARNING: The following CQL constraint is not satisfied. 6 types on 2145 tested match the condition. --> Group {Naming Conventions} // <Name>Types name should begin with an Upper character</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE // The name of a type should begin with an Upper letter. !NameLike "^[A-Z]" AND
// Except if it is generated by compiler or ...
!IsGeneratedByCompiler AND
// ... if it is declared in a third party assembly. !IsInFrameworkAssembly
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Naming Conventions} // <Name>Methods name should begin with an Upper character</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE !NameLike "^[A-Z]" AND !( IsClassConstructor OR IsConstructor OR IsPropertyGetter OR IsPropertySetter OR IsIndexerGetter OR IsIndexerSetter OR IsEventAdder OR IsEventRemover OR IsOperator) AND !IsGeneratedByCompiler AND !IsInFrameworkAssembly
// The name of a regular method should // begin with an Upper letter.
WARNING: The following CQL constraint is not satisfied. 10 methods on 40132 tested match the condition. --> Group {Naming Conventions \ Name too long} // <Name>Avoid methods with name too long</Name>WARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE NameLike "^[^\<\(]{35,}.*$" AND !IsExplicitInterfaceImpl AND !IsInFrameworkAssembly
// The regex matches methods with name longer // than 35 characters.// Method Name doesn't contain the type and namespace // prefix, FullName does.// The regex computes the method name length from // the beginning until the first open parenthesis // or first lower than (for generic methods).
// Explicit Interface Implementation methods are // discarded because their names are prefixed // with the interface name.
WARNING: The following CQL constraint is not satisfied. 10 types on 2145 tested match the condition. --> Group {Naming Conventions \ Name too long} // <Name>Avoid types with name too long</Name>WARN IF Count > 0 IN SELECT TOP 10 TYPES WHERE NameLike "^[^\<]{35,}.*$" AND !IsNested AND !IsInFrameworkAssembly
// The regex matches types with name longer // than 35 characters.// Type Name doesn't contain the namespace // prefix, FullName does.// The regex computes the type name length from // the beginning until the end or the first lower than // (for generic types).// Nested types are discarded because their // names are prefixed with outer type's name.
WARNING: The following CQL constraint is not satisfied. 10 fields on 17620 tested match the condition. --> Group {Naming Conventions \ Name too long} // <Name>Avoid fields with name too long</Name>WARN IF Count > 0 IN SELECT TOP 10 FIELDS WHERE NameLike "^[^\<]{35,}.*$" AND !IsInFrameworkAssembly
// The regex matches fields with name longer // than 35 characters.// Field Name doesn't contain the type and // namespace prefix, FullName does.
Types MetricsIf the code base analyzed has too many types, NDepend doesn't list Types Metrics to avoid a too big report. The section Types Metrics can be activated by unchecking the option: NDepend Project Properties > Report > Avoid too big report for large code base > Hide section Types Metrics if...It is recommended to use the NDepend interactive UI capabilities to browse large applications.