Dependency Graph

Online documentation:

Dependency Matrix

Online documentation:

Visualizing Code Metrics through Treemaping

With the Online documentation, understand how Treemaping can help you see patterns in your code base, that would be hard to spot with other ways.

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).

Online documentation:

For beginners: Where to start

Code queries and rules results are truncated to list a maximum of 100 code elements in this report

Does this report gets too large?

The list contains only code elements refactored or added since the baseline for comparison.

The setting Recent Violations Only is enabled

Why should I enable the setting Recent Violations Only ?

Quick Tips

Main
Main \ Rules
Main \ Rules \ Code Quality
Main \ Rules \ Object Oriented Design
Main \ Rules \ Design
Main \ Rules \ Architecture and Layering
Main \ Rules \ Dead Code
Main \ Rules \ Visibility
Main \ Rules \ Purity - Immutability - Side-Effects
Main \ Rules \ Naming Conventions
Main \ Rules \ Source Files Organization
Main \ Rules \ .NET Framework Usage
Main \ Rules \ .NET Framework Usage \ System
Main \ Rules \ .NET Framework Usage \ System.Collection
Main \ Rules \ .NET Framework Usage \ System.Globalization
Main \ Group of Queries \ Object Oriented Design
Main \ Group of Queries \ API Breaking Changes
Main \ Group of Queries \ Code Diff Summary
Main \ Group of Queries \ Test and Code Coverage
Main \ Group of Queries \ Dead Code
Main \ Metrics \ Application Statistics
Main \ Metrics \ Assemblies Metrics
Main \ Metrics \ Namespaces Metrics
Main \ Metrics \ Types Metrics
Main \ Assemblies Dependencies
Main \ Namespaces Dependencies
Main \ Types Dependencies
Main \ Build Order
Main \ Analysis Log
Main \ Trend Charts
ndepend report summary application nameMathos (v1.0.0.0)report build date11-27-2014 19:11:48analysis duration00:08ndepend version 5.4.1.8430baseline for comparison Not Defined. To define a Baseline for Comparison, please read this online documentation. code coverage data Not Defined. To import Code Coverage Data, please read this online documentation.
Get started.Quick tips.Back to NDepend. The present HTML report is a summary of data gathered by the analysis.
It is recommended to use the NDepend interactive UI capabilities
to make the most of NDepend by mastering all aspects of your code.

Diagrams

.NET Assemblies Dependency Graph
Dependency Graph
View as ?fullscaled
.NET Assemblies Dependency Matrix
Dependency Matrix
View as ?fullscaled
Treemap View
Treemap Metric View
View as ?fullscaled
Abstractness versus Instability
Abstractness vs. Instability
View as ?fullscaled

Application Metrics

Note: Further Application Statistics are available.
# Lines of Code
5 040      
93 (NotMyCode)
# Types
196      
7   Assemblies      
39   Namespaces      
1 237   Methods      
318   Fields      
185   Source Files      
Comment
54.37%      
6 006   Lines of Comment      
Method Complexity
74   Max      
1.91   Average      
Code Coverage by TestsN/A because no coverage data specified
Third-Party Usage
21   Assemblies used      
67   Namespaces used      
302   Types used      
579   Methods used      
29   Fields used      

Rules summary

78556This section lists all Rules violated, and Rules or Queries with Error
  • Number of Rules or Queries with Error (syntax error, exception thrown, time-out): 0
  • Number of Rules violated: 61

Summary of Rules violated

graphHelp Rules can be checked live at
development-time, from within Visual
Studio. Online documentation.
graphHelp NDepend rules report too many flaws on
existing code base? Use the option
Recent Violations Only!
warningCritical Some Critical Rules are violated. Critical Rules
can be used to break the build process if
violated. Online documentation.
Name# MatchesElementsGroup
warningCritical   Methods too complex - critical
1 methodsCode Quality
warning   Quick summary of methods to refactor
35 methodsCode Quality
warning   Methods too big
9 methodsCode Quality
warning   Methods too complex
1 methodsCode Quality
warning   Methods potentially poorly commented
21 methodsCode Quality
warning   Methods with too many parameters
3 methodsCode Quality
warning   Methods with too many overloads
9 methodsCode Quality
warning   Types with too many methods
6 typesCode Quality
warning   Types with too many fields
1 typesCode Quality
warning   Types with poor cohesion
2 typesCode Quality
warning   Class with no descendant should be sealed if possible
115 typesObject Oriented Design
warning   A stateless class or structure might be turned into a static type
37 typesObject Oriented Design
warning   Non-static classes should be instantiated or turned to static
73 typesObject Oriented Design
warning   Methods should be declared static if possible
229 methodsObject Oriented Design
warning   Constructor should not call a virtual methods
6 methodsObject Oriented Design
warning   Don't assign static fields from instance methods
2 fieldsObject Oriented Design
warning   Avoid empty interfaces
7 typesObject Oriented Design
warning   Types with disposable instance fields must be disposable
1 typesDesign
warning   Classes that are candidate to be turned into structures
16 typesDesign
warning   Avoid namespaces with few types
26 namespacesDesign
warning   Nested types should not be visible
5 typesDesign
warning   Instances size shouldn't be too big
37 typesDesign
warning   Don't use obsolete types, methods or fields
62 methodsDesign
warning   Don't forget to implement methods that throw NotImplementedException
21 methodsDesign
warning   Avoid namespaces dependency cycles
1 namespacesArchitecture and Layering
warning   Assemblies with poor cohesion (RelationalCohesion)
3 assembliesArchitecture and Layering
warningCritical   Potentially dead Methods
14 methodsDead Code
warningCritical   Potentially dead Fields
38 fieldsDead Code
warning   Methods that could have a lower visibility
586 methodsVisibility
warning   Types that could have a lower visibility
90 typesVisibility
warning   Fields that could have a lower visibility
181 fieldsVisibility
warning   Types that could be declared as private, nested in a parent type
1 typesVisibility
warning   Avoid publicly visible constant fields
33 fieldsVisibility
warning   Fields should be declared as private
184 fieldsVisibility
warning   Avoid public methods not publicly visible
1 methodsVisibility
warning   Event handler methods should be declared private
49 methodsVisibility
warning   Fields should be marked as ReadOnly when possible
25 fieldsPurity - Immutability - Side-Effects
warning   Structures should be immutable
6 typesPurity - Immutability - Side-Effects
warning   Property Getters should be immutable
4 methodsPurity - Immutability - Side-Effects
warning   Avoid static fields with a mutable field type
3 fieldsPurity - Immutability - Side-Effects
warning   A field must not be assigned from outside its parent hierarchy types
2 fieldsPurity - Immutability - Side-Effects
warningCritical   Don't assign a field from many methods
7 fieldsPurity - Immutability - Side-Effects
warning   Instance fields should be prefixed with a 'm_'
267 fieldsNaming Conventions
warning   Static fields should be prefixed with a 's_'
29 fieldsNaming Conventions
warningCritical   Exception class name should be suffixed with 'Exception'
1 typesNaming Conventions
warning   Types name should begin with an Upper character
2 typesNaming Conventions
warning   Methods name should begin with an Upper character
21 methodsNaming Conventions
warning   Avoid methods with name too long
11 methodsNaming Conventions
warningCritical   Avoid having different types with same name
12 typesNaming Conventions
warning   Avoid naming types and namespaces with the same identifier
7 typesNaming Conventions
warning   Avoid defining multiple types in a source file
10 typesSource Files Organization
warning   Namespace name should correspond to file location
36 typesSource Files Organization
warning   Types with source files stored in the same directory, should be declared in the same namespace
8 namespacesSource Files Organization
warning   Types declared in the same namespace, should have their source files stored in the same directory
3 namespacesSource Files Organization
warning   Mark assemblies with CLSCompliant
6 assembliesSystem
warning   Remove calls to GC.Collect()
5 methodsSystem
warning   Don't call GC.Collect() without calling GC.WaitForPendingFinalizers()
4 methodsSystem
warning   Enum Storage should be Int32
1 fieldsSystem
warning   Do not raise too general exception types
11 methodsSystem
warning   Collection properties should be read only
1 methodsSystem.Collection
warning   Float and Date Parsing must be culture aware
2 methodsSystem.Globalization

Application Statistics

Stat # Occurences Avg StdDev Max
Properties on interfaces 9 interfaces 0.440.832 properties on Mathos.Geometry.Shapes.IShape2D
Methods on interfaces 9 interfaces 0.440.832 methods on Mathos.Geometry.Shapes.IShape2D
Arguments on methods on interfaces 4 methods 000 arguments on Mathos.Geometry.Shapes.IShape2D.get_Area()
Public properties on classes 169 Classes 0.591.578 public properties on Mathos.Geometry.Shapes.Triangle
Public methods on classes 169 classes 6.016.5432 public methods on Mathos.Matrix
Arguments on public methods on classes 1,016 methods 0.861.016 arguments on B_Geometry.GeomBox..ctor(Double,Double,Double,Double,Double,Double)
IL instructions in non-abstract methods 1,363 methods 31.2963.781539 IL instructions in MathosTest.Statistics+Literals..cctor()
Cyclomatic complexity on non abstract Methods 1,363 Methods 2.383.21 CC = 75 for Mathos.Geometry.Shapes.Triangle..ctor(Double,Double,Double,Double,Double,Double)

Assemblies Metrics

If you wish to define thresholds on assemblies' Code Metrics, consider writing some Rules.
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% CoverageAfferent CouplingEfferent CouplingRelational CohesionInstabilityAbstractnessDistance
Laboratory v1.0.0.04302473280130275-0940.11100
B_Geometry v1.0.0.0668350315029730-0591.6100
MathosTest v1.0.0.010421058731023118-01130.16100
RubyInt v1.0.0.0225207613010531-01501.23100
ProjectWebsite v1.0.0.01711904209535-0461.5100
Interactive Mathematics v1.0.0.01341483708538-0680.86100
Mathos v1.0.5.12370206261009389162-50731.110.590.090.22

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% CommentCyclomatic ComplexityIL Cyclomatic Complexity% CoverageAfferent CouplingEfferent Coupling Type Namespace
INaturalNumber6.63--0-0--50Mathos.Arithmetic.Numbers
IShape2D3.08--61000--91Mathos.Geometry.Shapes
IInteger2.58--0-0--41Mathos.Arithmetic.Numbers
IShape3D2.09--61000--71Mathos.Geometry.Shapes
Pythagorean2.03659147078-77Mathos.Geometry
Check1.78171394572.581114-911Mathos.Arithmetic.Numbers
Get1.71704739056.252948-1320Mathos.Arithmetic.Numbers
Finance1.61272957172.452132-1014Mathos.Finance
Vector1.23846067948.474464-717Mathos
DoubleArithmetic1.186449911965.033642-56Mathos.Arithmetic
IRationalNumber1.15--0-0--32Mathos.Arithmetic.Numbers
TolerantUtilities1.13643753.8557-54B_Geometry
Fraction1.13166150025060.17195-727Mathos.Arithmetic.Fractions
Base1.1--0-0--54Mathos.Converter
IIRationalNumber1.05--0-0--20Mathos.Arithmetic.Numbers
IntegralCalculus+IntegrationAlgorithm1.04--91000--54Mathos.Calculus
StatisticalProcedures111277912252.145372-527Mathos.Statistics
ComplexNumber11107701814.065768-518Mathos.Arithmetic.ComplexNumbers
ComplexArithmetic0.96594137355.32531-411Mathos.Arithmetic
Vector0.89834465941.552836-510B_Geometry
Matrix0.82249176416339.56114169-425Mathos
Convert0.816411062.547-45Mathos.Arithmetic.Numbers
PhysicalConstants+SI0.81002410000-12Mathos.Arithmetic
ConversionInfo0.793121178.5711-44Mathos.Converter
Circle0.75262264261.762532-37Mathos.Geometry.Shapes
Square0.75242043861.292228-38Mathos.Geometry.Shapes
DiceSimulator0.7402482841.181318-213Mathos.Statistics
LinearModels+LinearRegressionResults0.6813822868.2956-39Mathos.Statistics
MainWindow0.671229601611.594378-599RubyInt
IntegerArithmetic0.65372374051.952027-112Mathos.Arithmetic
Elementary0.64462766458.182127-211Mathos.Calculus
IntegralCalculus0.64281791433.33914-46Mathos.Calculus
FiniteCalculus0.59937165336.34469-315Mathos.Calculus
MathematicalConstants+Single0.5500910000-12Mathos.Arithmetic
SingleArithmetic0.556550111964.673443-17Mathos.Arithmetic
Antiderivatives0.55442168045-111Mathos.SpecialFunctions
LinearModels0.54241521029.4146-216Mathos.Statistics
ConversionBase0.523121178.5711-44Mathos.Converter
Rectangle0.52272954260.873243-28Mathos.Geometry.Shapes
BGeomMatrix0.529649165.882941-311B_Geometry
DecimalArithmetic0.51221514466.671220-25Mathos.Arithmetic
BasisFunction0.5985236138.362031-38B_Geometry
ComplexOperation0.5292236970.411519-211Mathos.Arithmetic.ComplexNumbers
BenchmarkUtil0.51564628.5736-310Mathos.Testing
IntegralApproximation0.498846112358.291722-128Laboratory.Module
SingleArithmetic+FloatIntUnion0.48000-00-14Mathos.Arithmetic
IRealNumber0.48--0-0--14Mathos.Arithmetic.Numbers
IImaginary0.48--0-0--10Mathos.Arithmetic.Numbers
Extension0.4733268513.162024-236RubyInt
RightTriangle0.462628639603142-28Mathos.Geometry.Shapes
Converter0.45437495656.572228-330Mathos.Converter
EquationSolver0.44132164175.9344-213Mathos
ArithmeticProgression0.4311832064.5288-14Mathos.PreCalculus.Sequences
GeometricProgression0.43151242461.541113-18Mathos.PreCalculus.Sequences
Fibonacci0.43412712840.581822-17Mathos.PreCalculus.Sequences
Coordinate0.42302875665.122024-213Mathos.Geometry.CoordinateGeometry .TwoDimensional
Get+<>c__DisplayClass70.41110---2-26Mathos.Arithmetic.Numbers
SyntaxExtension0.412721715084.752727-28Mathos.Syntax
Triangle0.49314839450.27127129-211Mathos.Geometry.Shapes
Finance+<>c__DisplayClass20.38232---5-18Mathos.Finance
InvalidTriangleException0.354291780.9544-16Mathos.Exceptions
DifferentialCalculus0.35111732871.7944-29Mathos.Calculus
UncertainNumber0.35112108516659.716082-232Mathos.Statistics
BCurve0.34411919181011-213B_Geometry
LinearAlgebra0.34452451727.42815-212B_Geometry
BinomialDistribution0.332420751681114-19Mathos.Statistics
HypergeometricDistribution0.33121172970.7378-19Mathos.Statistics
PoissonDistribution0.33201584368.251114-110Mathos.Statistics
InvalidCoordinateFormat0.324291780.9544-16Mathos.Exceptions
Get+<Factors>d__90.3214244---37-122Mathos.Arithmetic.Numbers
Get+<CustomList>d__00.325142---22-115Mathos.Arithmetic.Numbers
Statistics+Literals0.3715420012-17MathosTest
ComplexArithmeticTest+<>c__DisplayClass20.3217---3-17MathosTest.Mathos_Main.Arithmetic
Program0.31479317.6535-116B_Geometry.New
LinearModels+<>c__DisplayClass10.29114---2-14Mathos.Statistics
Calculate0.29161712460810-116Mathos.Geometry.CoordinateGeometry .TwoDimensional
FrmTable0.295560018-218Interactive_Mathematics
DiceSimulatorTest+<>c__DisplayClass10.2818---2-15MathosTest
Program+<>c__DisplayClass50.28848---4-114B_Geometry.New
Temperature0.28--91000--24Mathos.Converter
GammaRelated0.272619626501218-111Mathos.SpecialFunctions
Resources0.278491463.6466-113MathosTest.Properties
Cube0.262621139602024-18Mathos.Geometry.Shapes
RightCircularCone0.26313124760.263343-19Mathos.Geometry.Shapes
SquarePyramid0.26292964460.273141-19Mathos.Geometry.Shapes
RightCircularCylinder0.26313034760.263343-18Mathos.Geometry.Shapes
RectangularPrism0.26313184860.763343-18Mathos.Geometry.Shapes
Trapezoid0.26394435658.955266-17Mathos.Geometry.Shapes
Parallelogram0.262628539603142-17Mathos.Geometry.Shapes
Sphere0.26231983560.342127-17Mathos.Geometry.Shapes
MainWindow0.269911221311.614592-164Interactive_Mathematics
DenominatorNullException0.254291881.8244-16Mathos.Exceptions
InvalidFractionFormatException0.254291780.9544-16Mathos.Exceptions
Matrix+<>c__DisplayClass20.25122---4-18Mathos
StatisticalProcedures+<>c__DisplayClass10.25116---2-14Mathos.Statistics
IntegralApproximation+<>c__DisplayClass10.23110---2-16Laboratory.Module
_Default0.23878447144.943462-139ProjectWebsite
TemperatureConversion0.2213172838.11321-16Mathos.Converter
UncertainNumber+UncertaintyType0.22--61000--14Mathos.Statistics
UncertainNumber+<>c__DisplayClass10.22114---2-16Mathos.Statistics
UncertainNumber+<>c__DisplayClass60.22114---2-16Mathos.Statistics
Extension+<>c__DisplayClass10.21114---2-17RubyInt
Pressure0.21--261000--14Mathos.Converter
Angle0.21--91000--14Mathos.Converter
Power0.21--361000--14Mathos.Converter
Mass0.21--181000--14Mathos.Converter
Length0.21--181000--14Mathos.Converter
Speed0.21--141000--14Mathos.Converter
Volume0.21--541000--14Mathos.Converter
Area0.21--241000--14Mathos.Converter
_Default+<>c__DisplayClass1f0.2841060---56-126ProjectWebsite
GeomUtils0.19854303126.722030-114B_Geometry
MainWindow+<dataGrid1_MouseDoubleClick >o__SiteContainer1b0.1800---0-18Interactive_Mathematics
MainWindow+<>c__DisplayClass190.1820230---10-119Interactive_Mathematics
ResultsWindow0.173470018-114RubyInt
DataViewWindow0.171620800621-132RubyInt
MainWindow+<>c__DisplayClass60.17324---2-111RubyInt
MainWindow+<DoError>d__80.17191---10-118RubyInt
MainWindow+<About_Executed>d__e0.17185---10-119RubyInt
MyCompletionData0.17773112.5511-111RubyInt
HelpWindow0.17242111335.14921-137RubyInt
FinancePresentValue0.1512654980.3378-016Laboratory.Module.Finance
FinanceNetPresentValue0.15181014973.13810-022Laboratory.Module.Finance
FinanceFutureValueOfAnAnnuity0.1512654980.3378-016Laboratory.Module.Finance
FinanceFutureValue0.1512654980.3378-016Laboratory.Module.Finance
Torus0.15101002268.751216-05Mathos.Geometry.Shapes
DiscreteMathematics0.1538350613.641327-029MathosTest
FinanceAnnuityPaymentFutureValue0.1512654980.3378-016Laboratory.Module.Finance
ChangePassword0.1504710012-05Laboratory.Account
ChangePasswordSuccess0.15040-12-04Laboratory.Account
Login0.151151493.3312-010Laboratory.Account
NumberList0.15214466.6722-04Mathos.Statistics
Register0.156311571.4334-012Laboratory.Account
Default0.1504710012-05Laboratory
Global0.1508810056-05Laboratory
Modules0.1504710012-05Laboratory
Converter0.15754096446.043035-036Laboratory.Module
LinearRegression0.15171146378.7556-019Laboratory.Module.DataAnalysis
WebForm10.15241242853.85912-016Laboratory.Module.DataAnalysis
EquationSolver0.153522111977.271516-018Laboratory.Module
Elliptic0.159276587.8499-05Mathos.SpecialFunctions
Bessel0.15927668899-05Mathos.SpecialFunctions
Factorial0.159523579.5546-016Laboratory.Module
FinanceAnnuityPaymentPresentValue0.1512654980.3378-016Laboratory.Module.Finance
Ring0.15151492965.911925-04Mathos.Geometry.Shapes
SiteMaster0.15042110012-06Laboratory
FinancePresentValueOfAnAnnuity0.1512654980.3378-016Laboratory.Module.Finance
Settings0.152140023-06Interactive_Mathematics.Properties
Resources0.1574075055-013Interactive_Mathematics.Properties
App0.151210003-09Interactive_Mathematics
Settings0.152140023-06RubyInt.Properties
Resources0.1574075055-013RubyInt.Properties
UnitTest10.152220023-05MathosTest.SpecialFunctions
DiceSimulatorTest0.15129417.6923-015MathosTest
App0.155410005-011RubyInt
Statistics0.1557467002227-013MathosTest
TestOfFractions0.15755501617.582325-014MathosTest
VectorsAndMatrices0.15166243610.63431-013MathosTest
Uncertainty0.155242835.451727-016MathosTest.Uncertainty
ConverterTest0.154834835.881213-012MathosTest
Shapes0.1598500109.261314-018MathosTest
PythagoreanTest0.1523109723.33910-06MathosTest
SyntaxTest0.151270942.8637-017MathosTest.Mathos_Main
LinearModelsTest0.1510201---3-07MathosTest
StatisticalDistributions0.1520287002021-011MathosTest.Mathos_Main
FinanceTest0.1517184210.5389-09MathosTest
EquationSolverTest0.151099428.5734-011MathosTest
coordinateStruct0.15282101737.7869-014MathosTest
GammaTests0.1514128526.32810-016MathosTest.Mathos_Main.SpecialFunctions
ElementaryTests0.1524189927.2779-07MathosTest.Mathos_Main.SpecialFunctions
PreCalculus0.159450034-07MathosTest
FiniteCalculusTest0.153828337.3289-011MathosTest.Mathos_Main.Calculus
FinanceRemainingBalanceOfAnnuity0.151477568089-016Laboratory.Module.Finance
MConverter0.151251493.3343-08Laboratory.Module
NumberChecker0.15251274262.691314-018Laboratory.Module
AngleConversionM0.15302071736.171114-08Mathos.Converter
Triangle0.15161226379.7567-014Laboratory.Module
Uncertainty0.15281624963.641314-027Laboratory.Module
Form10.151709083617.482023-046B_Geometry
GeomBox0.1513420011-03B_Geometry
GeometryVisUtils0.15030-01-02B_Geometry
PhysicalConstants0.1500610000-03Mathos.Arithmetic
Ellipse0.15141593470.831620-05Mathos.Geometry.Shapes
IComplex0.15--0-0--06Mathos.Arithmetic.Numbers
Resources0.1574075055-013B_Geometry.Properties
Settings0.152140023-06B_Geometry.Properties
ComplexArithmeticTest0.155038100912-013MathosTest.Mathos_Main.Arithmetic
MathematicalConstants0.15007010000-05Mathos.Arithmetic
TestofcomplexNumbers0.15966154431.431719-011MathosTest
DoubleArthimeticTest0.159053566.251522-011MathosTest.Mathos_Main.Arithmetic
IntegerArthimeticTest0.152151386.6712-04MathosTest.Mathos_Main.Arithmetic
SingleArthimeticTest0.154230022-05MathosTest.Mathos_Main.Arithmetic
DecimalArithmetic0.15219133.3312-07MathosTest.Mathos_Main.Arithmetic
CalculusTest0.15273832447.062032-015MathosTest.Calculus
Program0.15001010000-01B_Geometry
About0.15040-12-04Laboratory


  

Types Metrics : Code Members and Inheritance

Type Name # Instance Methods Nb Static Methods Nb Properties # Fields# Children ClassesDepth Of Inheritance Tree Type Namespace
INaturalNumber0000--Mathos.Arithmetic.Numbers
IShape2D2020--Mathos.Geometry.Shapes
IInteger0000--Mathos.Arithmetic.Numbers
IShape3D2020--Mathos.Geometry.Shapes
Pythagorean020001Mathos.Geometry
Check170001Mathos.Arithmetic.Numbers
Get1140201Mathos.Arithmetic.Numbers
Finance090001Mathos.Finance
Vector10171601Mathos
DoubleArithmetic0200001Mathos.Arithmetic
IRationalNumber0000--Mathos.Arithmetic.Numbers
TolerantUtilities210101B_Geometry
Fraction181922--Mathos.Arithmetic.Fractions
Base------Mathos.Converter
IIRationalNumber0000--Mathos.Arithmetic.Numbers
IntegralCalculus+IntegrationAlgorithm------Mathos.Calculus
StatisticalProcedures0260301Mathos.Statistics
ComplexNumber201692--Mathos.Arithmetic.ComplexNumbers
ComplexArithmetic0120001Mathos.Arithmetic
Vector1141301B_Geometry
Matrix19241701Mathos
Convert120001Mathos.Arithmetic.Numbers
PhysicalConstants+SI000801Mathos.Arithmetic
ConversionInfo100201Mathos.Converter
Circle1225101Mathos.Geometry.Shapes
Square1024101Mathos.Geometry.Shapes
DiceSimulator700401Mathos.Statistics
LinearModels+LinearRegressionResults400401Mathos.Statistics
MainWindow20101902RubyInt
IntegerArithmetic070001Mathos.Arithmetic
Elementary0110001Mathos.Calculus
IntegralCalculus010001Mathos.Calculus
FiniteCalculus090001Mathos.Calculus
MathematicalConstants+Single000301Mathos.Arithmetic
SingleArithmetic0210001Mathos.Arithmetic
Antiderivatives040101Mathos.SpecialFunctions
LinearModels010001Mathos.Statistics
ConversionBase100201Mathos.Converter
Rectangle1225201Mathos.Geometry.Shapes
BGeomMatrix1600301B_Geometry
DecimalArithmetic020001Mathos.Arithmetic
BasisFunction700701B_Geometry
ComplexOperation0110001Mathos.Arithmetic.ComplexNumbers
BenchmarkUtil110001Mathos.Testing
IntegralApproximation10001704Laboratory.Module
SingleArithmetic+FloatIntUnion0002--Mathos.Arithmetic
IRealNumber0000--Mathos.Arithmetic.Numbers
IImaginary0000--Mathos.Arithmetic.Numbers
Extension1300101RubyInt
RightTriangle1124201Mathos.Geometry.Shapes
Converter0100201Mathos.Converter
EquationSolver040001Mathos
ArithmeticProgression802201Mathos.PreCalculus.Sequences
GeometricProgression902201Mathos.PreCalculus.Sequences
Fibonacci742201Mathos.PreCalculus.Sequences
Coordinate10322--Mathos.Geometry.CoordinateGeometry .TwoDimensional
Get+<>c__DisplayClass7200101Mathos.Arithmetic.Numbers
SyntaxExtension0270001Mathos.Syntax
Triangle2238601Mathos.Geometry.Shapes
Finance+<>c__DisplayClass2300201Mathos.Finance
InvalidTriangleException400002Mathos.Exceptions
DifferentialCalculus040001Mathos.Calculus
UncertainNumber15181301Mathos.Statistics
BCurve500401B_Geometry
LinearAlgebra110001B_Geometry
BinomialDistribution080001Mathos.Statistics
HypergeometricDistribution040001Mathos.Statistics
PoissonDistribution080001Mathos.Statistics
InvalidCoordinateFormat400002Mathos.Exceptions
Get+<Factors>d__99001001Mathos.Arithmetic.Numbers
Get+<CustomList>d__08001001Mathos.Arithmetic.Numbers
Statistics+Literals110701MathosTest
ComplexArithmeticTest+<>c__DisplayClass2300101MathosTest.Mathos_Main.Arithmetic
Program130101B_Geometry.New
LinearModels+<>c__DisplayClass1200201Mathos.Statistics
Calculate140001Mathos.Geometry.CoordinateGeometry .TwoDimensional
FrmTable300301Interactive_Mathematics
DiceSimulatorTest+<>c__DisplayClass1200101MathosTest
Program+<>c__DisplayClass5400101B_Geometry.New
Temperature------Mathos.Converter
GammaRelated050701Mathos.SpecialFunctions
Resources143201MathosTest.Properties
Cube1023101Mathos.Geometry.Shapes
RightCircularCone1425201Mathos.Geometry.Shapes
SquarePyramid1224201Mathos.Geometry.Shapes
RightCircularCylinder1425201Mathos.Geometry.Shapes
RectangularPrism1425201Mathos.Geometry.Shapes
Trapezoid1827501Mathos.Geometry.Shapes
Parallelogram1124201Mathos.Geometry.Shapes
Sphere923101Mathos.Geometry.Shapes
MainWindow71201901Interactive_Mathematics
DenominatorNullException400002Mathos.Exceptions
InvalidFractionFormatException400002Mathos.Exceptions
Matrix+<>c__DisplayClass2200101Mathos
StatisticalProcedures+<>c__DisplayClass1200101Mathos.Statistics
IntegralApproximation+<>c__DisplayClass1200201Laboratory.Module
_Default21201504ProjectWebsite
TemperatureConversion110001Mathos.Converter
UncertainNumber+UncertaintyType------Mathos.Statistics
UncertainNumber+<>c__DisplayClass1200101Mathos.Statistics
UncertainNumber+<>c__DisplayClass6200101Mathos.Statistics
Extension+<>c__DisplayClass1200201RubyInt
Pressure------Mathos.Converter
Angle------Mathos.Converter
Power------Mathos.Converter
Mass------Mathos.Converter
Length------Mathos.Converter
Speed------Mathos.Converter
Volume------Mathos.Converter
Area------Mathos.Converter
_Default+<>c__DisplayClass1f8001301ProjectWebsite
GeomUtils140001B_Geometry
MainWindow+<dataGrid1_MouseDoubleClick >o__SiteContainer1b000501Interactive_Mathematics
MainWindow+<>c__DisplayClass19200201Interactive_Mathematics
ResultsWindow300201RubyInt
DataViewWindow400301RubyInt
MainWindow+<>c__DisplayClass6200201RubyInt
MainWindow+<DoError>d__82007--RubyInt
MainWindow+<About_Executed>d__e2007--RubyInt
MyCompletionData1106301RubyInt
HelpWindow901401RubyInt
FinancePresentValue400704Laboratory.Module.Finance
FinanceNetPresentValue400704Laboratory.Module.Finance
FinanceFutureValueOfAnAnnuity400704Laboratory.Module.Finance
FinanceFutureValue400704Laboratory.Module.Finance
Torus804201Mathos.Geometry.Shapes
DiscreteMathematics910101MathosTest
FinanceAnnuityPaymentFutureValue400704Laboratory.Module.Finance
ChangePassword200104Laboratory.Account
ChangePasswordSuccess200004Laboratory.Account
Login200204Laboratory.Account
NumberList200101Mathos.Statistics
Register300204Laboratory.Account
Default200104Laboratory
Global600002Laboratory
Modules200104Laboratory
Converter500904Laboratory.Module
LinearRegression300904Laboratory.Module.DataAnalysis
WebForm1400404Laboratory.Module.DataAnalysis
EquationSolver4001704Laboratory.Module
Elliptic090001Mathos.SpecialFunctions
Bessel090001Mathos.SpecialFunctions
Factorial300504Laboratory.Module
FinanceAnnuityPaymentPresentValue400704Laboratory.Module.Finance
Ring1307201Mathos.Geometry.Shapes
SiteMaster200301Laboratory
FinancePresentValueOfAnAnnuity400704Laboratory.Module.Finance
Settings121103Interactive_Mathematics.Properties
Resources132201Interactive_Mathematics.Properties
App210001Interactive_Mathematics
Settings121103RubyInt.Properties
Resources132201RubyInt.Properties
UnitTest1300001MathosTest.SpecialFunctions
DiceSimulatorTest300001MathosTest
App210101RubyInt
Statistics2100001MathosTest
TestOfFractions2100001MathosTest
VectorsAndMatrices1700001MathosTest
Uncertainty790801MathosTest.Uncertainty
ConverterTest1300001MathosTest
Shapes1400001MathosTest
PythagoreanTest500001MathosTest
SyntaxTest300001MathosTest.Mathos_Main
LinearModelsTest300001MathosTest
StatisticalDistributions2100001MathosTest.Mathos_Main
FinanceTest900001MathosTest
EquationSolverTest400001MathosTest
coordinateStruct500001MathosTest
GammaTests800101MathosTest.Mathos_Main.SpecialFunctions
ElementaryTests700101MathosTest.Mathos_Main.SpecialFunctions
PreCalculus400001MathosTest
FiniteCalculusTest900001MathosTest.Mathos_Main.Calculus
FinanceRemainingBalanceOfAnnuity400804Laboratory.Module.Finance
MConverter200104Laboratory.Module
NumberChecker300604Laboratory.Module
AngleConversionM150001Mathos.Converter
Triangle400904Laboratory.Module
Uncertainty610804Laboratory.Module
Form11310807B_Geometry
GeomBox100601B_Geometry
GeometryVisUtils100001B_Geometry
PhysicalConstants000101Mathos.Arithmetic
Ellipse1206201Mathos.Geometry.Shapes
IComplex0000--Mathos.Arithmetic.Numbers
Resources132201B_Geometry.Properties
Settings121103B_Geometry.Properties
ComplexArithmeticTest600101MathosTest.Mathos_Main.Arithmetic
MathematicalConstants0002101Mathos.Arithmetic
TestofcomplexNumbers1700101MathosTest
DoubleArthimeticTest910001MathosTest.Mathos_Main.Arithmetic
IntegerArthimeticTest200001MathosTest.Mathos_Main.Arithmetic
SingleArthimeticTest200101MathosTest.Mathos_Main.Arithmetic
DecimalArithmetic200001MathosTest.Mathos_Main.Arithmetic
CalculusTest101101101MathosTest.Calculus
Program000001B_Geometry
About200004Laboratory


  

Types Metrics : Lack Of Cohesion Of Methods and Association Between Classes

Type Name Lack Of Cohesion Of MethodsLack Of Cohesion Of Methods HSAssociation Between Classes Type Namespace
INaturalNumber--0Mathos.Arithmetic.Numbers
IShape2D--0Mathos.Geometry.Shapes
IInteger--0Mathos.Arithmetic.Numbers
IShape3D--0Mathos.Geometry.Shapes
Pythagorean002Mathos.Geometry
Check006Mathos.Arithmetic.Numbers
Get0019Mathos.Arithmetic.Numbers
Finance0017Mathos.Finance
Vector0.640.6710Mathos
DoubleArithmetic005Mathos.Arithmetic
IRationalNumber--0Mathos.Arithmetic.Numbers
TolerantUtilities0.330.51B_Geometry
Fraction0.690.7141Mathos.Arithmetic.Fractions
Base--0Mathos.Converter
IIRationalNumber--0Mathos.Arithmetic.Numbers
IntegralCalculus+IntegrationAlgorithm--0Mathos.Calculus
StatisticalProcedures0054Mathos.Statistics
ComplexNumber0.50.5121Mathos.Arithmetic.ComplexNumbers
ComplexArithmetic0016Mathos.Arithmetic
Vector0.560.67B_Geometry
Matrix0.430.4428Mathos
Convert003Mathos.Arithmetic.Numbers
PhysicalConstants+SI000Mathos.Arithmetic
ConversionInfo001Mathos.Converter
Circle0.140.154Mathos.Geometry.Shapes
Square0.080.095Mathos.Geometry.Shapes
DiceSimulator0.390.4612Mathos.Statistics
LinearModels+LinearRegressionResults0.380.59Mathos.Statistics
MainWindow0.850.9121RubyInt
IntegerArithmetic006Mathos.Arithmetic
Elementary0012Mathos.Calculus
IntegralCalculus002Mathos.Calculus
FiniteCalculus0012Mathos.Calculus
MathematicalConstants+Single000Mathos.Arithmetic
SingleArithmetic006Mathos.Arithmetic
Antiderivatives005Mathos.SpecialFunctions
LinearModels0020Mathos.Statistics
ConversionBase002Mathos.Converter
Rectangle0.210.235Mathos.Geometry.Shapes
BGeomMatrix0.520.5611B_Geometry
DecimalArithmetic009Mathos.Arithmetic
BasisFunction0.270.318B_Geometry
ComplexOperation0017Mathos.Arithmetic.ComplexNumbers
BenchmarkUtil008Mathos.Testing
IntegralApproximation0.941.0437Laboratory.Module
SingleArithmetic+FloatIntUnion000Mathos.Arithmetic
IRealNumber--0Mathos.Arithmetic.Numbers
IImaginary--0Mathos.Arithmetic.Numbers
Extension0.620.6743RubyInt
RightTriangle0.270.295Mathos.Geometry.Shapes
Converter0033Mathos.Converter
EquationSolver0017Mathos
ArithmeticProgression0.380.431Mathos.PreCalculus.Sequences
GeometricProgression0.330.384Mathos.PreCalculus.Sequences
Fibonacci0.680.756Mathos.PreCalculus.Sequences
Coordinate0.540.5814Mathos.Geometry.CoordinateGeometry .TwoDimensional
Get+<>c__DisplayClass7002Mathos.Arithmetic.Numbers
SyntaxExtension009Mathos.Syntax
Triangle0.60.6214Mathos.Geometry.Shapes
Finance+<>c__DisplayClass2006Mathos.Finance
InvalidTriangleException003Mathos.Exceptions
DifferentialCalculus008Mathos.Calculus
UncertainNumber0.280.2963Mathos.Statistics
BCurve0.150.1914B_Geometry
LinearAlgebra0016B_Geometry
BinomialDistribution0010Mathos.Statistics
HypergeometricDistribution0010Mathos.Statistics
PoissonDistribution008Mathos.Statistics
InvalidCoordinateFormat003Mathos.Exceptions
Get+<Factors>d__90016Mathos.Arithmetic.Numbers
Get+<CustomList>d__0005Mathos.Arithmetic.Numbers
Statistics+Literals005MathosTest
ComplexArithmeticTest+<>c__DisplayClass2003MathosTest.Mathos_Main.Arithmetic
Program0021B_Geometry.New
LinearModels+<>c__DisplayClass1003Mathos.Statistics
Calculate0018Mathos.Geometry.CoordinateGeometry .TwoDimensional
FrmTable0.440.676Interactive_Mathematics
DiceSimulatorTest+<>c__DisplayClass1002MathosTest
Program+<>c__DisplayClass50015B_Geometry.New
Temperature--0Mathos.Converter
GammaRelated005Mathos.SpecialFunctions
Resources006MathosTest.Properties
Cube009Mathos.Geometry.Shapes
RightCircularCone0.250.2716Mathos.Geometry.Shapes
SquarePyramid0.210.2314Mathos.Geometry.Shapes
RightCircularCylinder0.250.2715Mathos.Geometry.Shapes
RectangularPrism0.250.2714Mathos.Geometry.Shapes
Trapezoid0.620.654Mathos.Geometry.Shapes
Parallelogram0.230.254Mathos.Geometry.Shapes
Sphere0.090.15Mathos.Geometry.Shapes
MainWindow0.570.6783Interactive_Mathematics
DenominatorNullException003Mathos.Exceptions
InvalidFractionFormatException003Mathos.Exceptions
Matrix+<>c__DisplayClass2004Mathos
StatisticalProcedures+<>c__DisplayClass1003Mathos.Statistics
IntegralApproximation+<>c__DisplayClass1002Laboratory.Module
_Default0.671.3375ProjectWebsite
TemperatureConversion003Mathos.Converter
UncertainNumber+UncertaintyType--0Mathos.Statistics
UncertainNumber+<>c__DisplayClass1002Mathos.Statistics
UncertainNumber+<>c__DisplayClass6002Mathos.Statistics
Extension+<>c__DisplayClass1002RubyInt
Pressure--0Mathos.Converter
Angle--0Mathos.Converter
Power--0Mathos.Converter
Mass--0Mathos.Converter
Length--0Mathos.Converter
Speed--0Mathos.Converter
Volume--0Mathos.Converter
Area--0Mathos.Converter
_Default+<>c__DisplayClass1f0035ProjectWebsite
GeomUtils0018B_Geometry
MainWindow+<dataGrid1_MouseDoubleClick >o__SiteContainer1b000Interactive_Mathematics
MainWindow+<>c__DisplayClass190022Interactive_Mathematics
ResultsWindow0.50.754RubyInt
DataViewWindow0.50.6726RubyInt
MainWindow+<>c__DisplayClass6007RubyInt
MainWindow+<DoError>d__8007RubyInt
MainWindow+<About_Executed>d__e006RubyInt
MyCompletionData003RubyInt
HelpWindow0.670.7536RubyInt
FinancePresentValue0.791.0512Laboratory.Module.Finance
FinanceNetPresentValue0.791.0515Laboratory.Module.Finance
FinanceFutureValueOfAnAnnuity0.791.0512Laboratory.Module.Finance
FinanceFutureValue0.791.0512Laboratory.Module.Finance
Torus0.380.432Mathos.Geometry.Shapes
DiscreteMathematics0032MathosTest
FinanceAnnuityPaymentFutureValue0.791.0512Laboratory.Module.Finance
ChangePassword121Laboratory.Account
ChangePasswordSuccess001Laboratory.Account
Login0.751.57Laboratory.Account
NumberList003Mathos.Statistics
Register0.67111Laboratory.Account
Default121Laboratory
Global001Laboratory
Modules121Laboratory
Converter0.780.9728Laboratory.Module
LinearRegression0.71.0617Laboratory.Module.DataAnalysis
WebForm10.75113Laboratory.Module.DataAnalysis
EquationSolver0.781.0419Laboratory.Module
Elliptic001Mathos.SpecialFunctions
Bessel001Mathos.SpecialFunctions
Factorial0.731.114Laboratory.Module
FinanceAnnuityPaymentPresentValue0.791.0512Laboratory.Module.Finance
Ring0.460.51Mathos.Geometry.Shapes
SiteMaster121Laboratory
FinancePresentValueOfAnAnnuity0.791.0512Laboratory.Module.Finance
Settings001Interactive_Mathematics.Properties
Resources004Interactive_Mathematics.Properties
App005Interactive_Mathematics
Settings001RubyInt.Properties
Resources004RubyInt.Properties
UnitTest1003MathosTest.SpecialFunctions
DiceSimulatorTest0016MathosTest
App0.6716RubyInt
Statistics0035MathosTest
TestOfFractions0028MathosTest
VectorsAndMatrices0031MathosTest
Uncertainty0021MathosTest.Uncertainty
ConverterTest0011MathosTest
Shapes0069MathosTest
PythagoreanTest003MathosTest
SyntaxTest0017MathosTest.Mathos_Main
LinearModelsTest006MathosTest
StatisticalDistributions0023MathosTest.Mathos_Main
FinanceTest0013MathosTest
EquationSolverTest0010MathosTest
coordinateStruct0016MathosTest
GammaTests0012MathosTest.Mathos_Main.SpecialFunctions
ElementaryTests008MathosTest.Mathos_Main.SpecialFunctions
PreCalculus0010MathosTest
FiniteCalculusTest009MathosTest.Mathos_Main.Calculus
FinanceRemainingBalanceOfAnnuity0.781.0412Laboratory.Module.Finance
MConverter124Laboratory.Module
NumberChecker0.781.1717Laboratory.Module
AngleConversionM009Mathos.Converter
Triangle0.781.0420Laboratory.Module
Uncertainty0.770.9637Laboratory.Module
Form10.820.8885B_Geometry
GeomBox001B_Geometry
GeometryVisUtils001B_Geometry
PhysicalConstants000Mathos.Arithmetic
Ellipse0.670.733Mathos.Geometry.Shapes
IComplex--0Mathos.Arithmetic.Numbers
Resources004B_Geometry.Properties
Settings001B_Geometry.Properties
ComplexArithmeticTest0.170.217MathosTest.Mathos_Main.Arithmetic
MathematicalConstants000Mathos.Arithmetic
TestofcomplexNumbers0032MathosTest
DoubleArthimeticTest0017MathosTest.Mathos_Main.Arithmetic
IntegerArthimeticTest002MathosTest.Mathos_Main.Arithmetic
SingleArthimeticTest003MathosTest.Mathos_Main.Arithmetic
DecimalArithmetic004MathosTest.Mathos_Main.Arithmetic
CalculusTest0014MathosTest.Calculus
Program000B_Geometry
About001Laboratory

Namespaces Metrics

If you wish to define thresholds on namespaces' Code Metrics, consider writing some Code Rules.
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% CoverageAfferent CouplingEfferent Coupling
Laboratory024543100-04
Laboratory.Account75443683-06
Laboratory.Module2781589950964-020
Laboratory.Module.DataAnalysis4123829168-07
Laboratory.Module.Finance104568839979-06
B_Geometry63733221124527-09
B_Geometry.New221272312-05
B_Geometry.Properties95421460-09
MathosTest69577581611213-023
MathosTest.Calculus2738312447-03
MathosTest.SpecialFunctions222100-02
MathosTest.Uncertainty52428135-05
MathosTest.Properties84912172-18
MathosTest.Mathos_Main323572921-08
MathosTest.Mathos_Main.Arithmetic15099062011-06
MathosTest.Mathos_Main.Calculus38283137-03
MathosTest.Mathos_Main.SpecialFunctions3831721426-08
RubyInt2162022114416-046
RubyInt.Properties95421460-09
ProjectWebsite171190427129-012
Interactive_Mathematics125142952416-023
Interactive_Mathematics.Properties95421460-09
Mathos3472608429946-49
Mathos.Testing15641937-32
Mathos.Calculus1781344518450-96
Mathos.Converter9211521535579-36
Mathos.SpecialFunctions48292418579-24
Mathos.Statistics36329001451258-613
Mathos.Finance2932727471-24
Mathos.Exceptions1611648183-32
Mathos.Syntax27217115385-23
Mathos.Arithmetic24718011052768-53
Mathos.Arithmetic.ComplexNumbers13999329440-34
Mathos.Arithmetic.Numbers11310491317660-118
Mathos.Arithmetic.Fractions1661500125460-45
Mathos.Geometry65911773-21
Mathos.Geometry.Shapes47152681876161-23
Mathos.Geometry.CoordinateGeometry .TwoDimensional4645828665-13
Mathos.PreCalculus.Sequences6747838555-11

391
Code Quality  

warningCritical    Critical Rule warning: Methods too complex - critical
// <Name>Methods too complex - critical</Name>
warnif count > 0 from m in JustMyCode.Methods where 
  
m.ILCyclomaticComplexity > 40 && 
  
m.ILNestingDepth > 5
  
orderby m.ILCyclomaticComplexity descending,
          
m.ILNestingDepth descending
select new { m, m.ILCyclomaticComplexity, m.ILNestingDepth }

// Methods with ILCyclomaticComplexity > 40 and ILNestingDepth  > 4
// are really too complex and should be split 
// in smaller methods, or even types.
// See the definition of the ILCyclomaticComplexity metric here 
// http://www.ndepend.com/Metrics.aspx#ILCC
// See the definition of the ILNestingDepth metric here 
// http://www.NDepend.com/Metrics.aspx#ILNestingDepth

1 methods matched

methodIL Cyclomatic Complexity (ILCC)IL Nesting DepthFull Name
.ctor(Double,Double,Double,Double,Double ,Double)756Mathos.Geometry.Shapes.Triangle..ctor (Double,Double,Double,Double,Double ,Double)

Statistics

Stat   IL Cyclomatic Complexity (ILCC)   IL Nesting Depth
Sum:756
Average:756
Minimum:756
Maximum:756
Standard deviation:00
Variance:00
warning    Rule warning: Quick summary of methods to refactor
// <Name>Quick summary of methods to refactor</Name>
warnif count > 0 from m in JustMyCode.Methods where 
                                    
// Code Metrics' definitions
  m.NbLinesOfCode > 30 ||           // http://www.ndepend.com/Metrics.aspx#NbLinesOfCode
  // We've commented # IL Instructions, because with LINQ syntax, a few lines of code can compile to hundreds of IL instructions.
  // m.NbILInstructions > 200 ||       // http://www.ndepend.com/Metrics.aspx#NbILInstructions
  m.CyclomaticComplexity > 20 ||    // http://www.ndepend.com/Metrics.aspx#CC
  m.ILCyclomaticComplexity > 50 ||  // http://www.ndepend.com/Metrics.aspx#ILCC
  m.ILNestingDepth > 5 ||           // http://www.ndepend.com/Metrics.aspx#ILNestingDepth
  m.NbParameters > 5 ||             // http://www.ndepend.com/Metrics.aspx#NbParameters
  m.NbVariables > 8 ||              // http://www.ndepend.com/Metrics.aspx#NbVariables
  m.NbOverloads > 6                 // http://www.ndepend.com/Metrics.aspx#NbOverloads

select new { m, m.NbLinesOfCode, m.NbILInstructions, m.CyclomaticComplexity, 
             
m.ILCyclomaticComplexity, m.ILNestingDepth, 
             
m.NbParameters, m.NbVariables, m.NbOverloads } 

35 methods matched

methods# lines of code (LOC)# IL instructionsCyclomatic Complexity (CC)IL Cyclomatic Complexity (ILCC)IL Nesting Depth# Parameters# Variables# OverloadsFull Name
CalculateButton_Click(Object,EventArgs)4229414161231Laboratory.Module.Converter .CalculateButton_Click(Object,EventArgs)
Calculate()361645510111Laboratory.Module.IntegralApproximation .Calculate()
Evaluate(Int32,Int32,Double)201596102391B_Geometry.BasisFunction.Evaluate(Int32 ,Int32,Double)
button1_Click(Object,EventArgs)503042312121B_Geometry.Form1.button1_Click(Object ,EventArgs)
DrawCube()32145110001B_Geometry.Form1.DrawCube()
.ctor(Double,Double,Double,Double,Double ,Double)1342110601B_Geometry.GeomBox..ctor(Double,Double ,Double,Double,Double,Double)
CentripetalMethod_calculateInterpolation Parameters(Vector[],Double[]&)1570231291B_Geometry.GeomUtils .CentripetalMethod_calculateInterpolatio nParameters(Vector[],Double[]&)
CentripetalMethod_createSplineByInterpol ation(Int32,Vector[],BCurve&)3819691533151B_Geometry.GeomUtils .CentripetalMethod_createSplineByInterpo lation(Int32,Vector[],BCurve&)
GaussianElimination(BGeomMatrix,Vector ,Double[]&)4524281423121B_Geometry.LinearAlgebra .GaussianElimination(BGeomMatrix,Vector ,Double[]&)
TestMethod1()121561100101MathosTest.VectorsAndMatrices .TestMethod1()
Equality2equalMatrices()223103220111MathosTest.VectorsAndMatrices .Equality2equalMatrices()
Determinant()16284322091MathosTest.VectorsAndMatrices .Determinant()
TestRootsOf()23209471091MathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest.TestRootsOf()
ComparePowIntAndMathSqrtInAccuracy()151072310121MathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest .ComparePowIntAndMathSqrtInAccuracy()
Page_Load(Object,EventArgs)524433152271ProjectWebsite._Default.Page_Load(Object ,EventArgs)
SystemOfTwoEquations(Double,Double ,Double,Double,Double,Double)350110621Mathos.EquationSolver .SystemOfTwoEquations(Double,Double ,Double,Double,Double,Double)
RREF()42246122040121Mathos.Matrix.RREF()
LinearRegression(List<Decimal>,List <Decimal>)241524612101Mathos.Statistics.LinearModels .LinearRegression(List<Decimal>,List <Decimal>)
.ctor(Int64)29110109Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Int64)
.ctor(Decimal)29110109Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Decimal)
.ctor(Double)28110109Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Double)
.ctor(Int32,Int32)210110209Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Int32,Int32)
.ctor(Decimal,Decimal)110110209Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Decimal,Decimal)
.ctor(Double,Double)28110209Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Double,Double)
.ctor(Fraction,Fraction)110110209Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Fraction,Fraction)
.ctor(String)231588112189Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(String)
.ctor(Complex)110110109Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Complex)
op_Implicit(String)17110107Mathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(String)
op_Implicit(Int16)18110107Mathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Int16)
op_Implicit(Int32)18110107Mathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Int32)
op_Implicit(Int64)17110107Mathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Int64)
op_Implicit(Double)17110107Mathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Double)
op_Implicit(Decimal)19110107Mathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Decimal)
op_Implicit(Complex)17110107Mathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Complex)
.ctor(Double,Double,Double,Double,Double ,Double)3992974756614Mathos.Geometry.Shapes.Triangle..ctor (Double,Double,Double,Double,Double ,Double)

Statistics

Stat   # lines of code (LOC)   # IL instructions   Cyclomatic Complexity (CC)   IL Cyclomatic Complexity (ILCC)   IL Nesting Depth   # Parameters   # Variables   # Overloads
Sum:5824 7871782263257162152
Average:16.63136.775.096.460.911.634.634.34
Minimum:17110001
Maximum:52929747566159
Standard deviation:16.85179.5812.2712.931.341.615.193.57
Variance:28432 247150.59167.221.792.5826.9812.74
warning    Rule warning: Methods too big
// <Name>Methods too big</Name>
warnif count > 0 from m in JustMyCode.Methods where 
   
m.NbLinesOfCode > 30
   
// We've commented # IL Instructions, because with LINQ syntax, a few lines of code can compile to hundreds of IL instructions.
   // || m.NbILInstructions > 200
   orderby m.NbLinesOfCode descending,
           
m.NbILInstructions descending
select new { m, m.NbLinesOfCode, m.NbILInstructions }

// Methods where NbLinesOfCode > 30 or NbILInstructions > 200
// are extremely complex and should be split in smaller methods.
// See the definition of the NbLinesOfCode metric here 
// http://www.ndepend.com/Metrics.aspx#NbLinesOfCode

9 methods matched

methods# lines of code (LOC)# IL instructionsFull Name
Page_Load(Object,EventArgs)52443ProjectWebsite._Default.Page_Load(Object ,EventArgs)
button1_Click(Object,EventArgs)50304B_Geometry.Form1.button1_Click(Object ,EventArgs)
GaussianElimination(BGeomMatrix,Vector ,Double[]&)45242B_Geometry.LinearAlgebra .GaussianElimination(BGeomMatrix,Vector ,Double[]&)
CalculateButton_Click(Object,EventArgs)42294Laboratory.Module.Converter .CalculateButton_Click(Object,EventArgs)
RREF()42246Mathos.Matrix.RREF()
.ctor(Double,Double,Double,Double,Double ,Double)39929Mathos.Geometry.Shapes.Triangle..ctor (Double,Double,Double,Double,Double ,Double)
CentripetalMethod_createSplineByInterpol ation(Int32,Vector[],BCurve&)38196B_Geometry.GeomUtils .CentripetalMethod_createSplineByInterpo lation(Int32,Vector[],BCurve&)
Calculate()36164Laboratory.Module.IntegralApproximation .Calculate()
DrawCube()32145B_Geometry.Form1.DrawCube()

Statistics

Stat   # lines of code (LOC)   # IL instructions
Sum:3762 963
Average:41.78329.22
Minimum:32145
Maximum:52929
Standard deviation:6.09228.05
Variance:37.0652 008
warning    Rule warning: Methods too complex
// <Name>Methods too complex</Name>
warnif count > 0 from m in JustMyCode.Methods where 
  
m.CyclomaticComplexity > 20 ||
  
m.ILCyclomaticComplexity > 40 ||
  
m.ILNestingDepth > 5
  
orderby m.CyclomaticComplexity descending,
          
m.ILCyclomaticComplexity descending,
          
m.ILNestingDepth descending
select new { m, m.CyclomaticComplexity, 
                
m.ILCyclomaticComplexity,
                
m.ILNestingDepth  }

// Methods where CyclomaticComplexity > 20 
// or ILCyclomaticComplexity > 40
// or ILNestingDepth > 4
// are hard to understand and maintain
// and should be split in smaller methods.
// See the definition of the complexity metrics here:
// http://www.ndepend.com/Metrics.aspx#CC
// http://www.ndepend.com/Metrics.aspx#ILCC
// http://www.NDepend.com/Metrics.aspx#ILNestingDepth

1 methods matched

methodCyclomatic Complexity (CC)IL Cyclomatic Complexity (ILCC)IL Nesting DepthFull Name
.ctor(Double,Double,Double,Double,Double ,Double)74756Mathos.Geometry.Shapes.Triangle..ctor (Double,Double,Double,Double,Double ,Double)

Statistics

Stat   Cyclomatic Complexity (CC)   IL Cyclomatic Complexity (ILCC)   IL Nesting Depth
Sum:74756
Average:74756
Minimum:74756
Maximum:74756
Standard deviation:000
Variance:000
warning    Rule warning: Methods potentially poorly commented
// <Name>Methods potentially poorly commented</Name>
warnif count > 0 from m in JustMyCode.Methods where 
  
m.PercentageComment < 20 && 
  
m.NbLinesOfCode > 20  
  
orderby m.PercentageComment ascending
select new { m, m.PercentageComment, m.NbLinesOfCode, m.NbLinesOfComment }

// Methods where %Comment < 20 and that have 
// at least 20 lines of code might need to be more commented.
// See the definition of the Comments metric here 
// http://www.ndepend.com/Metrics.aspx#PercentageComment
// http://www.ndepend.com/Metrics.aspx#NbLinesOfComment 

21 methods matched

methodsPercentage Comment# lines of code (LOC)# lines of commentFull Name
SetValues(Int32)0300Laboratory.Module.Converter.SetValues (Int32)
CalculateButton_Click(Object,EventArgs)0250Laboratory.Module.NumberChecker .CalculateButton_Click(Object,EventArgs)
DrawCube()0320B_Geometry.Form1.DrawCube()
Equality2equalMatrices()0220MathosTest.VectorsAndMatrices .Equality2equalMatrices()
TestRootsOf()0230MathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest.TestRootsOf()
.ctor(Matrix,Int32,Int32)0210Mathos.Matrix..ctor(Matrix,Int32,Int32)
Mode(List<Decimal>)0210Mathos.Statistics.StatisticalProcedures .Mode(List<Decimal>)
LinearRegression(List<Decimal>,List <Decimal>)0240Mathos.Statistics.LinearModels .LinearRegression(List<Decimal>,List <Decimal>)
.ctor(String)0230Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(String)
CalculateButton_Click(Object,EventArgs)2421Laboratory.Module.Converter .CalculateButton_Click(Object,EventArgs)
Integrate(Func<Double,Double>,Double ,Double ,IntegralCalculus+IntegrationAlgorithm ,Double)3281Mathos.Calculus.IntegralCalculus .Integrate(Func<Double,Double>,Double ,Double ,IntegralCalculus+IntegrationAlgorithm ,Double)
ToCondensedSternBrocotSystem(String)4231Mathos.Arithmetic.Fractions.Fraction .ToCondensedSternBrocotSystem(String)
button1_Click(Object,EventArgs)5503B_Geometry.Form1.button1_Click(Object ,EventArgs)
.ctor()9283Interactive_Mathematics.MainWindow..ctor ()
Calculate()10364Laboratory.Module.IntegralApproximation .Calculate()
RREF()10425Mathos.Matrix.RREF()
.ctor(List<Int32>,List<Double>)12284B_Geometry.BasisFunction..ctor(List <Int32>,List<Double>)
.ctor()12284RubyInt.MainWindow..ctor()
<Page_Load>b__b(Decimal[])12223ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__b (Decimal[])
<Page_Load>b__c(Decimal[])17286ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__c (Decimal[])
<Page_Load>b__a(Decimal[])19215ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__a (Decimal[])

Statistics

Stat   Percentage Comment   # lines of code (LOC)   # lines of comment
Sum:11559740
Average:5.4828.431.9
Minimum:0210
Maximum:19506
Standard deviation:6.127.792.04
Variance:37.4960.724.18
warning    Rule warning: Methods with too many parameters
// <Name>Methods with too many parameters</Name>
warnif count > 0 from m in JustMyCode.Methods where 
  
m.NbParameters > 5 
  
orderby m.NbParameters descending
select new { m, m.NbParameters }

// 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

3 methods matched

methods# ParametersFull Name
.ctor(Double,Double,Double,Double,Double ,Double)6B_Geometry.GeomBox..ctor(Double,Double ,Double,Double,Double,Double)
SystemOfTwoEquations(Double,Double ,Double,Double,Double,Double)6Mathos.EquationSolver .SystemOfTwoEquations(Double,Double ,Double,Double,Double,Double)
.ctor(Double,Double,Double,Double,Double ,Double)6Mathos.Geometry.Shapes.Triangle..ctor (Double,Double,Double,Double,Double ,Double)

Statistics

Stat   # Parameters
Sum:18
Average:6
Minimum:6
Maximum:6
Standard deviation:0
Variance:0
warning    Rule warning: Methods with too many overloads
// <Name>Methods with too many overloads</Name>
warnif count > 0 from m in JustMyCode.Methods where 
  
m.NbOverloads > 6 && 
  
!m.IsOperator // Don't report operator overload
  orderby m.NbOverloads descending
select new { m, m.NbOverloads }

// 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

9 methods matched

methods# OverloadsFull Name
.ctor(Int64)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Int64)
.ctor(Decimal)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Decimal)
.ctor(Double)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Double)
.ctor(Int32,Int32)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Int32,Int32)
.ctor(Decimal,Decimal)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Decimal,Decimal)
.ctor(Double,Double)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Double,Double)
.ctor(Fraction,Fraction)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Fraction,Fraction)
.ctor(String)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(String)
.ctor(Complex)9Mathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Complex)

Statistics

Stat   # Overloads
Sum:81
Average:9
Minimum:9
Maximum:9
Standard deviation:0
Variance:0
warning    Rule warning: Types with too many methods
// <Name>Types with too many methods</Name>
warnif count > 0 from t in JustMyCode.Types 

  
// Optimization: Fast discard of non-relevant types 
  where t.Methods.Count() > 20

  
// Don't match these methods
  let methods = t.Methods.Where(
       
m => !(m.IsConstructor || m.IsClassConstructor ||
              
m.IsGeneratedByCompiler ||
              
m.IsPropertyGetter || m.IsPropertySetter ||
              
m.IsEventAdder || m.IsEventRemover))

  
where methods.Count() > 20 
  
orderby methods.Count() descending
select new { t, 
             
nbMethods = methods.Count(),
             
instanceMethods = methods.Where(m => !m.IsStatic), 
             
staticMethods = methods.Where(m => m.IsStatic)}

// Types where number of methods is greater than 20 
// might be hard to understand and maintain 
// but there might be cases where it is relevant 
// to have a high number of methods. 
// For example, the System.Windows.Forms.DataGridView 
// standard class has more than 1000 methods.

6 types matched

typesnbMethodsinstanceMethodsstaticMethodsFull Name
Matrix3214 methods18 methodsMathos.Matrix
UncertainNumber2912 methods17 methodsMathos.Statistics.UncertainNumber
Fraction2910 methods19 methodsMathos.Arithmetic.Fractions.Fraction
SyntaxExtension270 method27 methodsMathos.Syntax.SyntaxExtension
StatisticalProcedures230 method23 methodsMathos.Statistics.StatisticalProcedures
SingleArithmetic210 method21 methodsMathos.Arithmetic.SingleArithmetic

Statistics

Stat   nbMethods   instanceMethods   staticMethods
Sum:16100
Average:26.8300
Minimum:2100
Maximum:3200
Standard deviation:3.7600
Variance:14.1400
warning    Rule warning: Types with too many fields
// <Name>Types with too many fields</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.Fields.Count() > 20 && 
  
!t.IsEnumeration 
  
orderby t.Fields.Count() descending
select new { t, t.InstanceFields, t.StaticFields, t.SizeOfInst }

// Types where Fields.Count() > 20 and not IsEnumeration 
// might be hard to understand and maintain 
// but there might be cases where it is relevant 
// to have a high number of fields. 
// For example, the System.Windows.Forms.Control 
// standard class has more than 200 fields.

1 types matched

typeInstanceFieldsStaticFieldsSize of instanceFull Name
MathematicalConstants0 field21 fieldsN/AMathos.Arithmetic.MathematicalConstants

Statistics

Stat   InstanceFields   StaticFields   Size of instance
Sum:000
Average:000
Minimum:000
Maximum:000
Standard deviation:000
Variance:000
warning    Rule warning: Types with poor cohesion
// <Name>Types with poor cohesion</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
(t.LCOM > 0.8 || t.LCOMHS > 0.95) && 
  
t.NbFields > 10 && 
  
t.NbMethods >10 
  
orderby t.LCOM descending, t.LCOMHS descending
select new { t, t.LCOM, t.LCOMHS, 
                
t.NbMethods, t.NbFields }

// 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

2 types matched

typesLack of Cohesion Of Methods (LCOM)LCOM Henderson-Sellers (LCOMHS)# Methods# FieldsFull Name
MainWindow0.850.92119RubyInt.MainWindow
_Default0.671.331415ProjectWebsite._Default

Statistics

Stat   Lack of Cohesion Of Methods (LCOM)   LCOM Henderson-Sellers (LCOMHS)   # Methods   # Fields
Sum:1.522.243534
Average:0.761.1217.517
Minimum:0.670.91415
Maximum:0.851.332119
Standard deviation:0.0940.213.52
Variance:0.00880.04612.254

670
Object Oriented Design  

warning    Rule warning: Class with no descendant should be sealed if possible
// <Name>Class with no descendant should be sealed if possible</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsClass && 
  
t.NbChildren ==0 && 
 
!t.IsSealed && 
 
!t.IsStatic 
  
// && !t.IsPublic <-- You might want to add this condition 
  //                    if you are developing a framework
  //                    with classes that are intended to be 
  //                    sub-classed by your clients.
  orderby t.NbLinesOfCode descending
select new { t, t.NbLinesOfCode }

115 types matched

types# lines of code (LOC)Full Name
Matrix249Mathos.Matrix
Form1170B_Geometry.Form1
VectorsAndMatrices166MathosTest.VectorsAndMatrices
MainWindow122RubyInt.MainWindow
UncertainNumber112Mathos.Statistics.UncertainNumber
MainWindow99Interactive_Mathematics.MainWindow
BasisFunction98B_Geometry.BasisFunction
Shapes98MathosTest.Shapes
BGeomMatrix96B_Geometry.BGeomMatrix
TestofcomplexNumbers96MathosTest.TestofcomplexNumbers
Triangle93Mathos.Geometry.Shapes.Triangle
DoubleArthimeticTest90MathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegralApproximation88Laboratory.Module.IntegralApproximation
_Default87ProjectWebsite._Default
GeomUtils85B_Geometry.GeomUtils
Vector84Mathos.Vector
Vector83B_Geometry.Vector
Converter75Laboratory.Module.Converter
TestOfFractions75MathosTest.TestOfFractions
Get70Mathos.Arithmetic.Numbers.Get
Statistics57MathosTest.Statistics
Uncertainty52MathosTest.Uncertainty.Uncertainty
ComplexArithmeticTest50MathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest
ConverterTest48MathosTest.ConverterTest
LinearAlgebra45B_Geometry.LinearAlgebra
BCurve41B_Geometry.BCurve
Fibonacci41Mathos.PreCalculus.Sequences.Fibonacci
DiceSimulator40Mathos.Statistics.DiceSimulator
Trapezoid39Mathos.Geometry.Shapes.Trapezoid
DiscreteMathematics38MathosTest.DiscreteMathematics
FiniteCalculusTest38MathosTest.Mathos_Main.Calculus .FiniteCalculusTest
EquationSolver35Laboratory.Module.EquationSolver
Extension33RubyInt.Extension
RightCircularCone31Mathos.Geometry.Shapes.RightCircularCone
RightCircularCylinder31Mathos.Geometry.Shapes .RightCircularCylinder
RectangularPrism31Mathos.Geometry.Shapes.RectangularPrism
AngleConversionM30Mathos.Converter.AngleConversionM
SquarePyramid29Mathos.Geometry.Shapes.SquarePyramid
Uncertainty28Laboratory.Module.Uncertainty
coordinateStruct28MathosTest.coordinateStruct
CalculusTest27MathosTest.Calculus.CalculusTest
Rectangle27Mathos.Geometry.Shapes.Rectangle
Cube26Mathos.Geometry.Shapes.Cube
Circle26Mathos.Geometry.Shapes.Circle
RightTriangle26Mathos.Geometry.Shapes.RightTriangle
Parallelogram26Mathos.Geometry.Shapes.Parallelogram
NumberChecker25Laboratory.Module.NumberChecker
WebForm124Laboratory.Module.DataAnalysis.WebForm1
ElementaryTests24MathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
HelpWindow24RubyInt.HelpWindow
Square24Mathos.Geometry.Shapes.Square
PythagoreanTest23MathosTest.PythagoreanTest
Sphere23Mathos.Geometry.Shapes.Sphere
StatisticalDistributions20MathosTest.Mathos_Main .StatisticalDistributions
FinanceNetPresentValue18Laboratory.Module.Finance .FinanceNetPresentValue
LinearRegression17Laboratory.Module.DataAnalysis .LinearRegression
FinanceTest17MathosTest.FinanceTest
Check17Mathos.Arithmetic.Numbers.Check
Triangle16Laboratory.Module.Triangle
DataViewWindow16RubyInt.DataViewWindow
Calculate16Mathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate
BenchmarkUtil15Mathos.Testing.BenchmarkUtil
Ring15Mathos.Geometry.Shapes.Ring
GeometricProgression15Mathos.PreCalculus.Sequences .GeometricProgression
FinanceRemainingBalanceOfAnnuity14Laboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity
Program14B_Geometry.New.Program
GammaTests14MathosTest.Mathos_Main.SpecialFunctions .GammaTests
Ellipse14Mathos.Geometry.Shapes.Ellipse
GeomBox13B_Geometry.GeomBox
TemperatureConversion13Mathos.Converter.TemperatureConversion
LinearModels+LinearRegressionResults13Mathos.Statistics .LinearModels+LinearRegressionResults
FinanceAnnuityPaymentFutureValue12Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue
FinanceAnnuityPaymentPresentValue12Laboratory.Module.Finance .FinanceAnnuityPaymentPresentValue
FinanceFutureValue12Laboratory.Module.Finance .FinanceFutureValue
FinanceFutureValueOfAnAnnuity12Laboratory.Module.Finance .FinanceFutureValueOfAnAnnuity
FinancePresentValue12Laboratory.Module.Finance .FinancePresentValue
FinancePresentValueOfAnAnnuity12Laboratory.Module.Finance .FinancePresentValueOfAnAnnuity
DiceSimulatorTest12MathosTest.DiceSimulatorTest
SyntaxTest12MathosTest.Mathos_Main.SyntaxTest
ArithmeticProgression11Mathos.PreCalculus.Sequences .ArithmeticProgression
EquationSolverTest10MathosTest.EquationSolverTest
LinearModelsTest10MathosTest.LinearModelsTest
Torus10Mathos.Geometry.Shapes.Torus
Factorial9Laboratory.Module.Factorial
PreCalculus9MathosTest.PreCalculus
Statistics+Literals7MathosTest.Statistics+Literals
MyCompletionData7RubyInt.MyCompletionData
Register6Laboratory.Account.Register
TolerantUtilities6B_Geometry.TolerantUtilities
Convert6Mathos.Arithmetic.Numbers.Convert
App5RubyInt.App
FrmTable5Interactive_Mathematics.FrmTable
SingleArthimeticTest4MathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest
DenominatorNullException4Mathos.Exceptions .DenominatorNullException
InvalidCoordinateFormat4Mathos.Exceptions .InvalidCoordinateFormat
InvalidFractionFormatException4Mathos.Exceptions .InvalidFractionFormatException
InvalidTriangleException4Mathos.Exceptions .InvalidTriangleException
ResultsWindow3RubyInt.ResultsWindow
ConversionInfo3Mathos.Converter.ConversionInfo
ConversionBase3Mathos.Converter.ConversionBase

Statistics

Stat   # lines of code (LOC)
Sum:3 740
Average:32.52
Minimum:0
Maximum:249
Standard deviation:40.25
Variance:1 620
warning    Rule warning: A stateless class or structure might be turned into a static type
// <Name>A stateless class or structure might be turned into a static type</Name>
// This rule indicates stateless types that might 
// eventually be turned into static classes.
warnif count > 0 from t in JustMyCode.Types where
  
!t.IsStatic &&                  
  
!t.IsGeneric &&
   
t.InstanceFields.Count() == 0 &&

   
// Don't match:
   // --> types that implement some interfaces.
   t.NbInterfacesImplemented == 0 &&

   
// --> or classes that have sub-classes children.                            
   t.NbChildren == 0 &&

   
// --> or classes that have a base class
   ((t.IsClass && t.DepthOfDeriveFrom("System.Object".AllowNoMatch()) == 1) ||
     
t.IsStructure) 

   
select t  

37 types matched

typesFull Name
GeometryVisUtilsB_Geometry.GeometryVisUtils
GeomUtilsB_Geometry.GeomUtils
LinearAlgebraB_Geometry.LinearAlgebra
ProgramB_Geometry.New.Program
TestofcomplexNumbersMathosTest.TestofcomplexNumbers
PreCalculusMathosTest.PreCalculus
DiceSimulatorTestMathosTest.DiceSimulatorTest
DiscreteMathematicsMathosTest.DiscreteMathematics
coordinateStructMathosTest.coordinateStruct
EquationSolverTestMathosTest.EquationSolverTest
FinanceTestMathosTest.FinanceTest
LinearModelsTestMathosTest.LinearModelsTest
PythagoreanTestMathosTest.PythagoreanTest
ShapesMathosTest.Shapes
ConverterTestMathosTest.ConverterTest
VectorsAndMatricesMathosTest.VectorsAndMatrices
TestOfFractionsMathosTest.TestOfFractions
StatisticsMathosTest.Statistics
Statistics+LiteralsMathosTest.Statistics+Literals
CalculusTestMathosTest.Calculus.CalculusTest
UnitTest1MathosTest.SpecialFunctions.UnitTest1
UncertaintyMathosTest.Uncertainty.Uncertainty
StatisticalDistributionsMathosTest.Mathos_Main .StatisticalDistributions
SyntaxTestMathosTest.Mathos_Main.SyntaxTest
DoubleArthimeticTestMathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegerArthimeticTestMathosTest.Mathos_Main.Arithmetic .IntegerArthimeticTest
DecimalArithmeticMathosTest.Mathos_Main.Arithmetic .DecimalArithmetic
FiniteCalculusTestMathosTest.Mathos_Main.Calculus .FiniteCalculusTest
ElementaryTestsMathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
GammaTestsMathosTest.Mathos_Main.SpecialFunctions .GammaTests
BenchmarkUtilMathos.Testing.BenchmarkUtil
AngleConversionMMathos.Converter.AngleConversionM
TemperatureConversionMathos.Converter.TemperatureConversion
CheckMathos.Arithmetic.Numbers.Check
GetMathos.Arithmetic.Numbers.Get
ConvertMathos.Arithmetic.Numbers.Convert
CalculateMathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warning    Rule warning: Non-static classes should be instantiated or turned to static
// <Name>Non-static classes should be instantiated or turned to static</Name>
// Notice that classes only instantiated through reflection, like plug-in root classes
// are matched by this rules.
warnif count > 0
from t in JustMyCode.Types
where  t.IsClass &&
    
//!t.IsPublic &&   // if you are developing a framework, 
                       // you might not want to match public classes
      !t.IsStatic && 
      
!t.IsAttributeClass && // Attributes class are never seen as instantiated
      !t.DeriveFrom("System.MarshalByRefObject".AllowNoMatch()) // Types instantiated through remoting infrastructure
       
// find the first constructor of t called
let ctorCalled = t.Constructors.FirstOrDefault(ctor => ctor.NbMethodsCallingMe > 0)

// match t if none of its constructors is called.
where ctorCalled == null
select new { t, t.Visibility }

73 types matched

typesVisibilityFull Name
AboutPublicLaboratory.About
DefaultPublicLaboratory.Default
GlobalPublicLaboratory.Global
ModulesPublicLaboratory.Modules
SiteMasterPublicLaboratory.SiteMaster
ChangePasswordPublicLaboratory.Account.ChangePassword
ChangePasswordSuccessPublicLaboratory.Account.ChangePasswordSuccess
LoginPublicLaboratory.Account.Login
RegisterPublicLaboratory.Account.Register
ConverterPublicLaboratory.Module.Converter
EquationSolverPublicLaboratory.Module.EquationSolver
FactorialPublicLaboratory.Module.Factorial
IntegralApproximationPublicLaboratory.Module.IntegralApproximation
MConverterPublicLaboratory.Module.MConverter
NumberCheckerPublicLaboratory.Module.NumberChecker
TrianglePublicLaboratory.Module.Triangle
UncertaintyPublicLaboratory.Module.Uncertainty
LinearRegressionPublicLaboratory.Module.DataAnalysis .LinearRegression
WebForm1PublicLaboratory.Module.DataAnalysis.WebForm1
FinanceAnnuityPaymentFutureValuePublicLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue
FinanceAnnuityPaymentPresentValuePublicLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue
FinanceFutureValuePublicLaboratory.Module.Finance .FinanceFutureValue
FinanceFutureValueOfAnAnnuityPublicLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity
FinanceNetPresentValuePublicLaboratory.Module.Finance .FinanceNetPresentValue
FinancePresentValuePublicLaboratory.Module.Finance .FinancePresentValue
FinancePresentValueOfAnAnnuityPublicLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity
FinanceRemainingBalanceOfAnnuityPublicLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity
Form1PublicB_Geometry.Form1
GeomBoxPublicB_Geometry.GeomBox
GeometryVisUtilsPublicB_Geometry.GeometryVisUtils
GeomUtilsInternalB_Geometry.GeomUtils
LinearAlgebraPublicB_Geometry.LinearAlgebra
ProgramPublicB_Geometry.New.Program
TestofcomplexNumbersPublicMathosTest.TestofcomplexNumbers
PreCalculusPublicMathosTest.PreCalculus
DiceSimulatorTestPublicMathosTest.DiceSimulatorTest
DiscreteMathematicsPublicMathosTest.DiscreteMathematics
coordinateStructPublicMathosTest.coordinateStruct
EquationSolverTestPublicMathosTest.EquationSolverTest
FinanceTestPublicMathosTest.FinanceTest
LinearModelsTestPublicMathosTest.LinearModelsTest
PythagoreanTestPublicMathosTest.PythagoreanTest
ShapesPublicMathosTest.Shapes
ConverterTestPublicMathosTest.ConverterTest
VectorsAndMatricesPublicMathosTest.VectorsAndMatrices
TestOfFractionsPublicMathosTest.TestOfFractions
StatisticsPublicMathosTest.Statistics
Statistics+LiteralsPrivateMathosTest.Statistics+Literals
CalculusTestPublicMathosTest.Calculus.CalculusTest
UnitTest1PublicMathosTest.SpecialFunctions.UnitTest1
UncertaintyPublicMathosTest.Uncertainty.Uncertainty
StatisticalDistributionsPublicMathosTest.Mathos_Main .StatisticalDistributions
SyntaxTestPublicMathosTest.Mathos_Main.SyntaxTest
ComplexArithmeticTestPublicMathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest
DoubleArthimeticTestPublicMathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegerArthimeticTestPublicMathosTest.Mathos_Main.Arithmetic .IntegerArthimeticTest
SingleArthimeticTestPublicMathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest
DecimalArithmeticPublicMathosTest.Mathos_Main.Arithmetic .DecimalArithmetic
FiniteCalculusTestPublicMathosTest.Mathos_Main.Calculus .FiniteCalculusTest
ElementaryTestsPublicMathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
GammaTestsPublicMathosTest.Mathos_Main.SpecialFunctions .GammaTests
MainWindowPublicRubyInt.MainWindow
_DefaultPublicProjectWebsite._Default
MainWindowPublicInteractive_Mathematics.MainWindow
BenchmarkUtilPublicMathos.Testing.BenchmarkUtil
AngleConversionMPublicMathos.Converter.AngleConversionM
TemperatureConversionPublicMathos.Converter.TemperatureConversion
NumberListPublicMathos.Statistics.NumberList
CheckPublicMathos.Arithmetic.Numbers.Check
GetPublicMathos.Arithmetic.Numbers.Get
ConvertPublicMathos.Arithmetic.Numbers.Convert
CalculatePublicMathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate
FibonacciPublicMathos.PreCalculus.Sequences.Fibonacci

Statistics

Stat   Visibility
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Methods should be declared static if possible
// <Name>Methods should be declared static if possible</Name>
warnif count > 0

// When an instance method can be safely declared as static you should declare it as static.
// Since it doesn't use any instance data and method of its type and base-types,
// you should consider if such a method could be moved to a static utility class
// or if it is strongly related enough to its current declaring type to stay in it.
//
// Turning an instance method into a static method is a micro performance optimization
// since a static method is a bit cheaper to invoke than an instance method.

from t in JustMyCode.Types.Where(t =>
   
!t.IsStatic && !t.IsInterface &&
   
!t.IsEnumeration && !t.IsDelegate &&
   
!t.IsGeneratedByCompiler)

let methodsThatCanBeMadeStatic = 
   
from m in t.InstanceMethods

   
// An instance method can be turned to static if it is not virtual, 
   // not using the this reference and also, not using
   // any of its class or base classes instance fields or instance methods.
   where !m.IsAbstract && !m.IsVirtual &&
         
!m.AccessThis && !m.IsExplicitInterfaceImpl &&

          
// Optimization: Using FirstOrDefault() avoid to check all members, 
          //               as soon as one member is found
          //               we know the method m cannot be made static.
          m.MembersUsed.FirstOrDefault(
              
mUsed => !mUsed.IsStatic && 
                       
(mUsed.ParentType == t || 
                        
t.DeriveFrom(mUsed.ParentType))
          
) == null 
   
select m

from m in methodsThatCanBeMadeStatic
let staticFieldsUsed = m.ParentType.StaticFields.UsedBy(m).Where(f => !f.IsGeneratedByCompiler)
select new { m, staticFieldsUsed }

229 methods matched

methodsstaticFieldsUsedFull Name
Page_Load(Object,EventArgs)0 fieldLaboratory.About.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Default.Page_Load(Object ,EventArgs)
Application_Start(Object,EventArgs)0 fieldLaboratory.Global.Application_Start (Object,EventArgs)
Application_End(Object,EventArgs)0 fieldLaboratory.Global.Application_End(Object ,EventArgs)
Application_Error(Object,EventArgs)0 fieldLaboratory.Global.Application_Error (Object,EventArgs)
Session_Start(Object,EventArgs)0 fieldLaboratory.Global.Session_Start(Object ,EventArgs)
Session_End(Object,EventArgs)0 fieldLaboratory.Global.Session_End(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Modules.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.SiteMaster.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Account.ChangePassword .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Account.ChangePasswordSuccess .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.EquationSolver .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Factorial.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.IntegralApproximation .Page_Load(Object,EventArgs)
EvaluateExpression(String,Double)0 fieldLaboratory.Module.IntegralApproximation .EvaluateExpression(String,Double)
IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)0 fieldLaboratory.Module.IntegralApproximation .IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)
IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)0 fieldLaboratory.Module.IntegralApproximation .IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)
IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)0 fieldLaboratory.Module.IntegralApproximation .IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.NumberChecker .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Triangle.Page_Load (Object,EventArgs)
ToDoubleC(String)0 fieldLaboratory.Module.Triangle.ToDoubleC (String)
pow(Decimal,Decimal)0 fieldLaboratory.Module.Uncertainty.pow (Decimal,Decimal)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.DataAnalysis .LinearRegression.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.DataAnalysis.WebForm1 .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceFutureValue.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceNetPresentValue.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinancePresentValue.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .Page_Load(Object,EventArgs)
glControl1_MouseUp(Object,MouseEventArgs )1 fieldB_Geometry.Form1.glControl1_MouseUp (Object,MouseEventArgs)
glControl1_MouseDown(Object ,MouseEventArgs)2 fieldsB_Geometry.Form1.glControl1_MouseDown (Object,MouseEventArgs)
button1_Click(Object,EventArgs)1 fieldB_Geometry.Form1.button1_Click(Object ,EventArgs)
DrawCurve(Double)1 fieldB_Geometry.Form1.DrawCurve(Double)
DrawCube()0 fieldB_Geometry.Form1.DrawCube()
AreApproximatelyEqual(Double,Double)0 fieldMathosTest.TestofcomplexNumbers .AreApproximatelyEqual(Double,Double)
IsApproximatelyZero(Double)0 fieldMathosTest.TestofcomplexNumbers .IsApproximatelyZero(Double)
ComplexNumberConstructorsWithNonZeroValu edParameters()0 fieldMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithNonZeroVal uedParameters()
ComplexNumberConstructorsWithZeroValuedP arameters()0 fieldMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithZeroValued Parameters()
TestEqualityOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestEqualityOfComplexNos()
TestAdditionOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestAdditionOfComplexNos()
TestSubtractionOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestSubtractionOfComplexNos()
TestMultiplicationOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestMultiplicationOfComplexNos()
TestComplexFractionFromString()0 fieldMathosTest.TestofcomplexNumbers .TestComplexFractionFromString()
CalculateSum()0 fieldMathosTest.PreCalculus.CalculateSum()
ArithmeticProgression()0 fieldMathosTest.PreCalculus .ArithmeticProgression()
GeometricProgression()0 fieldMathosTest.PreCalculus .GeometricProgression()
DiceDiff()0 fieldMathosTest.DiceSimulatorTest.DiceDiff()
Find()0 fieldMathosTest.DiscreteMathematics.Find()
FindLargePrimes()0 fieldMathosTest.DiscreteMathematics .FindLargePrimes()
Factorial()0 fieldMathosTest.DiscreteMathematics.Factorial ()
Remainder()0 fieldMathosTest.DiscreteMathematics.Remainder ()
FactorialBigIntegerTest()0 fieldMathosTest.DiscreteMathematics .FactorialBigIntegerTest()
OtherStuff()0 fieldMathosTest.DiscreteMathematics .OtherStuff()
IsDivisibleBy()0 fieldMathosTest.DiscreteMathematics .IsDivisibleBy()
GetFactors()0 fieldMathosTest.DiscreteMathematics .GetFactors()
CoordinateBasic()0 fieldMathosTest.coordinateStruct .CoordinateBasic()
TestingExtensionMethods()0 fieldMathosTest.coordinateStruct .TestingExtensionMethods()
TestVisualRepresentation()0 fieldMathosTest.coordinateStruct .TestVisualRepresentation()
QuadraticEquationExTest()0 fieldMathosTest.EquationSolverTest .QuadraticEquationExTest()
QuadraticEquationTest()0 fieldMathosTest.EquationSolverTest .QuadraticEquationTest()
SystemOfTwoEquationsTest()0 fieldMathosTest.EquationSolverTest .SystemOfTwoEquationsTest()
FutureValue()0 fieldMathosTest.FinanceTest.FutureValue()
PresentValue()0 fieldMathosTest.FinanceTest.PresentValue()
NetPresentValue()0 fieldMathosTest.FinanceTest.NetPresentValue()
PresentValueOfAnnuity()0 fieldMathosTest.FinanceTest .PresentValueOfAnnuity()
FutureValueOfAnnuity()0 fieldMathosTest.FinanceTest .FutureValueOfAnnuity()
AnnuityPaymentPresentValue()0 fieldMathosTest.FinanceTest .AnnuityPaymentPresentValue()
AnnuityPaymentFutureValue()0 fieldMathosTest.FinanceTest .AnnuityPaymentFutureValue()
RemainingBalanceOfAnnuity()0 fieldMathosTest.FinanceTest .RemainingBalanceOfAnnuity()
PredictionTest()0 fieldMathosTest.LinearModelsTest .PredictionTest()
TestDiff()0 fieldMathosTest.LinearModelsTest.TestDiff()
FindHypotenuse()0 fieldMathosTest.PythagoreanTest .FindHypotenuse()
FindHypotenuseValidateInputs()0 fieldMathosTest.PythagoreanTest .FindHypotenuseValidateInputs()
FindNonHypotenuse()0 fieldMathosTest.PythagoreanTest .FindNonHypotenuse()
FindNonHypotenuseValidateInputs()0 fieldMathosTest.PythagoreanTest .FindNonHypotenuseValidateInputs()
CircleTest()0 fieldMathosTest.Shapes.CircleTest()
CubeTest()0 fieldMathosTest.Shapes.CubeTest()
ParallelogramTest()0 fieldMathosTest.Shapes.ParallelogramTest()
RectangleTest()0 fieldMathosTest.Shapes.RectangleTest()
RectangularPrismTest()0 fieldMathosTest.Shapes.RectangularPrismTest()
RightCircularConeTest()0 fieldMathosTest.Shapes.RightCircularConeTest( )
RightCircularCylinderTest()0 fieldMathosTest.Shapes .RightCircularCylinderTest()
SphereTest()0 fieldMathosTest.Shapes.SphereTest()
SquareTest()0 fieldMathosTest.Shapes.SquareTest()
SquarePyramidTest()0 fieldMathosTest.Shapes.SquarePyramidTest()
TrapezoidTest()0 fieldMathosTest.Shapes.TrapezoidTest()
RightTriangleTest()0 fieldMathosTest.Shapes.RightTriangleTest()
TriangleTest()0 fieldMathosTest.Shapes.TriangleTest()
LengthConversion()0 fieldMathosTest.ConverterTest .LengthConversion()
SpeedConversion()0 fieldMathosTest.ConverterTest.SpeedConversion ()
MassConversion()0 fieldMathosTest.ConverterTest.MassConversion( )
VolumeConversion()0 fieldMathosTest.ConverterTest .VolumeConversion()
AreaConversion()0 fieldMathosTest.ConverterTest.AreaConversion( )
PressureConversion()0 fieldMathosTest.ConverterTest .PressureConversion()
PowerConversion()0 fieldMathosTest.ConverterTest.PowerConversion ()
BaseConversions()0 fieldMathosTest.ConverterTest.BaseConversions ()
UnitConverterTest()0 fieldMathosTest.ConverterTest .UnitConverterTest()

Statistics

Stat   staticFieldsUsed
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Constructor should not call a virtual methods
// <Name>Constructor should not call a virtual methods</Name>

// Returns constructor of a non-sealed type calling virtual methods.
// In such a situation, if a derived class overrides the method,
// then the override method will be called before the derived constructor.
// This makes the class fragile to derive from.
//
// Violations reported can be solved by re-designing object initialisation
// or by marking the parent class as sealed, if possible.

warnif count > 0
from t in Application.Types where 
   
t.IsClass &&
  
!t.IsGeneratedByCompiler &&
  
!t.IsSealed

from ctor in t.Constructors 
let virtualMethodsCalled = from mCalled in ctor.MethodsCalled
                           
where mCalled.IsVirtual &&
                                
(mCalled.ParentType == t ||
                                 
t.DeriveFrom(mCalled.ParentType))
                           
select mCalled
where virtualMethodsCalled.Count() > 0

select new { ctor , 
             
virtualMethodsCalled, 
             
// If there is no derived type, it might be 
             // an opportunity to mark t as sealed.
             t.DerivedTypes }

6 methods matched

methodsvirtualMethodsCalledDerivedTypesFull Name
.ctor()1 method0 typeRubyInt.HelpWindow..ctor()
.ctor()1 method0 typeRubyInt.ResultsWindow..ctor()
.ctor(MainWindow)1 method0 typeRubyInt.DataViewWindow..ctor(MainWindow)
.ctor()1 method0 typeRubyInt.MainWindow..ctor()
.ctor()1 method0 typeInteractive_Mathematics.FrmTable..ctor()
.ctor()1 method0 typeInteractive_Mathematics.MainWindow..ctor ()

Statistics

Stat   virtualMethodsCalled   DerivedTypes
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warning    Rule warning: Don't assign static fields from instance methods
// <Name>Don't assign static fields from instance methods</Name>
// Assigning static fields from instance methods leads to
// poorly maintainable and non thread-safe code.
// It is advised to assign static fields inline or from class constructor.
warnif count > 0
from f in Application.Fields where 
  
f.IsStatic &&
 
!f.IsLiteral &&
 
!f.IsInitOnly &&
 
!f.IsGeneratedByCompiler &&
  
// Contract API define such a insideContractEvaluation static field
  f.Name != "insideContractEvaluation"
let assignedBy = f.MethodsAssigningMe.Where(m => !m.IsStatic)
where assignedBy .Count() > 0
select new { f, assignedBy }

2 fields matched

fieldsassignedByFull Name
session_curve1 methodB_Geometry.Form1.session_curve
mouse_clicked2 methodsB_Geometry.Form1.mouse_clicked

Statistics

Stat   assignedBy
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Avoid empty interfaces
// <Name>Avoid empty interfaces</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsInterface && 
  
t.NbMethods == 0
select new { t, t.TypesThatImplementMe }

// 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.

7 types matched

typesTypesThatImplementMeFull Name
INaturalNumber5 typesMathos.Arithmetic.Numbers.INaturalNumber
IInteger4 typesMathos.Arithmetic.Numbers.IInteger
IRationalNumber3 typesMathos.Arithmetic.Numbers .IRationalNumber
IIRationalNumber2 typesMathos.Arithmetic.Numbers .IIRationalNumber
IRealNumber1 typeMathos.Arithmetic.Numbers.IRealNumber
IImaginary1 typeMathos.Arithmetic.Numbers.IImaginary
IComplex0 typeMathos.Arithmetic.Numbers.IComplex

Statistics

Stat   TypesThatImplementMe
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

770
Design  

warning    Rule warning: Types with disposable instance fields must be disposable
// <Name>Types with disposable instance fields must be disposable</Name>
warnif count > 0

// Several IDisposable type can be found if several .NET Fx are referenced.
let iDisposables = ThirdParty.Types.WithFullName("System.IDisposable")
where iDisposables.Any() // in case the code base doesn't use at all System.IDisposable

from t in Application.Types.Except(Application.Types.ThatImplementAny(iDisposables))
where !t.IsGeneratedByCompiler 

let instanceFieldsDisposable = 
    
t.InstanceFields.Where(f => f.FieldType != null &&
                                
f.FieldType.InterfacesImplemented.Intersect(iDisposables).Any())

where instanceFieldsDisposable.Any()
select new { t, instanceFieldsDisposable }

1 types matched

typeinstanceFieldsDisposableFull Name
Form11 fieldB_Geometry.Form1

Statistics

Stat   instanceFieldsDisposable
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Classes that are candidate to be turned into structures
// <Name>Classes that are candidate to be turned into structures</Name>
//
// CAUTION: Before applying this rule, make sure to understand 
//          the implication of transforming a class into a structure.
//          http://msdn.microsoft.com/en-us/library/aa664471(v=vs.71).aspx
//
// Int32, Double or Boolean are structures and not classes.
// Structure are particularly suited to implement lightweight values.
// Hence a class is candidate to be turned into a structure
// when its instances are lightweight values.
//
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsClass &&
 
!t.IsGeneratedByCompiler &&
 
!t.IsStatic &&
  
t.SizeOfInst > 0 &&
  
t.SizeOfInst <= 16 &&   // Structure instance must not be too big, 
                          // else it degrades performance.

  
t.NbChildren == 0 &&    // Must not have children

  
// Must not implement interfaces to avoid boxing mismatch 
  // when structures implements interfaces.
  t.InterfacesImplemented.Count() == 0 &&

  
// Must have no base class
  t.DepthOfDeriveFrom("System.Object".AllowNoMatch()) == 1

select new { t, t.SizeOfInst, t.InstanceFields } // Must derive directly from System.Object

  
// && t.IsSealed    <-- You might want to add this condition 
  //                      to restraint the set.
  // && t.IsImmutable <-- Structures should be immutable type.
  // && t.!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.
  

16 types matched

typesSize of instanceInstanceFieldsFull Name
BCurve164 fieldsB_Geometry.BCurve
BGeomMatrix123 fieldsB_Geometry.BGeomMatrix
TolerantUtilities81 fieldB_Geometry.TolerantUtilities
Vector93 fieldsB_Geometry.Vector
ComplexArithmeticTest81 fieldMathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest
SingleArthimeticTest41 fieldMathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest
Extension41 fieldRubyInt.Extension
Vector41 fieldMathos.Vector
Matrix41 fieldMathos.Matrix
ConversionInfo122 fieldsMathos.Converter.ConversionInfo
ConversionBase52 fieldsMathos.Converter.ConversionBase
DiceSimulator164 fieldsMathos.Statistics.DiceSimulator
NumberList41 fieldMathos.Statistics.NumberList
ArithmeticProgression162 fieldsMathos.PreCalculus.Sequences .ArithmeticProgression
GeometricProgression162 fieldsMathos.PreCalculus.Sequences .GeometricProgression
Fibonacci82 fieldsMathos.PreCalculus.Sequences.Fibonacci

Statistics

Stat   Size of instance   InstanceFields
Sum:1460
Average:9.120
Minimum:40
Maximum:160
Standard deviation:4.730
Variance:22.360
warning    Rule warning: Avoid namespaces with few types
// <Name>Avoid namespaces with few types</Name>
warnif count > 0 from n in JustMyCode.Namespaces 
let types = n.ChildTypes.Where(t => !t.IsGeneratedByCompiler)
where 
  
types.Count() < 5 
  
orderby types.Count() ascending
select new { n, types } 

// 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

26 namespaces matched

namespacestypesFull Name
B_Geometry.New1 typeB_Geometry.New
MathosTest.Calculus1 typeMathosTest.Calculus
MathosTest.SpecialFunctions1 typeMathosTest.SpecialFunctions
MathosTest.Uncertainty1 typeMathosTest.Uncertainty
MathosTest.Properties1 typeMathosTest.Properties
MathosTest.Mathos_Main.Calculus1 typeMathosTest.Mathos_Main.Calculus
ProjectWebsite1 typeProjectWebsite
Mathos.Testing1 typeMathos.Testing
Mathos.Finance1 typeMathos.Finance
Mathos.Syntax1 typeMathos.Syntax
Mathos.Arithmetic.Fractions1 typeMathos.Arithmetic.Fractions
Mathos.Geometry1 typeMathos.Geometry
Laboratory.Module.DataAnalysis2 typesLaboratory.Module.DataAnalysis
B_Geometry.Properties2 typesB_Geometry.Properties
MathosTest.Mathos_Main2 typesMathosTest.Mathos_Main
MathosTest.Mathos_Main.SpecialFunctions2 typesMathosTest.Mathos_Main.SpecialFunctions
RubyInt.Properties2 typesRubyInt.Properties
Interactive_Mathematics.Properties2 typesInteractive_Mathematics.Properties
Mathos.Arithmetic.ComplexNumbers2 typesMathos.Arithmetic.ComplexNumbers
Mathos.Geometry.CoordinateGeometry .TwoDimensional2 typesMathos.Geometry.CoordinateGeometry .TwoDimensional
Interactive_Mathematics3 typesInteractive_Mathematics
Mathos3 typesMathos
Mathos.PreCalculus.Sequences3 typesMathos.PreCalculus.Sequences
Laboratory.Account4 typesLaboratory.Account
Mathos.SpecialFunctions4 typesMathos.SpecialFunctions
Mathos.Exceptions4 typesMathos.Exceptions

Statistics

Stat   types
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Nested types should not be visible
// <Name>Nested types should not be visible</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsNested && 
 
!t.IsGeneratedByCompiler &&
 
!t.IsPrivate 
select new { t, t.NbLinesOfCode, t.Visibility } 


// 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.

5 types matched

types# lines of code (LOC)VisibilityFull Name
IntegralCalculus+IntegrationAlgorithmN/APublicMathos.Calculus .IntegralCalculus+IntegrationAlgorithm
LinearModels+LinearRegressionResults13PublicMathos.Statistics .LinearModels+LinearRegressionResults
UncertainNumber+UncertaintyTypeN/APublicMathos.Statistics .UncertainNumber+UncertaintyType
MathematicalConstants+Single0PublicMathos.Arithmetic .MathematicalConstants+Single
PhysicalConstants+SI0PublicMathos.Arithmetic.PhysicalConstants+SI

Statistics

Stat   # lines of code (LOC)   Visibility
Sum:130
Average:4.330
Minimum:00
Maximum:130
Standard deviation:6.130
Variance:37.560
warning    Rule warning: Instances size shouldn't be too big
// <Name>Instances size shouldn't be too big</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.SizeOfInst > 64 
  
orderby t.SizeOfInst descending
select new { t, t.SizeOfInst, t.InstanceFields }

// 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).
// Notice that a class with a large SizeOfInst value
// doesn't necessarily have a lot of instance fields.
// It might derive from a class with a large SizeOfInst value.
// See the definition of the SizeOfInst metric here 
// http://www.ndepend.com/Metrics.aspx#SizeOfInst

37 types matched

typesSize of instanceInstanceFieldsFull Name
MainWindow4917 fieldsInteractive_Mathematics.MainWindow
HelpWindow4794 fieldsRubyInt.HelpWindow
DataViewWindow4753 fieldsRubyInt.DataViewWindow
FrmTable4753 fieldsInteractive_Mathematics.FrmTable
ResultsWindow4712 fieldsRubyInt.ResultsWindow
EquationSolver42617 fieldsLaboratory.Module.EquationSolver
IntegralApproximation42617 fieldsLaboratory.Module.IntegralApproximation
Converter3949 fieldsLaboratory.Module.Converter
Triangle3949 fieldsLaboratory.Module.Triangle
LinearRegression3949 fieldsLaboratory.Module.DataAnalysis .LinearRegression
FinanceRemainingBalanceOfAnnuity3908 fieldsLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity
Uncertainty3867 fieldsLaboratory.Module.Uncertainty
FinanceAnnuityPaymentFutureValue3867 fieldsLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue
FinanceAnnuityPaymentPresentValue3867 fieldsLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue
FinanceFutureValue3867 fieldsLaboratory.Module.Finance .FinanceFutureValue
FinanceFutureValueOfAnAnnuity3867 fieldsLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity
FinanceNetPresentValue3867 fieldsLaboratory.Module.Finance .FinanceNetPresentValue
FinancePresentValue3867 fieldsLaboratory.Module.Finance .FinancePresentValue
FinancePresentValueOfAnAnnuity3867 fieldsLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity
NumberChecker3826 fieldsLaboratory.Module.NumberChecker
Factorial3785 fieldsLaboratory.Module.Factorial
WebForm13744 fieldsLaboratory.Module.DataAnalysis.WebForm1
_Default3703 fieldsProjectWebsite._Default
Login3662 fieldsLaboratory.Account.Login
Register3662 fieldsLaboratory.Account.Register
Default3621 fieldLaboratory.Default
Modules3621 fieldLaboratory.Modules
ChangePassword3621 fieldLaboratory.Account.ChangePassword
MConverter3621 fieldLaboratory.Module.MConverter
About3580 fieldLaboratory.About
ChangePasswordSuccess3580 fieldLaboratory.Account.ChangePasswordSuccess
Form13194 fieldsB_Geometry.Form1
App1121 fieldRubyInt.App
MainWindow11219 fieldsRubyInt.MainWindow
App1110 fieldInteractive_Mathematics.App
Global1090 fieldLaboratory.Global
_Default+<>c__DisplayClass1f7013 fieldsProjectWebsite._Default+< >c__DisplayClass1f

Statistics

Stat   Size of instance   InstanceFields
Sum:13 1360
Average:355.030
Minimum:700
Maximum:4910
Standard deviation:106.880
Variance:11 4230
warning    Rule warning: Don't use obsolete types, methods or fields
// <Name>Don't use obsolete types, methods or fields</Name>   
warnif count > 0
let obsoleteTypes = Types.Where(t => t.IsObsolete)
let obsoleteMethods = Methods.Where(m => m.IsObsolete).ToHashSet()
let obsoleteFields = Fields.Where(f => f.IsObsolete)

from m in JustMyCode.Methods.UsingAny(obsoleteTypes).Union(
          
JustMyCode.Methods.UsingAny(obsoleteMethods)).Union(
          
JustMyCode.Methods.UsingAny(obsoleteFields))
let obsoleteTypesUsed = obsoleteTypes.UsedBy(m)

// Optimization: MethodsCalled + Intersect() is faster than using obsoleteMethods.UsedBy()
let obsoleteMethodsUsed = m.MethodsCalled.Intersect(obsoleteMethods)
let obsoleteFieldsUsed = obsoleteFields.UsedBy(m)
select new { m, obsoleteTypesUsed, obsoleteMethodsUsed, obsoleteFieldsUsed }

62 methods matched

methodsobsoleteTypesUsedobsoleteMethodsUsedobsoleteFieldsUsedFull Name
SolveQuadraticEquation_Click(Object ,EventArgs)1 type1 method0 fieldLaboratory.Module.EquationSolver .SolveQuadraticEquation_Click(Object ,EventArgs)
AreApproximatelyEqual(ComplexNumber ,ComplexNumber)1 type0 method0 fieldMathosTest.TestofcomplexNumbers .AreApproximatelyEqual(ComplexNumber ,ComplexNumber)
ComplexNumberConstructorsWithNonZeroValu edParameters()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithNonZeroVal uedParameters()
ComplexNumberConstructorsWithZeroValuedP arameters()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithZeroValued Parameters()
TestEqualityOfComplexNos()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestEqualityOfComplexNos()
TestAdditionOfComplexNos()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestAdditionOfComplexNos()
TestSubtractionOfComplexNos()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestSubtractionOfComplexNos()
TestMultiplicationOfComplexNos()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestMultiplicationOfComplexNos()
TestComplexNosToString()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestComplexNosToString()
TestComplexFractionFromString()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestComplexFractionFromString()
TestComplexNumberOperationSqrt()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestComplexNumberOperationSqrt()
TestPolar()1 type0 method0 fieldMathosTest.TestofcomplexNumbers .TestPolar()
TestLog()1 type0 method0 fieldMathosTest.TestofcomplexNumbers.TestLog( )
TestExp()1 type0 method0 fieldMathosTest.TestofcomplexNumbers.TestExp( )
TestPow()1 type0 method0 fieldMathosTest.TestofcomplexNumbers.TestPow( )
QuadraticEquationTest()1 type1 method0 fieldMathosTest.EquationSolverTest .QuadraticEquationTest()
QuadraticEquation(Double,Double,Double)1 type0 method0 fieldMathos.EquationSolver.QuadraticEquation (Double,Double,Double)
QuadraticEquation(ComplexNumber ,ComplexNumber,ComplexNumber)1 type0 method0 fieldMathos.EquationSolver.QuadraticEquation (ComplexNumber,ComplexNumber ,ComplexNumber)
get_realPart()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_realPart()
set_realPart(Double)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.set_realPart(Double)
get_imaginaryPart()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_imaginaryPart()
set_imaginaryPart(Double)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.set_imaginaryPart(Double)
get_Modulus()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_Modulus()
get_Argument()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_Argument()
get_IsReal()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_IsReal()
get_IsPureImaginary()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_IsPureImaginary()
get_Conjugate()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_Conjugate()
.ctor(Int64)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Int64)
.ctor(Decimal)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Decimal)
.ctor(Double)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Double)
.ctor(Int32,Int32)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Int32,Int32)
.ctor(Decimal,Decimal)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Decimal,Decimal)
.ctor(Double,Double)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Double,Double)
.ctor(Fraction,Fraction)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Fraction,Fraction)
.ctor(String)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(String)
.ctor(Complex)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber..ctor(Complex)
op_Implicit(String)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(String)
op_Implicit(Int16)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Int16)
op_Implicit(Int32)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Int32)
op_Implicit(Int64)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Int64)
op_Implicit(Double)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Double)
op_Implicit(Decimal)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Decimal)
op_Implicit(Complex)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Implicit(Complex)
ToString()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.ToString()
Equals(Object)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.Equals(Object)
op_Equality(ComplexNumber,ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Equality(ComplexNumber ,ComplexNumber)
op_Inequality(ComplexNumber ,ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Inequality (ComplexNumber,ComplexNumber)
op_Addition(ComplexNumber,ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Addition(ComplexNumber ,ComplexNumber)
op_Subtraction(ComplexNumber ,ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Subtraction (ComplexNumber,ComplexNumber)
op_Multiply(ComplexNumber,ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Multiply(ComplexNumber ,ComplexNumber)
op_Division(ComplexNumber,ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.op_Division(ComplexNumber ,ComplexNumber)
FromPolar(Double,Double)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.FromPolar(Double,Double)
get_I()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_I()
get_One()1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexNumber.get_One()
AbsSquared(ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.AbsSquared (ComplexNumber)
LogOfAbs(ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.LogOfAbs(ComplexNumber )
Sqrt(Double)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.Sqrt(Double)
Sqrt(ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.Sqrt(ComplexNumber)
Log(ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.Log(ComplexNumber)
Exp(ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.Exp(ComplexNumber)
Pow(ComplexNumber,ComplexNumber)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.Pow(ComplexNumber ,ComplexNumber)
Roots(ComplexNumber,Int32)1 type0 method0 fieldMathos.Arithmetic.ComplexNumbers .ComplexOperation.Roots(ComplexNumber ,Int32)

Statistics

Stat   obsoleteTypesUsed   obsoleteMethodsUsed   obsoleteFieldsUsed
Sum:000
Average:000
Minimum:000
Maximum:000
Standard deviation:000
Variance:000
warning    Rule warning: Don't forget to implement methods that throw NotImplementedException
// <Name>Don't forget to implement methods that throw NotImplementedException</Name>
warnif count > 0
from m in Application.Methods
where m.CreateA("System.NotImplementedException".AllowNoMatch())
select m

21 methods matched

methodsFull Name
Log(Complex)Mathos.Calculus.Elementary.Log(Complex)
Exp(Complex)Mathos.Calculus.Elementary.Exp(Complex)
Erfi(Complex)Mathos.SpecialFunctions.Antiderivatives .Erfi(Complex)
Airy(Double)Mathos.SpecialFunctions.Bessel.Airy (Double)
BesselJ(Double,Double)Mathos.SpecialFunctions.Bessel.BesselJ (Double,Double)
BesselJ(Double,Int32)Mathos.SpecialFunctions.Bessel.BesselJ (Double,Int32)
BesselY(Double,Double)Mathos.SpecialFunctions.Bessel.BesselY (Double,Double)
BesselY(Double,Int32)Mathos.SpecialFunctions.Bessel.BesselY (Double,Int32)
BesselI(Double,Double)Mathos.SpecialFunctions.Bessel.BesselI (Double,Double)
BesselK(Double,Double)Mathos.SpecialFunctions.Bessel.BesselK (Double,Double)
Hankel1(Double,Double)Mathos.SpecialFunctions.Bessel.Hankel1 (Double,Double)
Hankel2(Double,Double)Mathos.SpecialFunctions.Bessel.Hankel2 (Double,Double)
EllipticF(Double,Double)Mathos.SpecialFunctions.Elliptic .EllipticF(Double,Double)
EllipticE(Double,Double)Mathos.SpecialFunctions.Elliptic .EllipticE(Double,Double)
EllipticPi(Double,Double)Mathos.SpecialFunctions.Elliptic .EllipticPi(Double,Double)
EllipticK(Double)Mathos.SpecialFunctions.Elliptic .EllipticK(Double)
EllipticE(Double)Mathos.SpecialFunctions.Elliptic .EllipticE(Double)
EllipticPi(Int32,Double)Mathos.SpecialFunctions.Elliptic .EllipticPi(Int32,Double)
Sn(Double,Double)Mathos.SpecialFunctions.Elliptic.Sn (Double,Double)
Cn(Double,Double)Mathos.SpecialFunctions.Elliptic.Cn (Double,Double)
Dn(Double,Double)Mathos.SpecialFunctions.Elliptic.Dn (Double,Double)

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:

720
Architecture and Layering  

warning    Rule warning: Avoid namespaces dependency cycles
// <Name>Avoid namespaces dependency cycles</Name>
warnif count > 0
// This query lists all application namespace dependency cycles.
// Each row shows a different cycle, prefixed with a namespace entangled in the cycle.
//
// To browse a cycle on the dependency graph or the dependency matrix, right click
// a cycle cell and export the matched namespaces to the dependency graph or matrix!
//
// In the matrix, dependency cycles are represented with red squares and black cells.
// To easily browse dependency cycles, the Matrix comes with an option:
//   --> Display Direct and Indirect Dependencies
//
// Read our white books relative to partitioning code, 
// to know more about namespaces dependency cycles, and why avoiding them 
// is a simple but efficient solution to architecture for your code base.
// http://www.ndepend.com/WhiteBooks.aspx


// Optimization: restraint application assemblies set
// If some namespaces are mutually dependent
//  - They must be declared in the same assembly
//  - The parent assembly must ContainsNamespaceDependencyCycle
from assembly in Application.Assemblies
                 
.Where(a => a.ContainsNamespaceDependencyCycle != null && 
                             
a.ContainsNamespaceDependencyCycle.Value)

// Optimization: restraint namespaces set
// A namespace involved in a cycle necessarily have a null Level.
let namespacesSuspect = assembly.ChildNamespaces.Where(n => n.Level == null)

// hashset is used to avoid iterating again on namespaces already caught in a cycle.
let hashset = new HashSet<INamespace>()


from suspect in namespacesSuspect
   
// By commenting in this line, the query matches all namespaces involved in a cycle.
   where !hashset.Contains(suspect)

   
// Define 2 code metrics
   // - Namespaces depth of is using indirectly the suspect namespace.
   // - Namespaces depth of is used by the suspect namespace indirectly.
   // Note: for direct usage the depth is equal to 1.
   let namespacesUserDepth = namespacesSuspect.DepthOfIsUsing(suspect)
   
let namespacesUsedDepth = namespacesSuspect.DepthOfIsUsedBy(suspect)

   
// Select namespaces that are both using and used by namespaceSuspect
   let usersAndUsed = from n in namespacesSuspect where 
                         
namespacesUserDepth[n] > 0 && 
                         
namespacesUsedDepth[n] > 0 
                      
select n

   
where usersAndUsed.Count() > 0

   
// Here we've found namespace(s) both using and used by the suspect namespace.
   // A cycle involving the suspect namespace is found!
   let cycle = usersAndUsed.Append(suspect)

   
// Fill hashset with namespaces in the cycle.
   // .ToArray() is needed to force the iterating process.
   let unused1 = (from n in cycle let unused2 = hashset.Add(n) select n).ToArray()

select new { suspect, cycle }

1 namespaces matched

namespacecycleFull Name
Mathos4 namespacesMathos

Statistics

Stat   cycle
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Assemblies with poor cohesion (RelationalCohesion)
// <Name>Assemblies with poor cohesion (RelationalCohesion)</Name>
warnif count > 0 from a in Application.Assemblies where 
  
a.NbTypes > 20 && // Relational Cohesion metrics is relevant only if there are several types 
  (a.RelationalCohesion < 1.5 || 
   
a.RelationalCohesion > 4.0)
select new { a, a.NbTypes, a.RelationalCohesion }

// 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

3 assemblies matched

assemblies# TypesRelational cohesionFull Name
Laboratory280.11Laboratory
MathosTest310.16MathosTest
Mathos1001.11Mathos

Statistics

Stat   # Types   Relational cohesion
Sum:1591.38
Average:530.46
Minimum:280.11
Maximum:1001.11
Standard deviation:33.260.46
Variance:1 1060.21

202
Dead Code  

warningCritical    Critical Rule warning: Potentially dead Methods
// <Name>Potentially dead Methods</Name>
warnif count > 0
// Filter procedure for methods that should'nt be considered as dead
let canMethodBeConsideredAsDeadProc = new Func<IMethod, bool>(
    
m => !m.IsPubliclyVisible &&       // Public methods might be used by client applications of your assemblies.
         !m.IsEntryPoint &&            // Main() method is not used by-design.
         !m.IsExplicitInterfaceImpl && // The IL code never explicitely calls explicit interface methods implementation.
         !m.IsClassConstructor &&      // The IL code never explicitely calls class constructors.
         !m.IsFinalizer &&             // The IL code never explicitely calls finalizers.
         !m.IsVirtual &&               // Only check for non virtual method that are not seen as used in IL.
         !(m.IsConstructor &&          // Don't take account of protected ctor that might be call by a derived ctors.
           m.IsProtected) &&
         
!m.IsEventAdder &&            // The IL code never explicitely calls events adder/remover.
         !m.IsEventRemover &&
         
!m.IsGeneratedByCompiler &&
         
!m.ParentType.IsDelegate &&

         
// Methods tagged with these two attributes are called by the serialization infrastructure.
         !m.HasAttribute("System.Runtime.Serialization.OnSerializingAttribute".AllowNoMatch()) &&
         
!m.HasAttribute("System.Runtime.Serialization.OnDeserializedAttribute".AllowNoMatch()) &&

         
// If you don't want to link NDepend.API.dll, you can use your own IsNotDeadCodeAttribute and adapt this rule.
         !m.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()))

// Get methods unused
let methodsUnused = 
   
from m in JustMyCode.Methods where 
   
m.NbMethodsCallingMe == 0 && 
   
canMethodBeConsideredAsDeadProc(m)
   
select m

// Dead methods = methods used only by unused methods (recursive)
let deadMethodsMetric = methodsUnused.FillIterative(
   
methods => // Unique loop, just to let a chance to build the hashset.
              from o in (new object()).ToEnumerable()
              
// Use a hashet to make Intersect calls much faster!
              let hashset = methods.ToHashSet()
              
from m in codeBase.Application.Methods.UsedByAny(methods).Except(methods)
              
where canMethodBeConsideredAsDeadProc(m) &&
                    
// Select methods called only by methods already considered as dead
                    hashset.Intersect(m.MethodsCallingMe).Count() == m.NbMethodsCallingMe
              
select m)

from m in JustMyCode.Methods.Intersect(deadMethodsMetric.DefinitionDomain)
select new { m, m.MethodsCallingMe, depth = deadMethodsMetric[m] }

14 methods matched

methodsMethodsCallingMedepthFull Name
Application_Start(Object,EventArgs)0 method0Laboratory.Global.Application_Start (Object,EventArgs)
Application_End(Object,EventArgs)0 method0Laboratory.Global.Application_End(Object ,EventArgs)
Application_Error(Object,EventArgs)0 method0Laboratory.Global.Application_Error (Object,EventArgs)
Session_Start(Object,EventArgs)0 method0Laboratory.Global.Session_Start(Object ,EventArgs)
Session_End(Object,EventArgs)0 method0Laboratory.Global.Session_End(Object ,EventArgs)
IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)0 method0Laboratory.Module.IntegralApproximation .IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)
IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)0 method0Laboratory.Module.IntegralApproximation .IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)
IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)0 method0Laboratory.Module.IntegralApproximation .IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)
.ctor()0 method0B_Geometry.GeomUtils..ctor()
.ctor()0 method0MathosTest.Statistics+Literals..ctor()
AreApproximatelyEqual(Complex,Complex)0 method0MathosTest.Mathos_Main.SpecialFunctions .ElementaryTests.AreApproximatelyEqual (Complex,Complex)
IsApproximatelyZero(Double)0 method0MathosTest.Mathos_Main.SpecialFunctions .GammaTests.IsApproximatelyZero(Double)
Button_MouseEnter(Object,MouseEventArgs)0 method0RubyInt.HelpWindow.Button_MouseEnter (Object,MouseEventArgs)
IsTriangle(Double,Double,Double)0 method0Mathos.Geometry.Shapes.Triangle .IsTriangle(Double,Double,Double)

Statistics

Stat   MethodsCallingMe   depth
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Critical Rule warning: Potentially dead Fields
// <Name>Potentially dead Fields</Name>
warnif count > 0
from f in JustMyCode.Fields where
   
f.NbMethodsUsingMe == 0 && 
   
!f.IsPublic &&     // Although not recommended, public fields might be used by client applications of your assemblies.
   !f.IsLiteral &&    // The IL code never explicitely uses literal fields.
   !f.IsEnumValue &&  // The IL code never explicitely uses enumeration value.
   f.Name !=  "value__"  && // Field named 'value__' are relative to enumerations and the IL code never explicitely uses them.
   !f.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&
   
!f.IsGeneratedByCompiler
   
// If you don't want to link NDepend.API.dll, you can use your own IsNotDeadCodeAttribute and adapt this rule.
select f

38 fields matched

fieldsFull Name
HyperLink1Laboratory.Default.HyperLink1
Table1Laboratory.Modules.Table1
HeadContentLaboratory.SiteMaster.HeadContent
NavigationMenuLaboratory.SiteMaster.NavigationMenu
MainContentLaboratory.SiteMaster.MainContent
ChangeUserPasswordLaboratory.Account.ChangePassword .ChangeUserPassword
LoginUserLaboratory.Account.Login.LoginUser
RegisterUserWizardStepLaboratory.Account.Register .RegisterUserWizardStep
Panel1Laboratory.Module.Converter.Panel1
CalculateButtonLaboratory.Module.Converter .CalculateButton
ErrorLabelLaboratory.Module.Converter.ErrorLabel
SolveSystemOfTwoEquationLaboratory.Module.EquationSolver .SolveSystemOfTwoEquation
SolveQuadraticEquationLaboratory.Module.EquationSolver .SolveQuadraticEquation
CalculateButtonLaboratory.Module.Factorial .CalculateButton
Label1Laboratory.Module.IntegralApproximation .Label1
Label2Laboratory.Module.IntegralApproximation .Label2
CalculateButtonLaboratory.Module.IntegralApproximation .CalculateButton
Label3Laboratory.Module.IntegralApproximation .Label3
Label4Laboratory.Module.IntegralApproximation .Label4
Label5Laboratory.Module.IntegralApproximation .Label5
returnvalueLaboratory.Module.MConverter.returnvalue
CalculateButtonLaboratory.Module.NumberChecker .CalculateButton
ErrorLabelLaboratory.Module.NumberChecker .ErrorLabel
CalculateButtonLaboratory.Module.Triangle .CalculateButton
CalculateButtonLaboratory.Module.Uncertainty .CalculateButton
ErrorLabelLaboratory.Module.Uncertainty.ErrorLabel
Button1Laboratory.Module.DataAnalysis .LinearRegression.Button1
FindNthTermLaboratory.Module.DataAnalysis.WebForm1 .FindNthTerm
Button1Laboratory.Module.DataAnalysis.WebForm1 .Button1
CalculateButtonLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceFutureValue.CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceNetPresentValue.CalculateButton
CalculateButtonLaboratory.Module.Finance .FinancePresentValue.CalculateButton
CalculateButtonLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .CalculateButton
CalcProjectWebsite._Default.Calc

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:

380
Visibility  

warning    Rule warning: Methods that could have a lower visibility
// <Name>Methods that could have a lower visibility</Name>
// This rule tells which methods can be declared with a lower visibility.
// (like 'private' is a visibility lower than 'internal' which is lower than 'public').
// Reducing visibility is a good practice because this fosters encapsulation
// and with it maintainability and extensibility.
        
warnif count > 0 from m in JustMyCode.Methods where 
  
m.Visibility != m.OptimalVisibility &&
  
!m.HasAttribute("NDepend.Attributes.CannotDecreaseVisibilityAttribute".AllowNoMatch()) &&
  
!m.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&
  
// If you don't want to link NDepend.API.dll, you can use your own attributes and adapt this rule.
  
  
// Eliminate default constructor from the result.
  // Whatever the visibility of the declaring class,
  // default constructors are public and introduce noise
  // in the current rule.
  !( m.IsConstructor && m.IsPublic && m.NbParameters == 0) &&

  
// Don't decrease the visibility of Main() methods.
  !m.IsEntryPoint

select new { m, 
             
m.Visibility , 
             
CouldBeDeclared = m.OptimalVisibility,
             
m.MethodsCallingMe }

586 methods matched

methodsVisibilityCouldBeDeclaredMethodsCallingMeFull Name
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.About.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Default.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Modules.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.SiteMaster.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Account.ChangePassword .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Account.ChangePasswordSuccess .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Account.Login.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Account.Register.Page_Load (Object,EventArgs)
RegisterUser_CreatedUser(Object ,EventArgs)ProtectedPrivate0 methodLaboratory.Account.Register .RegisterUser_CreatedUser(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Converter.Page_Load (Object,EventArgs)
DropDownList1_SelectedIndexChanged (Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Converter .DropDownList1_SelectedIndexChanged (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Converter .CalculateButton_Click(Object,EventArgs)
SetValues(Int32)ProtectedPrivate2 methodsLaboratory.Module.Converter.SetValues (Int32)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.EquationSolver .Page_Load(Object,EventArgs)
SolveSystemOfTwoEquation_Click(Object ,EventArgs)ProtectedPrivate0 methodLaboratory.Module.EquationSolver .SolveSystemOfTwoEquation_Click(Object ,EventArgs)
SolveQuadraticEquation_Click(Object ,EventArgs)ProtectedPrivate0 methodLaboratory.Module.EquationSolver .SolveQuadraticEquation_Click(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Factorial.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Factorial .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.MConverter.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.NumberChecker .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.NumberChecker .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Triangle.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Triangle .CalculateButton_Click(Object,EventArgs)
ToDoubleC(String)ProtectedPrivate1 methodLaboratory.Module.Triangle.ToDoubleC (String)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Uncertainty.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Uncertainty .CalculateButton_Click(Object,EventArgs)
func(Decimal)PublicPrivate1 methodLaboratory.Module.Uncertainty.func (Decimal)
pow(Decimal,Decimal)PublicPrivate1 methodLaboratory.Module.Uncertainty.pow (Decimal,Decimal)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.DataAnalysis .LinearRegression.Page_Load(Object ,EventArgs)
Button1_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.DataAnalysis .LinearRegression.Button1_Click(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.DataAnalysis.WebForm1 .Page_Load(Object,EventArgs)
FindNthTerm_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.DataAnalysis.WebForm1 .FindNthTerm_Click(Object,EventArgs)
Button1_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.DataAnalysis.WebForm1 .Button1_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceFutureValue.Page_Load(Object ,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceFutureValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceNetPresentValue.Page_Load(Object ,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceNetPresentValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinancePresentValue.Page_Load(Object ,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinancePresentValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedPrivate0 methodLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .CalculateButton_Click(Object,EventArgs)
.ctor(List<Int32>,List<Double>)PublicPrivate0 methodB_Geometry.BasisFunction..ctor(List <Int32>,List<Double>)
.ctor(List<Double>)PublicInternal1 methodB_Geometry.BasisFunction..ctor(List <Double>)
.ctor(Double[])PublicInternal1 methodB_Geometry.BasisFunction..ctor(Double[])
ExpandKnots()PublicPrivate2 methodsB_Geometry.BasisFunction.ExpandKnots()
Evaluate(Int32,Int32,Double)PublicInternal2 methodsB_Geometry.BasisFunction.Evaluate(Int32 ,Int32,Double)
GetNKnots()PublicInternal2 methodsB_Geometry.BasisFunction.GetNKnots()
.ctor(Int32,List<Vector>,BasisFunction)PublicInternal1 methodB_Geometry.BCurve..ctor(Int32,List <Vector>,BasisFunction)
.ctor(Int32,Vector[],BasisFunction)PublicInternal1 methodB_Geometry.BCurve..ctor(Int32,Vector[] ,BasisFunction)
Evaluate(Double)PublicInternal2 methodsB_Geometry.BCurve.Evaluate(Double)
GetControlPoints()PublicPrivate0 methodB_Geometry.BCurve.GetControlPoints()
getElement(Int32,Int32)PublicInternal6 methodsB_Geometry.BGeomMatrix.getElement(Int32 ,Int32)
setElement(Int32,Int32,Double)PublicPrivate4 methodsB_Geometry.BGeomMatrix.setElement(Int32 ,Int32,Double)
.ctor(List<List<Double>>)PublicInternal2 methodsB_Geometry.BGeomMatrix..ctor(List<List <Double>>)
.ctor(Double[][])PublicInternal1 methodB_Geometry.BGeomMatrix..ctor(Double[][])
.ctor(Int32,Int32,Double[])PublicPrivate0 methodB_Geometry.BGeomMatrix..ctor(Int32,Int32 ,Double[])
GetRow(Int32)PublicInternal2 methodsB_Geometry.BGeomMatrix.GetRow(Int32)
GetColumn(Int32)PublicPrivate0 methodB_Geometry.BGeomMatrix.GetColumn(Int32)
GetNRows()PublicInternal1 methodB_Geometry.BGeomMatrix.GetNRows()
GetNColumns()PublicInternal1 methodB_Geometry.BGeomMatrix.GetNColumns()
FindPivot(Int32&)PublicPrivate0 methodB_Geometry.BGeomMatrix.FindPivot(Int32&)
FindPivot(Int32,Int32&,Double&)PublicPrivate0 methodB_Geometry.BGeomMatrix.FindPivot(Int32 ,Int32&,Double&)
DivideRowByScalar(Int32,Double)PublicPrivate0 methodB_Geometry.BGeomMatrix.DivideRowByScalar (Int32,Double)
RowSubtraction(Int32,Int32,Double)PublicPrivate0 methodB_Geometry.BGeomMatrix.RowSubtraction (Int32,Int32,Double)
ReplaceRow(Int32,Vector)PublicInternal2 methodsB_Geometry.BGeomMatrix.ReplaceRow(Int32 ,Vector)
glControl_Resize(Object,EventArgs)PublicPrivate2 methodsB_Geometry.Form1.glControl_Resize(Object ,EventArgs)
.ctor(Double,Double,Double,Double,Double ,Double)PublicPrivate0 methodB_Geometry.GeomBox..ctor(Double,Double ,Double,Double,Double,Double)
CentripetalMethod_createSplineByInterpol ation(Int32,Vector[],BCurve&)PublicInternal1 methodB_Geometry.GeomUtils .CentripetalMethod_createSplineByInterpo lation(Int32,Vector[],BCurve&)
GaussianElimination(BGeomMatrix,Vector ,Double[]&)PublicInternal2 methodsB_Geometry.LinearAlgebra .GaussianElimination(BGeomMatrix,Vector ,Double[]&)
EqualWithinTol(Double,Double)PublicInternal6 methodsB_Geometry.TolerantUtilities .EqualWithinTol(Double,Double)
GetTolerance()PublicInternal1 methodB_Geometry.TolerantUtilities .GetTolerance()
.ctor(Int32)PublicInternal2 methodsB_Geometry.Vector..ctor(Int32)
.ctor(Double[])PublicInternal4 methodsB_Geometry.Vector..ctor(Double[])
get_Elements()PublicInternal10 methodsB_Geometry.Vector.get_Elements()
set_Elements(Double[])PublicPrivate0 methodB_Geometry.Vector.set_Elements(Double[])
.ctor(List<Double>)PublicPrivate3 methodsB_Geometry.Vector..ctor(List<Double>)
VectorDimension()PublicInternal10 methodsB_Geometry.Vector.VectorDimension()
ScalarProduct(Double,Vector)PublicInternal1 methodB_Geometry.Vector.ScalarProduct(Double ,Vector)
ScalarProduct(Double)PublicInternal2 methodsB_Geometry.Vector.ScalarProduct(Double)
Subtract(Vector,Vector)PublicPrivate0 methodB_Geometry.Vector.Subtract(Vector,Vector )
Subtract(Vector)PublicInternal1 methodB_Geometry.Vector.Subtract(Vector)
DotProduct(Vector)PublicPrivate1 methodB_Geometry.Vector.DotProduct(Vector)
GetLength()PublicInternal1 methodB_Geometry.Vector.GetLength()
ComplexNumberConstructorsWithNonZeroValu edParameters()PublicPrivate0 methodMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithNonZeroVal uedParameters()
ComplexNumberConstructorsWithZeroValuedP arameters()PublicPrivate0 methodMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithZeroValued Parameters()
TestEqualityOfComplexNos()PublicPrivate0 methodMathosTest.TestofcomplexNumbers .TestEqualityOfComplexNos()
TestAdditionOfComplexNos()PublicPrivate0 methodMathosTest.TestofcomplexNumbers .TestAdditionOfComplexNos()
TestSubtractionOfComplexNos()PublicPrivate0 methodMathosTest.TestofcomplexNumbers .TestSubtractionOfComplexNos()
TestMultiplicationOfComplexNos()PublicPrivate0 methodMathosTest.TestofcomplexNumbers .TestMultiplicationOfComplexNos()
TestComplexNosToString()PublicPrivate0 methodMathosTest.TestofcomplexNumbers .TestComplexNosToString()

Statistics

Stat   Visibility   CouldBeDeclared   MethodsCallingMe
Sum:000
Average:000
Minimum:000
Maximum:000
Standard deviation:000
Variance:000
warning    Rule warning: Types that could have a lower visibility
// <Name>Types that could have a lower visibility</Name>
// This rule tells which types can be declared with a lower visibility.
// (like 'private' is a visibility lower than 'internal' which is lower than 'public').
// Reducing visibility is a good practice because this fosters encapsulation
// and with it maintainability and extensibility.
        
warnif count > 0 from t in JustMyCode.Types where 

  
t.Visibility != t.OptimalVisibility &&

  
// If you don't want to link NDepend.API.dll, you can use your own attributes and adapt this rule.
 !t.HasAttribute("NDepend.Attributes.CannotDecreaseVisibilityAttribute".AllowNoMatch()) &&
 
!t.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&

  
// Static types that define only const fields cannot be seen as used in IL code.
  // They don't have to be tagged with CannotDecreaseVisibilityAttribute.
  !( t.IsStatic && 
    
!t.Methods.Any(m => !m.IsClassConstructor) && 
    
!t.Fields.Any(f => !f.IsLiteral && !(f.IsStatic && f.IsInitOnly))) &&

  
// A type used by an interface that has the same visibility
  // cannot have its visibility decreased, else a compilation error occurs!
  !t.TypesUsingMe.Any(tUser => 
        
tUser.IsInterface && 
        
tUser.Visibility == t.Visibility)

select new { t, t.Visibility , 
                
CouldBeDeclared = t.OptimalVisibility, 
                
t.TypesUsingMe }

90 types matched

typesVisibilityCouldBeDeclaredTypesUsingMeFull Name
AboutPublicInternal0 typeLaboratory.About
DefaultPublicInternal0 typeLaboratory.Default
GlobalPublicInternal0 typeLaboratory.Global
ModulesPublicInternal0 typeLaboratory.Modules
SiteMasterPublicInternal0 typeLaboratory.SiteMaster
ChangePasswordPublicInternal0 typeLaboratory.Account.ChangePassword
ChangePasswordSuccessPublicInternal0 typeLaboratory.Account.ChangePasswordSuccess
LoginPublicInternal0 typeLaboratory.Account.Login
RegisterPublicInternal0 typeLaboratory.Account.Register
ConverterPublicInternal0 typeLaboratory.Module.Converter
EquationSolverPublicInternal0 typeLaboratory.Module.EquationSolver
FactorialPublicInternal0 typeLaboratory.Module.Factorial
IntegralApproximationPublicInternal1 typeLaboratory.Module.IntegralApproximation
MConverterPublicInternal0 typeLaboratory.Module.MConverter
NumberCheckerPublicInternal0 typeLaboratory.Module.NumberChecker
TrianglePublicInternal0 typeLaboratory.Module.Triangle
UncertaintyPublicInternal0 typeLaboratory.Module.Uncertainty
LinearRegressionPublicInternal0 typeLaboratory.Module.DataAnalysis .LinearRegression
WebForm1PublicInternal0 typeLaboratory.Module.DataAnalysis.WebForm1
FinanceAnnuityPaymentFutureValuePublicInternal0 typeLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue
FinanceAnnuityPaymentPresentValuePublicInternal0 typeLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue
FinanceFutureValuePublicInternal0 typeLaboratory.Module.Finance .FinanceFutureValue
FinanceFutureValueOfAnAnnuityPublicInternal0 typeLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity
FinanceNetPresentValuePublicInternal0 typeLaboratory.Module.Finance .FinanceNetPresentValue
FinancePresentValuePublicInternal0 typeLaboratory.Module.Finance .FinancePresentValue
FinancePresentValueOfAnAnnuityPublicInternal0 typeLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity
FinanceRemainingBalanceOfAnnuityPublicInternal0 typeLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity
BasisFunctionPublicInternal3 typesB_Geometry.BasisFunction
BCurvePublicInternal2 typesB_Geometry.BCurve
BGeomMatrixPublicInternal3 typesB_Geometry.BGeomMatrix
Form1PublicInternal0 typeB_Geometry.Form1
GeomBoxPublicInternal0 typeB_Geometry.GeomBox
GeometryVisUtilsPublicInternal0 typeB_Geometry.GeometryVisUtils
LinearAlgebraPublicInternal2 typesB_Geometry.LinearAlgebra
TolerantUtilitiesPublicInternal5 typesB_Geometry.TolerantUtilities
VectorPublicInternal5 typesB_Geometry.Vector
ProgramPublicInternal1 typeB_Geometry.New.Program
TestofcomplexNumbersPublicInternal0 typeMathosTest.TestofcomplexNumbers
PreCalculusPublicInternal0 typeMathosTest.PreCalculus
DiceSimulatorTestPublicInternal0 typeMathosTest.DiceSimulatorTest
DiscreteMathematicsPublicInternal0 typeMathosTest.DiscreteMathematics
coordinateStructPublicInternal0 typeMathosTest.coordinateStruct
EquationSolverTestPublicInternal0 typeMathosTest.EquationSolverTest
FinanceTestPublicInternal0 typeMathosTest.FinanceTest
LinearModelsTestPublicInternal0 typeMathosTest.LinearModelsTest
PythagoreanTestPublicInternal0 typeMathosTest.PythagoreanTest
ShapesPublicInternal0 typeMathosTest.Shapes
ConverterTestPublicInternal0 typeMathosTest.ConverterTest
VectorsAndMatricesPublicInternal0 typeMathosTest.VectorsAndMatrices
TestOfFractionsPublicInternal0 typeMathosTest.TestOfFractions
StatisticsPublicInternal0 typeMathosTest.Statistics
CalculusTestPublicInternal0 typeMathosTest.Calculus.CalculusTest
UnitTest1PublicInternal0 typeMathosTest.SpecialFunctions.UnitTest1
UncertaintyPublicInternal0 typeMathosTest.Uncertainty.Uncertainty
StatisticalDistributionsPublicInternal0 typeMathosTest.Mathos_Main .StatisticalDistributions
SyntaxTestPublicInternal0 typeMathosTest.Mathos_Main.SyntaxTest
ComplexArithmeticTestPublicInternal0 typeMathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest
DoubleArthimeticTestPublicInternal0 typeMathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegerArthimeticTestPublicInternal0 typeMathosTest.Mathos_Main.Arithmetic .IntegerArthimeticTest
SingleArthimeticTestPublicInternal0 typeMathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest
DecimalArithmeticPublicInternal0 typeMathosTest.Mathos_Main.Arithmetic .DecimalArithmetic
FiniteCalculusTestPublicInternal0 typeMathosTest.Mathos_Main.Calculus .FiniteCalculusTest
ElementaryTestsPublicInternal0 typeMathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
GammaTestsPublicInternal0 typeMathosTest.Mathos_Main.SpecialFunctions .GammaTests
HelpWindowPublicInternal1 typeRubyInt.HelpWindow
ResultsWindowPublicInternal1 typeRubyInt.ResultsWindow
AppPublicInternal0 typeRubyInt.App
DataViewWindowPublicInternal1 typeRubyInt.DataViewWindow
ExtensionPublicInternal2 typesRubyInt.Extension
MainWindowPublicInternal5 typesRubyInt.MainWindow
MyCompletionDataPublicInternal1 typeRubyInt.MyCompletionData
_DefaultPublicInternal1 typeProjectWebsite._Default
FrmTablePublicInternal2 typesInteractive_Mathematics.FrmTable
AppPublicInternal0 typeInteractive_Mathematics.App
MainWindowPublicInternal1 typeInteractive_Mathematics.MainWindow
AngleConversionMPublicInternal0 typeMathos.Converter.AngleConversionM
TemperatureConversionPublicInternal1 typeMathos.Converter.TemperatureConversion
BesselPublicInternal0 typeMathos.SpecialFunctions.Bessel
EllipticPublicInternal0 typeMathos.SpecialFunctions.Elliptic
NumberListPublicInternal0 typeMathos.Statistics.NumberList
DenominatorNullExceptionPublicInternal1 typeMathos.Exceptions .DenominatorNullException
InvalidCoordinateFormatPublicInternal1 typeMathos.Exceptions .InvalidCoordinateFormat
InvalidFractionFormatExceptionPublicInternal1 typeMathos.Exceptions .InvalidFractionFormatException
InvalidTriangleExceptionPublicInternal1 typeMathos.Exceptions .InvalidTriangleException
IComplexPublicInternal0 typeMathos.Arithmetic.Numbers.IComplex
IShape2DPublicInternal9 typesMathos.Geometry.Shapes.IShape2D
EllipsePublicInternal0 typeMathos.Geometry.Shapes.Ellipse
RingPublicInternal0 typeMathos.Geometry.Shapes.Ring
IShape3DPublicInternal7 typesMathos.Geometry.Shapes.IShape3D
TorusPublicInternal0 typeMathos.Geometry.Shapes.Torus

Statistics

Stat   Visibility   CouldBeDeclared   TypesUsingMe
Sum:000
Average:000
Minimum:000
Maximum:000
Standard deviation:000
Variance:000
warning    Rule warning: Fields that could have a lower visibility
// <Name>Fields that could have a lower visibility</Name>
// This rule tells which fields can be declared with a lower visibility.
// (like 'private' is a visibility lower than 'internal' which is lower than 'public').
// Reducing visibility is a good practice because this fosters encapsulation
// and with it maintainability and extensibility.
        
warnif count > 0 from f in JustMyCode.Fields where 
  
f.Visibility != f.OptimalVisibility &&
 
!f.HasAttribute("NDepend.Attributes.CannotDecreaseVisibilityAttribute".AllowNoMatch()) &&
 
!f.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch())
  
// If you don't want to link NDepend.API.dll, you can use your own attributes and adapt this rule.
  
select new { f, 
             
f.Visibility , 
             
CouldBeDeclared = f.OptimalVisibility,
             
f.MethodsUsingMe }

181 fields matched

fieldsVisibilityCouldBeDeclaredMethodsUsingMeFull Name
HyperLink1ProtectedPrivate0 methodLaboratory.Default.HyperLink1
Table1ProtectedPrivate0 methodLaboratory.Modules.Table1
HeadContentProtectedPrivate0 methodLaboratory.SiteMaster.HeadContent
NavigationMenuProtectedPrivate0 methodLaboratory.SiteMaster.NavigationMenu
MainContentProtectedPrivate0 methodLaboratory.SiteMaster.MainContent
ChangeUserPasswordProtectedPrivate0 methodLaboratory.Account.ChangePassword .ChangeUserPassword
RegisterHyperLinkProtectedPrivate1 methodLaboratory.Account.Login .RegisterHyperLink
LoginUserProtectedPrivate0 methodLaboratory.Account.Login.LoginUser
RegisterUserProtectedPrivate2 methodsLaboratory.Account.Register.RegisterUser
RegisterUserWizardStepProtectedPrivate0 methodLaboratory.Account.Register .RegisterUserWizardStep
DropDownList1ProtectedPrivate2 methodsLaboratory.Module.Converter .DropDownList1
Panel1ProtectedPrivate0 methodLaboratory.Module.Converter.Panel1
DropDownList2ProtectedPrivate3 methodsLaboratory.Module.Converter .DropDownList2
TextBox1ProtectedPrivate1 methodLaboratory.Module.Converter.TextBox1
DropDownList3ProtectedPrivate2 methodsLaboratory.Module.Converter .DropDownList3
TextBox2ProtectedPrivate1 methodLaboratory.Module.Converter.TextBox2
CalculateButtonProtectedPrivate0 methodLaboratory.Module.Converter .CalculateButton
ErrorLabelProtectedPrivate0 methodLaboratory.Module.Converter.ErrorLabel
ElapsedTimeLabelProtectedPrivate1 methodLaboratory.Module.Converter .ElapsedTimeLabel
TextBox1ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox1
TextBox2ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox2
TextBox3ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox3
TextBox4ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox4
TextBox5ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox5
TextBox6ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox6
SolveSystemOfTwoEquationProtectedPrivate0 methodLaboratory.Module.EquationSolver .SolveSystemOfTwoEquation
EquationErrorLabelProtectedPrivate1 methodLaboratory.Module.EquationSolver .EquationErrorLabel
EquationResultLabelProtectedPrivate1 methodLaboratory.Module.EquationSolver .EquationResultLabel
EquationElapsedTimeLabelProtectedPrivate1 methodLaboratory.Module.EquationSolver .EquationElapsedTimeLabel
TextBox7ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox7
TextBox8ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox8
TextBox9ProtectedPrivate1 methodLaboratory.Module.EquationSolver .TextBox9
SolveQuadraticEquationProtectedPrivate0 methodLaboratory.Module.EquationSolver .SolveQuadraticEquation
QuadraticEquationErrorLabelProtectedPrivate1 methodLaboratory.Module.EquationSolver .QuadraticEquationErrorLabel
QuadraticEquationResultLabelProtectedPrivate1 methodLaboratory.Module.EquationSolver .QuadraticEquationResultLabel
QuadraticEquationElapsedTimeLabelProtectedPrivate1 methodLaboratory.Module.EquationSolver .QuadraticEquationElapsedTimeLabel
NumberTextProtectedPrivate1 methodLaboratory.Module.Factorial.NumberText
CalculateButtonProtectedPrivate0 methodLaboratory.Module.Factorial .CalculateButton
ErrorLabelProtectedPrivate1 methodLaboratory.Module.Factorial.ErrorLabel
ResultTextboxProtectedPrivate1 methodLaboratory.Module.Factorial .ResultTextbox
ElapsedTimeLabelProtectedPrivate1 methodLaboratory.Module.Factorial .ElapsedTimeLabel
Label1ProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .Label1
UpperBoundTextProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .UpperBoundText
LowerBoundTextProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .LowerBoundText
ExpressionTextProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .ExpressionText
Label2ProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .Label2
NumberOfIntervalsTextProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .NumberOfIntervalsText
CalculateButtonProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .CalculateButton
ErrorLabelProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .ErrorLabel
Label3ProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .Label3
RectangleMethodResultLabelProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .RectangleMethodResultLabel
RectangleMethodTimeLabelProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .RectangleMethodTimeLabel
Label4ProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .Label4
TrapezoidalRuleResultLabelProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .TrapezoidalRuleResultLabel
TrapezoidalRuleTimeLabelProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .TrapezoidalRuleTimeLabel
Label5ProtectedPrivate0 methodLaboratory.Module.IntegralApproximation .Label5
SimpsonsRuleResultLabelProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .SimpsonsRuleResultLabel
SimpsonsRuleTimeLabelProtectedPrivate1 methodLaboratory.Module.IntegralApproximation .SimpsonsRuleTimeLabel
returnvalueProtectedPrivate0 methodLaboratory.Module.MConverter.returnvalue
DropDownList1ProtectedPrivate1 methodLaboratory.Module.NumberChecker .DropDownList1
TextBox1ProtectedPrivate1 methodLaboratory.Module.NumberChecker.TextBox1
CalculateButtonProtectedPrivate0 methodLaboratory.Module.NumberChecker .CalculateButton
ErrorLabelProtectedPrivate0 methodLaboratory.Module.NumberChecker .ErrorLabel
ResultLabelProtectedPrivate1 methodLaboratory.Module.NumberChecker .ResultLabel
ElapsedTimeLabelProtectedPrivate1 methodLaboratory.Module.NumberChecker .ElapsedTimeLabel
TextBox1ProtectedPrivate1 methodLaboratory.Module.Triangle.TextBox1
TextBox2ProtectedPrivate1 methodLaboratory.Module.Triangle.TextBox2
TextBox3ProtectedPrivate1 methodLaboratory.Module.Triangle.TextBox3
TextBox4ProtectedPrivate1 methodLaboratory.Module.Triangle.TextBox4
TextBox5ProtectedPrivate1 methodLaboratory.Module.Triangle.TextBox5
TextBox6ProtectedPrivate1 methodLaboratory.Module.Triangle.TextBox6
CalculateButtonProtectedPrivate0 methodLaboratory.Module.Triangle .CalculateButton
ErrorLabelProtectedPrivate1 methodLaboratory.Module.Triangle.ErrorLabel
ElapsedTimeLabelProtectedPrivate1 methodLaboratory.Module.Triangle .ElapsedTimeLabel
tableInputProtectedPrivate1 methodLaboratory.Module.Uncertainty.tableInput
functionInputProtectedPrivate2 methodsLaboratory.Module.Uncertainty .functionInput
CalculateButtonProtectedPrivate0 methodLaboratory.Module.Uncertainty .CalculateButton
ErrorLabelProtectedPrivate0 methodLaboratory.Module.Uncertainty.ErrorLabel
TableOutputProtectedPrivate1 methodLaboratory.Module.Uncertainty .TableOutput
ElapsedTimeLabelProtectedPrivate1 methodLaboratory.Module.Uncertainty .ElapsedTimeLabel
TextBox1ProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.TextBox1
TextBox2ProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.TextBox2
Button1ProtectedPrivate0 methodLaboratory.Module.DataAnalysis .LinearRegression.Button1
Label1ProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.Label1
lblLinearEqProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.lblLinearEq
lblRValProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.lblRVal
lblRSqValProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.lblRSqVal
lblRegCoeffProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.lblRegCoeff
lblIntrProtectedPrivate1 methodLaboratory.Module.DataAnalysis .LinearRegression.lblIntr
TextBox1ProtectedPrivate2 methodsLaboratory.Module.DataAnalysis.WebForm1 .TextBox1
Label1ProtectedPrivate2 methodsLaboratory.Module.DataAnalysis.WebForm1 .Label1
FindNthTermProtectedPrivate0 methodLaboratory.Module.DataAnalysis.WebForm1 .FindNthTerm
Button1ProtectedPrivate0 methodLaboratory.Module.DataAnalysis.WebForm1 .Button1
FutureValueTextProtectedPrivate1 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .FutureValueText
RateOfReturnTextProtectedPrivate1 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .RateOfReturnText
NumberOfPeriodsTextProtectedPrivate1 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .NumberOfPeriodsText
RoundCheckProtectedPrivate1 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .RoundCheck
CalculateButtonProtectedPrivate0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .CalculateButton
ErrorLabelProtectedPrivate1 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .ErrorLabel
ResultLabelProtectedPrivate1 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .ResultLabel

Statistics

Stat   Visibility   CouldBeDeclared   MethodsUsingMe
Sum:000
Average:000
Minimum:000
Maximum:000
Standard deviation:000
Variance:000
warning    Rule warning: Types that could be declared as private, nested in a parent type
// <Name>Types that could be declared as private, nested in a parent type</Name>
// The conditions for a type to be nested into a parent type
// is that the parent type is the only type using it,
// and that the parent type is declared in the same namespace.
//
// Declaring a type as private into a parent type helps enforcing encapsulation.
// But since nested private types are hardly testable, this rule might 
// not be applied for types used directly by tests.

warnif count > 0 
from t in Application.Types
where !t.IsGeneratedByCompiler &&
      
!t.IsNested &&
      
!t.IsPubliclyVisible &&
       
// Only one type user...
       t.TypesUsingMe.Count() == 1 
let couldBeNestedIn = t.TypesUsingMe.Single()
where !couldBeNestedIn.IsGeneratedByCompiler &&
       
// ...declared in the same namespace
       couldBeNestedIn.ParentNamespace == t.ParentNamespace
select new { t, couldBeNestedIn }

1 types matched

typecouldBeNestedInFull Name
GeomUtilsForm1B_Geometry.GeomUtils

Statistics

Stat   couldBeNestedIn
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Avoid publicly visible constant fields
// <Name>Avoid publicly visible constant fields</Name>

// Match constant fields which are visible outside their parent assembly. 
// Such field, when used outside its parent assembly,
// has its constant value hard-coded into the client assembly.
// Changing the field's value requires to recompile all assemblies 
// that use the field. 

// Declare the field as static readonly instead. This way, the value can be 
// safely changed, without the need to recompile client assemblies.

warnif count > 0 
from f in Application.Fields
where f.IsLiteral && f.IsPubliclyVisible 
      
&& !f.IsEnumValue // This situation also applies to enumeration values
                        // but to avoid too many false positives, per default
                        // this rule doesn't match these particular fields.
select f

33 fields matched

fieldsFull Name
LogOfEInBaseTwoMathos.Arithmetic.MathematicalConstants .LogOfEInBaseTwo
LogOfEInBaseTenMathos.Arithmetic.MathematicalConstants .LogOfEInBaseTen
LnOfTwoMathos.Arithmetic.MathematicalConstants .LnOfTwo
LnOfTenMathos.Arithmetic.MathematicalConstants .LnOfTen
SqrtOfTwoMathos.Arithmetic.MathematicalConstants .SqrtOfTwo
SqrtOfOneHalfMathos.Arithmetic.MathematicalConstants .SqrtOfOneHalf
SqrtOfThreeMathos.Arithmetic.MathematicalConstants .SqrtOfThree
SqrtOfOneThirdMathos.Arithmetic.MathematicalConstants .SqrtOfOneThird
PISquaredMathos.Arithmetic.MathematicalConstants .PISquared
PIOverTwoMathos.Arithmetic.MathematicalConstants .PIOverTwo
PIOverThreeMathos.Arithmetic.MathematicalConstants .PIOverThree
PIOverFourMathos.Arithmetic.MathematicalConstants .PIOverFour
SqrtOfPIMathos.Arithmetic.MathematicalConstants .SqrtOfPI
SqrtOfTwoOverPIMathos.Arithmetic.MathematicalConstants .SqrtOfTwoOverPI
SqrtOfPIOverTwoMathos.Arithmetic.MathematicalConstants .SqrtOfPIOverTwo
TwoOverSqrtOfPIMathos.Arithmetic.MathematicalConstants .TwoOverSqrtOfPI
OneOverPIMathos.Arithmetic.MathematicalConstants .OneOverPI
TwoOverPiMathos.Arithmetic.MathematicalConstants .TwoOverPi
LnOfPiMathos.Arithmetic.MathematicalConstants .LnOfPi
MaxIntSqrtMathos.Arithmetic.MathematicalConstants .MaxIntSqrt
MaxLongSqrtMathos.Arithmetic.MathematicalConstants .MaxLongSqrt
PIMathos.Arithmetic .MathematicalConstants+Single.PI
PISquaredMathos.Arithmetic .MathematicalConstants+Single.PISquared
PISqrtMathos.Arithmetic .MathematicalConstants+Single.PISqrt
AvogadroMathos.Arithmetic.PhysicalConstants .Avogadro
CMathos.Arithmetic.PhysicalConstants+SI.C
NewtonConstantMathos.Arithmetic.PhysicalConstants+SI .NewtonConstant
PlankConstantMathos.Arithmetic.PhysicalConstants+SI .PlankConstant
PlankConstantBarMathos.Arithmetic.PhysicalConstants+SI .PlankConstantBar
GravityAccelartionMathos.Arithmetic.PhysicalConstants+SI .GravityAccelartion
ElectronVoltMathos.Arithmetic.PhysicalConstants+SI .ElectronVolt
ElectronMassMathos.Arithmetic.PhysicalConstants+SI .ElectronMass
BoltzmanMathos.Arithmetic.PhysicalConstants+SI .Boltzman

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warning    Rule warning: Fields should be declared as private
// <Name>Fields should be declared as private</Name>
// Fields should be considered as implementation details
// and as a consequence they should be declared as private.
// When a field is private, the caller cannot get 
// inappropriate direct access to the field.

warnif count > 0 from f in Application.Fields where 
 
!f.IsPrivate && 

 
// These conditions filter cases where fields 
 // doesn't represent state that should be encapsulated. 
 !f.IsGeneratedByCompiler && 
 
!f.IsSpecialName && 
 
!f.IsInitOnly && 
 
!f.IsLiteral && 
 
!f.IsEnumValue

// A non-private field assigned from outside its class,
// usually leads to complicated field state management.
let outsideMethodsAssigningMe = 
   
f.MethodsAssigningMe.Where(m => m.ParentType != f.ParentType)

select new { f, 
             
f.Visibility, 
             
outsideMethodsAssigningMe }

184 fields matched

fieldsVisibilityoutsideMethodsAssigningMeFull Name
HyperLink1Protected0 methodLaboratory.Default.HyperLink1
Table1Protected0 methodLaboratory.Modules.Table1
HeadContentProtected0 methodLaboratory.SiteMaster.HeadContent
NavigationMenuProtected0 methodLaboratory.SiteMaster.NavigationMenu
MainContentProtected0 methodLaboratory.SiteMaster.MainContent
ChangeUserPasswordProtected0 methodLaboratory.Account.ChangePassword .ChangeUserPassword
RegisterHyperLinkProtected0 methodLaboratory.Account.Login .RegisterHyperLink
LoginUserProtected0 methodLaboratory.Account.Login.LoginUser
RegisterUserProtected0 methodLaboratory.Account.Register.RegisterUser
RegisterUserWizardStepProtected0 methodLaboratory.Account.Register .RegisterUserWizardStep
DropDownList1Protected0 methodLaboratory.Module.Converter .DropDownList1
Panel1Protected0 methodLaboratory.Module.Converter.Panel1
DropDownList2Protected0 methodLaboratory.Module.Converter .DropDownList2
TextBox1Protected0 methodLaboratory.Module.Converter.TextBox1
DropDownList3Protected0 methodLaboratory.Module.Converter .DropDownList3
TextBox2Protected0 methodLaboratory.Module.Converter.TextBox2
CalculateButtonProtected0 methodLaboratory.Module.Converter .CalculateButton
ErrorLabelProtected0 methodLaboratory.Module.Converter.ErrorLabel
ElapsedTimeLabelProtected0 methodLaboratory.Module.Converter .ElapsedTimeLabel
TextBox1Protected0 methodLaboratory.Module.EquationSolver .TextBox1
TextBox2Protected0 methodLaboratory.Module.EquationSolver .TextBox2
TextBox3Protected0 methodLaboratory.Module.EquationSolver .TextBox3
TextBox4Protected0 methodLaboratory.Module.EquationSolver .TextBox4
TextBox5Protected0 methodLaboratory.Module.EquationSolver .TextBox5
TextBox6Protected0 methodLaboratory.Module.EquationSolver .TextBox6
SolveSystemOfTwoEquationProtected0 methodLaboratory.Module.EquationSolver .SolveSystemOfTwoEquation
EquationErrorLabelProtected0 methodLaboratory.Module.EquationSolver .EquationErrorLabel
EquationResultLabelProtected0 methodLaboratory.Module.EquationSolver .EquationResultLabel
EquationElapsedTimeLabelProtected0 methodLaboratory.Module.EquationSolver .EquationElapsedTimeLabel
TextBox7Protected0 methodLaboratory.Module.EquationSolver .TextBox7
TextBox8Protected0 methodLaboratory.Module.EquationSolver .TextBox8
TextBox9Protected0 methodLaboratory.Module.EquationSolver .TextBox9
SolveQuadraticEquationProtected0 methodLaboratory.Module.EquationSolver .SolveQuadraticEquation
QuadraticEquationErrorLabelProtected0 methodLaboratory.Module.EquationSolver .QuadraticEquationErrorLabel
QuadraticEquationResultLabelProtected0 methodLaboratory.Module.EquationSolver .QuadraticEquationResultLabel
QuadraticEquationElapsedTimeLabelProtected0 methodLaboratory.Module.EquationSolver .QuadraticEquationElapsedTimeLabel
NumberTextProtected0 methodLaboratory.Module.Factorial.NumberText
CalculateButtonProtected0 methodLaboratory.Module.Factorial .CalculateButton
ErrorLabelProtected0 methodLaboratory.Module.Factorial.ErrorLabel
ResultTextboxProtected0 methodLaboratory.Module.Factorial .ResultTextbox
ElapsedTimeLabelProtected0 methodLaboratory.Module.Factorial .ElapsedTimeLabel
Label1Protected0 methodLaboratory.Module.IntegralApproximation .Label1
UpperBoundTextProtected0 methodLaboratory.Module.IntegralApproximation .UpperBoundText
LowerBoundTextProtected0 methodLaboratory.Module.IntegralApproximation .LowerBoundText
ExpressionTextProtected0 methodLaboratory.Module.IntegralApproximation .ExpressionText
Label2Protected0 methodLaboratory.Module.IntegralApproximation .Label2
NumberOfIntervalsTextProtected0 methodLaboratory.Module.IntegralApproximation .NumberOfIntervalsText
CalculateButtonProtected0 methodLaboratory.Module.IntegralApproximation .CalculateButton
ErrorLabelProtected0 methodLaboratory.Module.IntegralApproximation .ErrorLabel
Label3Protected0 methodLaboratory.Module.IntegralApproximation .Label3
RectangleMethodResultLabelProtected0 methodLaboratory.Module.IntegralApproximation .RectangleMethodResultLabel
RectangleMethodTimeLabelProtected0 methodLaboratory.Module.IntegralApproximation .RectangleMethodTimeLabel
Label4Protected0 methodLaboratory.Module.IntegralApproximation .Label4
TrapezoidalRuleResultLabelProtected0 methodLaboratory.Module.IntegralApproximation .TrapezoidalRuleResultLabel
TrapezoidalRuleTimeLabelProtected0 methodLaboratory.Module.IntegralApproximation .TrapezoidalRuleTimeLabel
Label5Protected0 methodLaboratory.Module.IntegralApproximation .Label5
SimpsonsRuleResultLabelProtected0 methodLaboratory.Module.IntegralApproximation .SimpsonsRuleResultLabel
SimpsonsRuleTimeLabelProtected0 methodLaboratory.Module.IntegralApproximation .SimpsonsRuleTimeLabel
returnvalueProtected0 methodLaboratory.Module.MConverter.returnvalue
DropDownList1Protected0 methodLaboratory.Module.NumberChecker .DropDownList1
TextBox1Protected0 methodLaboratory.Module.NumberChecker.TextBox1
CalculateButtonProtected0 methodLaboratory.Module.NumberChecker .CalculateButton
ErrorLabelProtected0 methodLaboratory.Module.NumberChecker .ErrorLabel
ResultLabelProtected0 methodLaboratory.Module.NumberChecker .ResultLabel
ElapsedTimeLabelProtected0 methodLaboratory.Module.NumberChecker .ElapsedTimeLabel
TextBox1Protected0 methodLaboratory.Module.Triangle.TextBox1
TextBox2Protected0 methodLaboratory.Module.Triangle.TextBox2
TextBox3Protected0 methodLaboratory.Module.Triangle.TextBox3
TextBox4Protected0 methodLaboratory.Module.Triangle.TextBox4
TextBox5Protected0 methodLaboratory.Module.Triangle.TextBox5
TextBox6Protected0 methodLaboratory.Module.Triangle.TextBox6
CalculateButtonProtected0 methodLaboratory.Module.Triangle .CalculateButton
ErrorLabelProtected0 methodLaboratory.Module.Triangle.ErrorLabel
ElapsedTimeLabelProtected0 methodLaboratory.Module.Triangle .ElapsedTimeLabel
tableInputProtected0 methodLaboratory.Module.Uncertainty.tableInput
functionInputProtected0 methodLaboratory.Module.Uncertainty .functionInput
CalculateButtonProtected0 methodLaboratory.Module.Uncertainty .CalculateButton
ErrorLabelProtected0 methodLaboratory.Module.Uncertainty.ErrorLabel
TableOutputProtected0 methodLaboratory.Module.Uncertainty .TableOutput
ElapsedTimeLabelProtected0 methodLaboratory.Module.Uncertainty .ElapsedTimeLabel
TextBox1Protected0 methodLaboratory.Module.DataAnalysis .LinearRegression.TextBox1
TextBox2Protected0 methodLaboratory.Module.DataAnalysis .LinearRegression.TextBox2
Button1Protected0 methodLaboratory.Module.DataAnalysis .LinearRegression.Button1
Label1Protected0 methodLaboratory.Module.DataAnalysis .LinearRegression.Label1
lblLinearEqProtected0 methodLaboratory.Module.DataAnalysis .LinearRegression.lblLinearEq
lblRValProtected0 methodLaboratory.Module.DataAnalysis .LinearRegression.lblRVal
lblRSqValProtected0 methodLaboratory.Module.DataAnalysis .LinearRegression.lblRSqVal
lblRegCoeffProtected0 methodLaboratory.Module.DataAnalysis .LinearRegression.lblRegCoeff
lblIntrProtected0 methodLaboratory.Module.DataAnalysis .LinearRegression.lblIntr
TextBox1Protected0 methodLaboratory.Module.DataAnalysis.WebForm1 .TextBox1
Label1Protected0 methodLaboratory.Module.DataAnalysis.WebForm1 .Label1
FindNthTermProtected0 methodLaboratory.Module.DataAnalysis.WebForm1 .FindNthTerm
Button1Protected0 methodLaboratory.Module.DataAnalysis.WebForm1 .Button1
FutureValueTextProtected0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .FutureValueText
RateOfReturnTextProtected0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .RateOfReturnText
NumberOfPeriodsTextProtected0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .NumberOfPeriodsText
RoundCheckProtected0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .RoundCheck
CalculateButtonProtected0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .CalculateButton
ErrorLabelProtected0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .ErrorLabel
ResultLabelProtected0 methodLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .ResultLabel

Statistics

Stat   Visibility   outsideMethodsAssigningMe
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warning    Rule warning: Avoid public methods not publicly visible
//<Name>Avoid public methods not publicly visible</Name>
// Matched methods are declared public but are not publicly visible by assemblies consumers.
// Their visibility level must be decreased.

warnif count > 0
from m in JustMyCode.Methods where 
   
!m.IsPubliclyVisible && m.IsPublic &&

   
// Eliminate virtual methods
   !m.IsVirtual &&
   
// Eliminate interface and delegate types
   !m.ParentType.IsInterface &&
   
!m.ParentType.IsDelegate &&
   
// Eliminate default constructors
   !(m.IsConstructor && m.NbParameters == 0) &&
   
// Eliminate operators that must be declared public
   !m.IsOperator &&
   
// Eliminate methods generated by compiler
   !m.IsGeneratedByCompiler 
select m

1 methods matched

methodFull Name
CentripetalMethod_createSplineByInterpol ation(Int32,Vector[],BCurve&)B_Geometry.GeomUtils .CentripetalMethod_createSplineByInterpo lation(Int32,Vector[],BCurve&)

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warning    Rule warning: Event handler methods should be declared private
// <Name>Event handler methods should be declared private</Name>
warnif count > 0
from m in Application.Methods where 
  
!m.IsPrivate &&

   
// A method is considered as event handler if...
   m.NbParameters==2 &&            // ...it has two parameters..
   m.Name.Contains("Object") &&    // ...of types Object...
   m.Name.Contains("EventArgs") && // ...and EventArgs
   
   
// Discard special cases
  !m.ParentType.IsDelegate &&
  
!m.IsGeneratedByCompiler

select new { m,m.Visibility }
// This rule implementation relies on the facts that:
// -> A method name contains the type of its parameters.
// -> All EventArgs derived types have the suffix "EventArgs".

49 methods matched

methodsVisibilityFull Name
Page_Load(Object,EventArgs)ProtectedLaboratory.About.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Default.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Modules.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.SiteMaster.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Account.ChangePassword .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Account.ChangePasswordSuccess .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Account.Login.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Account.Register.Page_Load (Object,EventArgs)
RegisterUser_CreatedUser(Object ,EventArgs)ProtectedLaboratory.Account.Register .RegisterUser_CreatedUser(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Converter.Page_Load (Object,EventArgs)
DropDownList1_SelectedIndexChanged (Object,EventArgs)ProtectedLaboratory.Module.Converter .DropDownList1_SelectedIndexChanged (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Converter .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.EquationSolver .Page_Load(Object,EventArgs)
SolveSystemOfTwoEquation_Click(Object ,EventArgs)ProtectedLaboratory.Module.EquationSolver .SolveSystemOfTwoEquation_Click(Object ,EventArgs)
SolveQuadraticEquation_Click(Object ,EventArgs)ProtectedLaboratory.Module.EquationSolver .SolveQuadraticEquation_Click(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Factorial.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Factorial .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.IntegralApproximation .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.IntegralApproximation .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.MConverter.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.NumberChecker .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.NumberChecker .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Triangle.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Triangle .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Uncertainty.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Uncertainty .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.DataAnalysis .LinearRegression.Page_Load(Object ,EventArgs)
Button1_Click(Object,EventArgs)ProtectedLaboratory.Module.DataAnalysis .LinearRegression.Button1_Click(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.DataAnalysis.WebForm1 .Page_Load(Object,EventArgs)
FindNthTerm_Click(Object,EventArgs)ProtectedLaboratory.Module.DataAnalysis.WebForm1 .FindNthTerm_Click(Object,EventArgs)
Button1_Click(Object,EventArgs)ProtectedLaboratory.Module.DataAnalysis.WebForm1 .Button1_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceFutureValue.Page_Load(Object ,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceFutureValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity.Page_Load (Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceNetPresentValue.Page_Load(Object ,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceNetPresentValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinancePresentValue.Page_Load(Object ,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinancePresentValue .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .CalculateButton_Click(Object,EventArgs)
Page_Load(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .Page_Load(Object,EventArgs)
CalculateButton_Click(Object,EventArgs)ProtectedLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .CalculateButton_Click(Object,EventArgs)
glControl_Resize(Object,EventArgs)PublicB_Geometry.Form1.glControl_Resize(Object ,EventArgs)
Page_Load(Object,EventArgs)ProtectedProjectWebsite._Default.Page_Load(Object ,EventArgs)

Statistics

Stat   Visibility
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

551
Purity - Immutability - Side-Effects  

warning    Rule warning: Fields should be marked as ReadOnly when possible
// <Name>Fields should be marked as ReadOnly when possible</Name>
warnif count > 0 
from f in JustMyCode.Fields where 
   
f.IsImmutable && 
  
!f.IsInitOnly &&
  
!f.IsGeneratedByCompiler &&
  
!f.IsEventDelegateObject
select new { f, f.SizeOfInst } 

// 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).



25 fields matched

fieldsSize of instanceFull Name
m_expanded_knots4B_Geometry.BasisFunction .m_expanded_knots
m_expanded_knots_set1B_Geometry.BasisFunction .m_expanded_knots_set
n_knots4B_Geometry.BasisFunction.n_knots
m_control_points4B_Geometry.BCurve.m_control_points
m_degree4B_Geometry.BCurve.m_degree
m_basis4B_Geometry.BCurve.m_basis
m_dimension4B_Geometry.BCurve.m_dimension
m_rows4B_Geometry.BGeomMatrix.m_rows
m_columns4B_Geometry.BGeomMatrix.m_columns
m_elements4B_Geometry.BGeomMatrix.m_elements
angleN/AB_Geometry.Form1.angle
mouse_positionN/AB_Geometry.Form1.mouse_position
components4B_Geometry.Form1.components
m_lowX8B_Geometry.GeomBox.m_lowX
m_lowY8B_Geometry.GeomBox.m_lowY
m_lowZ8B_Geometry.GeomBox.m_lowZ
m_highX8B_Geometry.GeomBox.m_highX
m_highY8B_Geometry.GeomBox.m_highY
m_highZ8B_Geometry.GeomBox.m_highZ
m_tolerance8B_Geometry.TolerantUtilities.m_tolerance
n_elements4B_Geometry.Vector.n_elements
m_is_initialised1B_Geometry.Vector.m_is_initialised
epsilon8MathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest.epsilon
epsilon4MathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest.epsilon
_vectorContent4Mathos.Vector._vectorContent

Statistics

Stat   Size of instance
Sum:118
Average:5.13
Minimum:1
Maximum:8
Standard deviation:2.25
Variance:5.07
warning    Rule warning: Structures should be immutable
// <Name>Structures should be immutable</Name>
warnif count > 0 from t in Application.Types where 
   
t.IsStructure && 
  
!t.IsImmutable

let mutableFields = t.Fields.Where(f => !f.IsImmutable)

select new { t, t.NbLinesOfCode, mutableFields }

// 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

6 types matched

types# lines of code (LOC)mutableFieldsFull Name
MainWindow+<DoError>d__816 fieldsRubyInt.MainWindow+<DoError>d__8
MainWindow+<About_Executed>d__e16 fieldsRubyInt.MainWindow+<About_Executed>d__e
SingleArithmetic+FloatIntUnion02 fieldsMathos.Arithmetic .SingleArithmetic+FloatIntUnion
ComplexNumber1102 fieldsMathos.Arithmetic.ComplexNumbers .ComplexNumber
Fraction1662 fieldsMathos.Arithmetic.Fractions.Fraction
Coordinate302 fieldsMathos.Geometry.CoordinateGeometry .TwoDimensional.Coordinate

Statistics

Stat   # lines of code (LOC)   mutableFields
Sum:3080
Average:51.330
Minimum:00
Maximum:1660
Standard deviation:64.220
Variance:4 1240
warning    Rule warning: Property Getters should be immutable
// <Name>Property Getters should be immutable</Name>
warnif count > 0 from m in Application.Methods where
  
m.IsPropertyGetter &&
  
( ( !m.IsStatic && m.ChangesObjectState) ||
    
(  m.IsStatic && m.ChangesTypeState) )

let fieldsAssigned = m.FieldsAssigned

select new { m, m.NbLinesOfCode, fieldsAssigned  }

// This rule might be violated in the case of object lazy initialized
// when the property getter is accessed the first time.
// But in general, the callers of a property 
// doesn't expect to change any state through the call.
    

4 methods matched

methods# lines of code (LOC)fieldsAssignedFull Name
get_ResourceManager()41 fieldB_Geometry.Properties.Resources .get_ResourceManager()
get_ResourceManager()41 fieldMathosTest.Properties.Resources .get_ResourceManager()
get_ResourceManager()41 fieldRubyInt.Properties.Resources .get_ResourceManager()
get_ResourceManager()41 fieldInteractive_Mathematics.Properties .Resources.get_ResourceManager()

Statistics

Stat   # lines of code (LOC)   fieldsAssigned
Sum:160
Average:40
Minimum:40
Maximum:40
Standard deviation:00
Variance:00
warning    Rule warning: Avoid static fields with a mutable field type
// <Name>Avoid static fields with a mutable field type</Name>
warnif count > 0
from f in Application.Fields
where f.IsStatic && !f.IsEnumValue && !f.IsGeneratedByCompiler && !f.IsLiteral
let fieldType = f.FieldType
where fieldType != null && 
     
!fieldType.IsThirdParty && 
     
!fieldType.IsInterface && 
     
!fieldType.IsImmutable
select new { f, 
             
mutableFieldType = fieldType , 
             
isFieldImmutable = f.IsImmutable, 
             
isFieldIsReadOnly = f.IsInitOnly }

// As explained in this blog post
// http://codebetter.com/patricksmacchia/2011/05/04/back-to-basics-usage-of-static-members
// static fields should be used to hold only constant and immutable states.

3 fields matched

fieldsmutableFieldTypeisFieldImmutableisFieldIsReadOnlyFull Name
defaultInstanceSettingsTrueFalseB_Geometry.Properties.Settings .defaultInstance
defaultInstanceSettingsTrueFalseRubyInt.Properties.Settings .defaultInstance
defaultInstanceSettingsTrueFalseInteractive_Mathematics.Properties .Settings.defaultInstance

Statistics

Stat   mutableFieldType   isFieldImmutable   isFieldIsReadOnly
Sum:000
Average:000
Minimum:000
Maximum:000
Standard deviation:000
Variance:000
warning    Rule warning: A field must not be assigned from outside its parent hierarchy types
// <Name>A field must not be assigned from outside its parent hierarchy types</Name>
warnif count > 0
from f in JustMyCode.Fields.Where(f => 
      
!f.IsPrivate && !f.IsGeneratedByCompiler && 
      
!f.IsImmutable && !f.IsEnumValue)

let methodsAssignerOutsideOfMyType = f.MethodsAssigningMe.Where(
        
m =>!m.IsGeneratedByCompiler &&
             
m.ParentType != f.ParentType && 
            
!m.ParentType.DeriveFrom(f.ParentType) )

where methodsAssignerOutsideOfMyType.Count() > 0
select new { f, methodsAssignerOutsideOfMyType }

2 fields matched

fieldsmethodsAssignerOutsideOfMyTypeFull Name
f1 methodMathos.Arithmetic .SingleArithmetic+FloatIntUnion.f
tmp1 methodMathos.Arithmetic .SingleArithmetic+FloatIntUnion.tmp

Statistics

Stat   methodsAssignerOutsideOfMyType
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Critical Rule warning: Don't assign a field from many methods
// <Name>Don't assign a field from many methods</Name>
warnif count > 0 
from f in JustMyCode.Fields where 
  
!f.IsEnumValue &&
  
!f.IsImmutable && 
  
!f.IsInitOnly &&
  
!f.IsGeneratedByCompiler &&
  
!f.IsEventDelegateObject &&
   
(f.IsPrivate || f.IsProtected)  // Don't match fields assigned outside their classes.

// The threshold 4 is arbitrary and it should avoid matching too many fields.
// Threshold is even lower for static fields because this reveals situations even more complex.
where f.MethodsAssigningMe.Count() >= (!f.IsStatic ? 4 : 2)
select new { f, 
             
f.MethodsAssigningMe, 
             
f.MethodsReadingMeButNotAssigningMe, 
             
f.MethodsUsingMe,
             
f.ParentType } 

// A field assigned from many methods is a symptom of bug-prone code.
// This situation makes harder to anticipate the field state during runtime.
// The code is then hard to read, hard to debug and hard to maintain.
// Hard-to-solve bugs due to corrupted state are often the consequence of fields anarchically assigned.
//
// The situation is even more complex if the field is static.
// Indeed, this potentially involves global random accesses from different parts of the application.
// This is why this rule provides a lower threshold for static fields.
// 
// If the object containing such field is meant to be used from multiple threads, 
// there are alarming chances that the code is unmaintainable and bugged.
// When multiple threads are involved, the rule of thumb is to use immutable objects.
//
// If the field type is a reference type (interfaces, classes, strings, delegates) 
// corrupted state might result in a NullReferenceException.
// If the field type is a value type (number, boolean, structure) 
// corrupted state might result in wrong result not even signaled by an exception sent.
//
// There is no straight advice to refactor the number of methods responsible for assigning a field.
// Solutions often involve rethinking and then rewriting a complex algorithm.
// Such field can sometime become just a variable accessed locally by a method or a closure.
// Sometime, just rethinking the life-time and the role of the parent object allows the field to become immutable 
// (i.e assigned only by the constructor).

7 fields matched

fieldsMethodsAssigningMeMethodsReadingMeButNotAssigningMeMethodsUsingMeParentTypeFull Name
mouse_clicked2 methods2 methods4 methodsForm1B_Geometry.Form1.mouse_clicked
_currentFile4 methods0 method4 methodsMainWindowRubyInt.MainWindow._currentFile
_saved5 methods1 method6 methodsMainWindowRubyInt.MainWindow._saved
_firstSave4 methods1 method5 methodsMainWindowRubyInt.MainWindow._firstSave
_realPart4 methods14 methods18 methodsComplexNumberMathos.Arithmetic.ComplexNumbers .ComplexNumber._realPart
_imaginaryPart4 methods14 methods18 methodsComplexNumberMathos.Arithmetic.ComplexNumbers .ComplexNumber._imaginaryPart
_numerator4 methods8 methods12 methodsFractionMathos.Arithmetic.Fractions.Fraction ._numerator

Statistics

Stat   MethodsAssigningMe   MethodsReadingMeButNotAssigningMe   MethodsUsingMe   ParentType
Sum:0000
Average:0000
Minimum:0000
Maximum:0000
Standard deviation:0000
Variance:0000

962
Naming Conventions  

warning    Rule warning: Instance fields should be prefixed with a 'm_'
// <Name>Instance fields should be prefixed with a 'm_'</Name>
warnif count > 0 from f in Application.Fields where 
  
!f.NameLike (@"^m_") && 
  
!f.IsStatic && 
  
!f.IsLiteral && 
  
!f.IsGeneratedByCompiler  && 
  
!f.IsSpecialName && 
  
!f.IsEventDelegateObject
select new { f, f.SizeOfInst } 

// This naming convention provokes debate.
// Don't hesitate to customize the regex of 
// NameLike to your preference.

267 fields matched

fieldsSize of instanceFull Name
HyperLink14Laboratory.Default.HyperLink1
Table14Laboratory.Modules.Table1
HeadContent4Laboratory.SiteMaster.HeadContent
NavigationMenu4Laboratory.SiteMaster.NavigationMenu
MainContent4Laboratory.SiteMaster.MainContent
ChangeUserPassword4Laboratory.Account.ChangePassword .ChangeUserPassword
RegisterHyperLink4Laboratory.Account.Login .RegisterHyperLink
LoginUser4Laboratory.Account.Login.LoginUser
RegisterUser4Laboratory.Account.Register.RegisterUser
RegisterUserWizardStep4Laboratory.Account.Register .RegisterUserWizardStep
DropDownList14Laboratory.Module.Converter .DropDownList1
Panel14Laboratory.Module.Converter.Panel1
DropDownList24Laboratory.Module.Converter .DropDownList2
TextBox14Laboratory.Module.Converter.TextBox1
DropDownList34Laboratory.Module.Converter .DropDownList3
TextBox24Laboratory.Module.Converter.TextBox2
CalculateButton4Laboratory.Module.Converter .CalculateButton
ErrorLabel4Laboratory.Module.Converter.ErrorLabel
ElapsedTimeLabel4Laboratory.Module.Converter .ElapsedTimeLabel
TextBox14Laboratory.Module.EquationSolver .TextBox1
TextBox24Laboratory.Module.EquationSolver .TextBox2
TextBox34Laboratory.Module.EquationSolver .TextBox3
TextBox44Laboratory.Module.EquationSolver .TextBox4
TextBox54Laboratory.Module.EquationSolver .TextBox5
TextBox64Laboratory.Module.EquationSolver .TextBox6
SolveSystemOfTwoEquation4Laboratory.Module.EquationSolver .SolveSystemOfTwoEquation
EquationErrorLabel4Laboratory.Module.EquationSolver .EquationErrorLabel
EquationResultLabel4Laboratory.Module.EquationSolver .EquationResultLabel
EquationElapsedTimeLabel4Laboratory.Module.EquationSolver .EquationElapsedTimeLabel
TextBox74Laboratory.Module.EquationSolver .TextBox7
TextBox84Laboratory.Module.EquationSolver .TextBox8
TextBox94Laboratory.Module.EquationSolver .TextBox9
SolveQuadraticEquation4Laboratory.Module.EquationSolver .SolveQuadraticEquation
QuadraticEquationErrorLabel4Laboratory.Module.EquationSolver .QuadraticEquationErrorLabel
QuadraticEquationResultLabel4Laboratory.Module.EquationSolver .QuadraticEquationResultLabel
QuadraticEquationElapsedTimeLabel4Laboratory.Module.EquationSolver .QuadraticEquationElapsedTimeLabel
NumberText4Laboratory.Module.Factorial.NumberText
CalculateButton4Laboratory.Module.Factorial .CalculateButton
ErrorLabel4Laboratory.Module.Factorial.ErrorLabel
ResultTextbox4Laboratory.Module.Factorial .ResultTextbox
ElapsedTimeLabel4Laboratory.Module.Factorial .ElapsedTimeLabel
Label14Laboratory.Module.IntegralApproximation .Label1
UpperBoundText4Laboratory.Module.IntegralApproximation .UpperBoundText
LowerBoundText4Laboratory.Module.IntegralApproximation .LowerBoundText
ExpressionText4Laboratory.Module.IntegralApproximation .ExpressionText
Label24Laboratory.Module.IntegralApproximation .Label2
NumberOfIntervalsText4Laboratory.Module.IntegralApproximation .NumberOfIntervalsText
CalculateButton4Laboratory.Module.IntegralApproximation .CalculateButton
ErrorLabel4Laboratory.Module.IntegralApproximation .ErrorLabel
Label34Laboratory.Module.IntegralApproximation .Label3
RectangleMethodResultLabel4Laboratory.Module.IntegralApproximation .RectangleMethodResultLabel
RectangleMethodTimeLabel4Laboratory.Module.IntegralApproximation .RectangleMethodTimeLabel
Label44Laboratory.Module.IntegralApproximation .Label4
TrapezoidalRuleResultLabel4Laboratory.Module.IntegralApproximation .TrapezoidalRuleResultLabel
TrapezoidalRuleTimeLabel4Laboratory.Module.IntegralApproximation .TrapezoidalRuleTimeLabel
Label54Laboratory.Module.IntegralApproximation .Label5
SimpsonsRuleResultLabel4Laboratory.Module.IntegralApproximation .SimpsonsRuleResultLabel
SimpsonsRuleTimeLabel4Laboratory.Module.IntegralApproximation .SimpsonsRuleTimeLabel
returnvalue4Laboratory.Module.MConverter.returnvalue
DropDownList14Laboratory.Module.NumberChecker .DropDownList1
TextBox14Laboratory.Module.NumberChecker.TextBox1
CalculateButton4Laboratory.Module.NumberChecker .CalculateButton
ErrorLabel4Laboratory.Module.NumberChecker .ErrorLabel
ResultLabel4Laboratory.Module.NumberChecker .ResultLabel
ElapsedTimeLabel4Laboratory.Module.NumberChecker .ElapsedTimeLabel
TextBox14Laboratory.Module.Triangle.TextBox1
TextBox24Laboratory.Module.Triangle.TextBox2
TextBox34Laboratory.Module.Triangle.TextBox3
TextBox44Laboratory.Module.Triangle.TextBox4
TextBox54Laboratory.Module.Triangle.TextBox5
TextBox64Laboratory.Module.Triangle.TextBox6
CalculateButton4Laboratory.Module.Triangle .CalculateButton
ErrorLabel4Laboratory.Module.Triangle.ErrorLabel
ElapsedTimeLabel4Laboratory.Module.Triangle .ElapsedTimeLabel
parser4Laboratory.Module.Uncertainty.parser
tableInput4Laboratory.Module.Uncertainty.tableInput
functionInput4Laboratory.Module.Uncertainty .functionInput
CalculateButton4Laboratory.Module.Uncertainty .CalculateButton
ErrorLabel4Laboratory.Module.Uncertainty.ErrorLabel
TableOutput4Laboratory.Module.Uncertainty .TableOutput
ElapsedTimeLabel4Laboratory.Module.Uncertainty .ElapsedTimeLabel
TextBox14Laboratory.Module.DataAnalysis .LinearRegression.TextBox1
TextBox24Laboratory.Module.DataAnalysis .LinearRegression.TextBox2
Button14Laboratory.Module.DataAnalysis .LinearRegression.Button1
Label14Laboratory.Module.DataAnalysis .LinearRegression.Label1
lblLinearEq4Laboratory.Module.DataAnalysis .LinearRegression.lblLinearEq
lblRVal4Laboratory.Module.DataAnalysis .LinearRegression.lblRVal
lblRSqVal4Laboratory.Module.DataAnalysis .LinearRegression.lblRSqVal
lblRegCoeff4Laboratory.Module.DataAnalysis .LinearRegression.lblRegCoeff
lblIntr4Laboratory.Module.DataAnalysis .LinearRegression.lblIntr
TextBox14Laboratory.Module.DataAnalysis.WebForm1 .TextBox1
Label14Laboratory.Module.DataAnalysis.WebForm1 .Label1
FindNthTerm4Laboratory.Module.DataAnalysis.WebForm1 .FindNthTerm
Button14Laboratory.Module.DataAnalysis.WebForm1 .Button1
FutureValueText4Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .FutureValueText
RateOfReturnText4Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .RateOfReturnText
NumberOfPeriodsText4Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .NumberOfPeriodsText
RoundCheck4Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .RoundCheck
CalculateButton4Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .CalculateButton
ErrorLabel4Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .ErrorLabel

Statistics

Stat   Size of instance
Sum:1 291
Average:4.84
Minimum:1
Maximum:16
Standard deviation:2.53
Variance:6.38
warning    Rule warning: Static fields should be prefixed with a 's_'
// <Name>Static fields should be prefixed with a 's_'</Name>
warnif count > 0 from f in Application.Fields where 
  
!f.NameLike (@"^s_") && 
   
f.IsStatic && 
  
!f.IsLiteral && 
  
!f.IsGeneratedByCompiler && 
  
!f.IsSpecialName && 
  
!f.IsEventDelegateObject
select new { f, f.SizeOfInst }  

// This naming convention provokes debate.
// Don't hesitate to customize the regex of 
// NameLike to your preference.

29 fields matched

fieldsSize of instanceFull Name
angleN/AB_Geometry.Form1.angle
session_curveN/AB_Geometry.Form1.session_curve
mouse_clickedN/AB_Geometry.Form1.mouse_clicked
mouse_positionN/AB_Geometry.Form1.mouse_position
resourceManN/AB_Geometry.Properties.Resources .resourceMan
resourceCultureN/AB_Geometry.Properties.Resources .resourceCulture
defaultInstanceN/AB_Geometry.Properties.Settings .defaultInstance
testListN/AMathosTest.Statistics+Literals.testList
testList2N/AMathosTest.Statistics+Literals.testList2
testListSortedN/AMathosTest.Statistics+Literals .testListSorted
testListModesN/AMathosTest.Statistics+Literals .testListModes
testListProductN/AMathosTest.Statistics+Literals .testListProduct
testListOddN/AMathosTest.Statistics+Literals .testListOdd
emptyListN/AMathosTest.Statistics+Literals.emptyList
resourceManN/AMathosTest.Properties.Resources .resourceMan
resourceCultureN/AMathosTest.Properties.Resources .resourceCulture
resourceManN/ARubyInt.Properties.Resources.resourceMan
resourceCultureN/ARubyInt.Properties.Resources .resourceCulture
defaultInstanceN/ARubyInt.Properties.Settings .defaultInstance
resourceManN/AInteractive_Mathematics.Properties .Resources.resourceMan
resourceCultureN/AInteractive_Mathematics.Properties .Resources.resourceCulture
defaultInstanceN/AInteractive_Mathematics.Properties .Settings.defaultInstance
BaseArrayN/AMathos.Converter.Converter.BaseArray
UnitConversionsN/AMathos.Converter.Converter .UnitConversions
Lanczos15N/AMathos.SpecialFunctions.GammaRelated .Lanczos15
LogTableN/AMathos.SpecialFunctions.GammaRelated .LogTable
LogPiN/AMathos.SpecialFunctions.GammaRelated .LogPi
Log2PiN/AMathos.SpecialFunctions.GammaRelated .Log2Pi
ListOfCommonPrimeNumbersN/AMathos.Arithmetic.Numbers.Get .ListOfCommonPrimeNumbers

Statistics

Stat   Size of instance
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Critical Rule warning: Exception class name should be suffixed with 'Exception'
// <Name>Exception class name should be suffixed with 'Exception'</Name>
warnif count > 0 from t in Application.Types where 
  
t.IsExceptionClass && 
  
// We use SimpleName, because in case of generic Exception type
  // SimpleName suppresses the generic suffix (like <T>).
  !t.SimpleNameLike (@"Exception$") &&
  
!t.SimpleNameLike (@"ExceptionBase$") // Allow the second suffix Base
                                        // for base exception classes.
select new { t, t.SimpleName }

// The name of an exception class should end with 'Exception'.

1 types matched

typeSimpleNameFull Name
InvalidCoordinateFormatInvalidCoordinateFormatMathos.Exceptions .InvalidCoordinateFormat

Statistics

Stat   SimpleName
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Types name should begin with an Upper character
// <Name>Types name should begin with an Upper character</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
// The name of a type should begin with an Upper letter.
  !t.SimpleNameLike (@"^[A-Z]") &&     

  
// Except if it is generated by compiler or ...
  !t.IsSpecialName &&
  
!t.IsGeneratedByCompiler


select new { t, t.NbLinesOfCode }

2 types matched

types# lines of code (LOC)Full Name
coordinateStruct28MathosTest.coordinateStruct
_Default87ProjectWebsite._Default

Statistics

Stat   # lines of code (LOC)
Sum:115
Average:57.5
Minimum:28
Maximum:87
Standard deviation:29.5
Variance:870.25
warning    Rule warning: Methods name should begin with an Upper character
// <Name>Methods name should begin with an Upper character</Name>
warnif count > 0 from m in JustMyCode.Methods where 
  
!m.NameLike (@"^[A-Z]") && 
  
!m.IsSpecialName && 
  
!m.IsGeneratedByCompiler
select m

// The name of a regular method should 
// begin with an Upper letter.

21 methods matched

methodsFull Name
func(Decimal)Laboratory.Module.Uncertainty.func (Decimal)
pow(Decimal,Decimal)Laboratory.Module.Uncertainty.pow (Decimal,Decimal)
getIndex(Int32,Int32)B_Geometry.BGeomMatrix.getIndex(Int32 ,Int32)
getElement(Int32,Int32)B_Geometry.BGeomMatrix.getElement(Int32 ,Int32)
setElement(Int32,Int32,Double)B_Geometry.BGeomMatrix.setElement(Int32 ,Int32,Double)
glControl1_MouseUp(Object,MouseEventArgs )B_Geometry.Form1.glControl1_MouseUp (Object,MouseEventArgs)
glControl1_MouseMove(Object ,MouseEventArgs)B_Geometry.Form1.glControl1_MouseMove (Object,MouseEventArgs)
glControl1_MouseDown(Object ,MouseEventArgs)B_Geometry.Form1.glControl1_MouseDown (Object,MouseEventArgs)
button1_Click(Object,EventArgs)B_Geometry.Form1.button1_Click(Object ,EventArgs)
glControl1_Load(Object,EventArgs)B_Geometry.Form1.glControl1_Load(Object ,EventArgs)
glControl_Resize(Object,EventArgs)B_Geometry.Form1.glControl_Resize(Object ,EventArgs)
glControl1_Paint(Object,PaintEventArgs)B_Geometry.Form1.glControl1_Paint(Object ,PaintEventArgs)
lstPages_MouseLeftButtonUp(Object ,MouseButtonEventArgs)RubyInt.HelpWindow .lstPages_MouseLeftButtonUp(Object ,MouseButtonEventArgs)
browserWin_Navigating(Object ,NavigatingCancelEventArgs)RubyInt.HelpWindow.browserWin_Navigating (Object,NavigatingCancelEventArgs)
browserWin_LoadCompleted(Object ,NavigationEventArgs)RubyInt.HelpWindow .browserWin_LoadCompleted(Object ,NavigationEventArgs)
textEditor_TextArea_TextEntered(Object ,TextCompositionEventArgs)RubyInt.MainWindow .textEditor_TextArea_TextEntered(Object ,TextCompositionEventArgs)
textEditor_TextArea_TextEntering(Object ,TextCompositionEventArgs)RubyInt.MainWindow .textEditor_TextArea_TextEntering(Object ,TextCompositionEventArgs)
textBox1_KeyUp(Object,KeyEventArgs)Interactive_Mathematics.MainWindow .textBox1_KeyUp(Object,KeyEventArgs)
treeView1_MouseUp(Object ,MouseButtonEventArgs)Interactive_Mathematics.MainWindow .treeView1_MouseUp(Object ,MouseButtonEventArgs)
dataGrid1_MouseDoubleClick(Object ,MouseButtonEventArgs)Interactive_Mathematics.MainWindow .dataGrid1_MouseDoubleClick(Object ,MouseButtonEventArgs)
listView1_MouseDoubleClick(Object ,MouseButtonEventArgs)Interactive_Mathematics.MainWindow .listView1_MouseDoubleClick(Object ,MouseButtonEventArgs)

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warning    Rule warning: Avoid methods with name too long
// <Name>Avoid methods with name too long</Name>
warnif count > 0 from m in Application.Methods where 
 
!m.IsExplicitInterfaceImpl &&
 
!m.IsGeneratedByCompiler &&
 
((!m.IsSpecialName && m.SimpleName.Length > 35) ||
   
// Property getter/setter are prefixed with "get_" "set_" of length 4.
  ( m.IsSpecialName && m.SimpleName.Length - 4 > 35))

select new { m, m.SimpleName }

// 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.
      

11 methods matched

methodsSimpleNameFull Name
CentripetalMethod_calculateInterpolation Parameters(Vector[],Double[]&)CentripetalMethod_calculateInterpolationParametersB_Geometry.GeomUtils .CentripetalMethod_calculateInterpolatio nParameters(Vector[],Double[]&)
CentripetalMethod_createSplineByInterpol ation(Int32,Vector[],BCurve&)CentripetalMethod_createSplineByInterpolationB_Geometry.GeomUtils .CentripetalMethod_createSplineByInterpo lation(Int32,Vector[],BCurve&)
ComplexNumberConstructorsWithNonZeroValu edParameters()ComplexNumberConstructorsWithNonZeroValuedParametersMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithNonZeroVal uedParameters()
ComplexNumberConstructorsWithZeroValuedP arameters()ComplexNumberConstructorsWithZeroValuedParametersMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithZeroValued Parameters()
AddingFractionsWithDifferentDenominators ()AddingFractionsWithDifferentDenominatorsMathosTest.TestOfFractions .AddingFractionsWithDifferentDenominator s()
AddingFractionsWithCommonDenominator()AddingFractionsWithCommonDenominatorMathosTest.TestOfFractions .AddingFractionsWithCommonDenominator()
FirstDerivativeWithSeveralVariables2()FirstDerivativeWithSeveralVariables2MathosTest.Calculus.CalculusTest .FirstDerivativeWithSeveralVariables2()
BinomialDistributionStandardDeviation()BinomialDistributionStandardDeviationMathosTest.Mathos_Main .StatisticalDistributions .BinomialDistributionStandardDeviation()
PoissonDistributionStandardDeviation()PoissonDistributionStandardDeviationMathosTest.Mathos_Main .StatisticalDistributions .PoissonDistributionStandardDeviation()
HypergeometricDistributionStandardDeviat ion()HypergeometricDistributionStandardDeviationMathosTest.Mathos_Main .StatisticalDistributions .HypergeometricDistributionStandardDevia tion()
TestThatNaiveHypotFailsWhenHypotWorks()TestThatNaiveHypotFailsWhenHypotWorksMathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest .TestThatNaiveHypotFailsWhenHypotWorks()

Statistics

Stat   SimpleName
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Critical Rule warning: Avoid having different types with same name
// <Name>Avoid having different types with same name</Name>
// Such practice typically creates confusion, 
// and type naming collision inside a source file.

warnif count > 0

// This rule matches also collisions between 
// application and third-party types sharing a same name.
let groups = JustMyCode.Types.Union(ThirdParty.Types)
                 
// Discard nested types, whose name is 
                 // prefixed with the parent type name.
                 .Where(t => !t.IsNested)
                 
                 
// Group types by name.
                 .GroupBy(t => t.Name)

from @group in groups 
   
where @group.Count() > 1

   
// Let's see if types with the same name are declared
   // in different namespaces.
   // (t.FullName is {namespaceName}.{typeName} )
   let groupsFullName = @group.GroupBy(t => t.FullName)
   
where groupsFullName.Count() > 1

   
// If several types with same name are declared in different namespaces
   // eliminate the case where all types are declared in third-party assemblies.
   let types= groupsFullName.SelectMany(g => g)
   
where types.Any(t => !t.IsThirdParty)
        
// Uncomment this line, to only gets naming collision involving
        // both application and third-party types.
        //         && types.Any(t => t.IsThirdParty)

orderby types.Count() descending 

select new { t = types.First(),
             
// In the 'types' column, make sure to group matched types 
             // by parent assemblies and parent namespaces, to get a result
             // more readable.
             types
            
}

12 types matched

typestypesFull Name
ChangePassword2 typesLaboratory.Account.ChangePassword
Login2 typesLaboratory.Account.Login
Converter2 typesLaboratory.Module.Converter
EquationSolver2 typesLaboratory.Module.EquationSolver
Triangle2 typesLaboratory.Module.Triangle
Uncertainty2 typesLaboratory.Module.Uncertainty
Program2 typesB_Geometry.Program
Vector2 typesB_Geometry.Vector
DecimalArithmetic2 typesMathosTest.Mathos_Main.Arithmetic .DecimalArithmetic
App2 typesRubyInt.App
MainWindow2 typesRubyInt.MainWindow
Convert2 typesMathos.Arithmetic.Numbers.Convert

Statistics

Stat   types
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Avoid naming types and namespaces with the same identifier
// <Name>Avoid naming types and namespaces with the same identifier</Name>

// Not only this can provoke compiler resolution collision,
// but also, this makes code less maintainable because
// concepts are not concisely identified.

warnif count > 0
let hashsetShortNames = Namespaces.Where(n => n.Name.Length > 0).Select(n => n.SimpleName).ToHashSet()

from t in JustMyCode.Types
where hashsetShortNames.Contains(t.Name)
select new { t, namespaces = Namespaces.Where(n => n.SimpleName == t.Name) }

7 types matched

typesnamespacesFull Name
Converter1 namespaceLaboratory.Module.Converter
Uncertainty1 namespaceLaboratory.Module.Uncertainty
Shapes1 namespaceMathosTest.Shapes
Statistics1 namespaceMathosTest.Statistics
Uncertainty1 namespaceMathosTest.Uncertainty.Uncertainty
Converter1 namespaceMathos.Converter.Converter
Finance2 namespacesMathos.Finance.Finance

Statistics

Stat   namespaces
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

240
Source Files Organization  

warning    Rule warning: Avoid defining multiple types in a source file
// <Name>Avoid defining multiple types in a source file</Name>
warnif count > 0 

// Build a lookup indexed by source files, values being a sequence of types defined in the source file.
let lookup = Application.Types.Where(t => 
                                
t.SourceFileDeclAvailable && 
                               
// except nested types and types generated by compilers!
                               !t.IsGeneratedByCompiler &&                               
                               
!t.IsNested)                                
                         
// It could make sense to not apply this rule for enumerations.
                         // && !t.IsEnumeration)

            
// We use multi-key, since a type can be declared in multiple source files.
           .ToMultiKeyLookup(t => t.SourceDecls.Select(d => d.SourceFile))
 
from @group in lookup where @group.Count() > 1
   
let sourceFile = @group.Key

   
// CQLinq doesn't let indexing result with sourceFile 
   // so we choose a typeIndex in types, 
   // preferably the type that has the file name.
   let typeWithSourceFileName = @group.FirstOrDefault(t => t.SimpleName == sourceFile.FileNameWithoutExtension)
   
let typeIndex = typeWithSourceFileName ?? @group.First()

select new { typeIndex, 
             
types = @group as IEnumerable<IType>, 
             
sourceFile.FilePathString }

10 types matched

typestypesFilePathStringFull Name
PythagoreanTest2 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Geometry\Geometry.csMathosTest.PythagoreanTest
Vector2 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Matrices.csMathos.Vector
ConversionInfo2 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Converter\ConversionObjects.csMathos.Converter.ConversionInfo
Angle10 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Converter\ConversionTypes.csMathos.Converter.Angle
NumberList3 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Statistics\Statistics.csMathos.Statistics.NumberList
DenominatorNullException4 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\MathosExceptions.csMathos.Exceptions .DenominatorNullException
ComplexNumber2 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\ComplexNumberType.csMathos.Arithmetic.ComplexNumbers .ComplexNumber
INaturalNumber10 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.INaturalNumber
Calculate2 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Geometry\CoordinateGeometry.csMathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate
ArithmeticProgression3 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\PreCalculus\Sequences.csMathos.PreCalculus.Sequences .ArithmeticProgression

Statistics

Stat   types   FilePathString
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warning    Rule warning: Namespace name should correspond to file location
// <Name>Namespace name should correspond to file location</Name>

// For a good code organization, 
// do mirror the namespaces hierarchy and the source files directories tree.

warnif count > 0
from n in Application.Namespaces 

// Replace dots by spaces in namespace name
let dirCorresponding = n.Name.Replace('.', ' ')

// Look at source file decl of JustMyCode type's declared in n
from t in n.ChildTypes
where JustMyCode.Contains(t) && t.SourceFileDeclAvailable
from decl in t.SourceDecls
let sourceFilePath = decl.SourceFile.FilePath.ToString()

// Replace dots and path separators by spaces in source files names
where !sourceFilePath.Replace('.',' ').Replace('\\',' ').Contains(dirCorresponding)

select new { t, dirCorresponding , sourceFilePath  } 

36 types matched

typesdirCorrespondingsourceFilePathFull Name
CalculusTestMathosTest Calculusc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Calculus\CalculusTest.csMathosTest.Calculus.CalculusTest
UnitTest1MathosTest SpecialFunctionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\SpecialFunctions\Antiderivatives.csMathosTest.SpecialFunctions.UnitTest1
UncertaintyMathosTest Uncertaintyc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Uncertainty\Uncertainty.csMathosTest.Uncertainty.Uncertainty
StatisticalDistributionsMathosTest Mathos_Mainc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Statistics and DiceSim\StatisticalDistributions.csMathosTest.Mathos_Main .StatisticalDistributions
SyntaxTestMathosTest Mathos_Mainc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\syntaxTest.csMathosTest.Mathos_Main.SyntaxTest
ComplexArithmeticTestMathosTest Mathos_Main Arithmeticc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Arithmetic\ComplexArithmeticTest.csMathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest
DoubleArthimeticTestMathosTest Mathos_Main Arithmeticc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Arithmetic\DoubleArthimeticTest.csMathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegerArthimeticTestMathosTest Mathos_Main Arithmeticc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Arithmetic\IntegerArthimeticTest.csMathosTest.Mathos_Main.Arithmetic .IntegerArthimeticTest
SingleArthimeticTestMathosTest Mathos_Main Arithmeticc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Arithmetic\SingleArthimeticTest.csMathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest
DecimalArithmeticMathosTest Mathos_Main Arithmeticc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Arithmetic\DecimalArithmetic.csMathosTest.Mathos_Main.Arithmetic .DecimalArithmetic
FiniteCalculusTestMathosTest Mathos_Main Calculusc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Calculus\FiniteCalculusTest.csMathosTest.Mathos_Main.Calculus .FiniteCalculusTest
ElementaryTestsMathosTest Mathos_Main SpecialFunctionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\SpecialFunctions\ElementaryTests.csMathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
GammaTestsMathosTest Mathos_Main SpecialFunctionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\SpecialFunctions\GammaTests.csMathosTest.Mathos_Main.SpecialFunctions .GammaTests
FrmTableInteractive_Mathematicsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Interactive Mathematics\frmTable.xaml.csInteractive_Mathematics.FrmTable
AppInteractive_Mathematicsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Interactive Mathematics\App.xaml.csInteractive_Mathematics.App
MainWindowInteractive_Mathematicsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Interactive Mathematics\MainWindow.xaml.csInteractive_Mathematics.MainWindow
BenchmarkUtilMathos Testingc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\BenchmarkUtil.csMathos.Testing.BenchmarkUtil
DenominatorNullExceptionMathos Exceptionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\MathosExceptions.csMathos.Exceptions .DenominatorNullException
InvalidCoordinateFormatMathos Exceptionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\MathosExceptions.csMathos.Exceptions .InvalidCoordinateFormat
InvalidFractionFormatExceptionMathos Exceptionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\MathosExceptions.csMathos.Exceptions .InvalidFractionFormatException
InvalidTriangleExceptionMathos Exceptionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\MathosExceptions.csMathos.Exceptions .InvalidTriangleException
ComplexNumberMathos Arithmetic ComplexNumbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\ComplexNumberType.csMathos.Arithmetic.ComplexNumbers .ComplexNumber
ComplexOperationMathos Arithmetic ComplexNumbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\ComplexNumberType.csMathos.Arithmetic.ComplexNumbers .ComplexOperation
INaturalNumberMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.INaturalNumber
IIntegerMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.IInteger
IRationalNumberMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers .IRationalNumber
CheckMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.Check
GetMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.Get
ConvertMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.Convert
IIRationalNumberMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers .IIRationalNumber
IRealNumberMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.IRealNumber
IImaginaryMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.IImaginary
IComplexMathos Arithmetic Numbersc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\NumberOperations.csMathos.Arithmetic.Numbers.IComplex
FractionMathos Arithmetic Fractionsc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Arithmetic\FractionType.csMathos.Arithmetic.Fractions.Fraction
CalculateMathos Geometry CoordinateGeometry TwoDimensionalc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Geometry\CoordinateGeometry.csMathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate
CoordinateMathos Geometry CoordinateGeometry TwoDimensionalc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\Geometry\CoordinateGeometry.csMathos.Geometry.CoordinateGeometry .TwoDimensional.Coordinate

Statistics

Stat   dirCorresponding   sourceFilePath
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warning    Rule warning: Types with source files stored in the same directory, should be declared in the same namespace
// <Name>Types with source files stored in the same directory, should be declared in the same namespace</Name>
warnif count > 0 

// Group JustMyCode types in a lookup 
// where groups are keyed with directories that contain the types' source file(s).
// Note that a type can be contained in several groups 
// if it is declared in several source files stored in different directories.
let lookup = JustMyCode.Types.Where(t => t.SourceFileDeclAvailable)
            
.ToMultiKeyLookup(
               
t => t.SourceDecls.Select(
                          
decl => decl.SourceFile.FilePath.ParentDirectoryPath).Distinct()
            
)


from groupOfTypes in lookup
let parentNamespaces = groupOfTypes.ParentNamespaces()

// Select group of types (with source files stored in the same directory) ...
// ... but contained in several namespaces
where parentNamespaces.Count() > 1

// mainNamespaces is the namespace that contains many types 
// declared in the directory groupOfTypes .key
let mainNamespace  = groupOfTypes
                     
.ToLookup(t => t.ParentNamespace)
                     
.OrderByDescending(g => g.Count()).First().Key

// Select types with source files stored in the same directory,
// but contained in namespaces different than mainNamespace.
let typesOutOfMainNamespace = groupOfTypes
                              
.Where(t => t.ParentNamespace != mainNamespace )

                               
// Filter types declared on several source files that contain generated methods 
                               // because typically such type contains one or several partial definitions generated.
                               // These partially generated types would be false positive for the present rule.
                               .Where(t => t.SourceDecls.Count() == 1 ||
                                           
t.Methods.Count(m => JustMyCode.Contains(m)) == 0)
where typesOutOfMainNamespace.Count() > 0

select new { mainNamespace, 

             
// Typically a type in typesOutOfMainNamespace ...
             // 1) ... is contained in the wrong namespace but its source file(s) is stored in the right directory.
             //      --> In such situation the type should be contained in mainNamespace.
             // 2) ... is contained in the right namespace but its source file(s) is stored in the wrong directory
             //      --> In such situation the source file of type must be moved to the parent namespace directory.
             // 3) ... is declared in multiple source files, stored in different directories.
             //      --> It would be preferable that all source files are stored in a single directory.
             typesOutOfMainNamespace   }

8 namespaces matched

namespacestypesOutOfMainNamespaceFull Name
MathosTest.Mathos_Main.Arithmetic3 typesMathosTest.Mathos_Main.Arithmetic
MathosTest1 typeMathosTest
MathosTest1 typeMathosTest
MathosTest.Calculus1 typeMathosTest.Calculus
MathosTest.Mathos_Main.SpecialFunctions1 typeMathosTest.Mathos_Main.SpecialFunctions
Mathos.Exceptions5 typesMathos.Exceptions
Mathos.Arithmetic13 typesMathos.Arithmetic
Mathos.Geometry.CoordinateGeometry .TwoDimensional1 typeMathos.Geometry.CoordinateGeometry .TwoDimensional

Statistics

Stat   typesOutOfMainNamespace
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Types declared in the same namespace, should have their source files stored in the same directory
// <Name>Types declared in the same namespace, should have their source files stored in the same directory</Name>
warnif count > 0 
from @namespace in Application.Namespaces

// Group types of @namespace in a lookup 
// where groups are keyed with directories that contain the types' source file(s).
// Note that a type can be contained in several groups 
// if it is declared in several source files stored in different directories.
let lookup = @namespace.ChildTypes.Where(t => t.SourceFileDeclAvailable && JustMyCode.Contains(t))
            
.ToMultiKeyLookup(
               
t => t.SourceDecls.Select(
                          
decl => decl.SourceFile.FilePath.ParentDirectoryPath).Distinct()
            
)

// Are types of @namespaces declared in more than one directory?
where lookup.Count > 1

// Infer the main folder, preferably the one that has the same name as the namespace.
let dirs = lookup.Select(types => types.Key)
let mainDirNullable = dirs.Where(d => d.DirectoryName == @namespace.SimpleName).FirstOrDefault()
let mainDir = mainDirNullable ?? dirs.First()

// Types declared out of mainDir, are types in group of types declared in a directory different than mainDir!
let typesDeclaredOutOfMainDir = lookup.Where(types => types.Key != mainDir)
                                
.SelectMany(types => types)
                                
                                
// Filter types declared on several source files that contain generated methods 
                                // because typically such type contains one or several partial definitions generated.
                                // These partially generated types would be false positive for the present rule.
                                .Where(t => t.SourceDecls.Count() == 1 ||
                                            
t.Methods.Count(m => JustMyCode.Contains(m)) == 0)

where typesDeclaredOutOfMainDir.Count() > 0

select new { @namespace, 

             
// Typically a type in typesDeclaredOutOfMainDir ...
             // 1) ... is contained in the wrong namespace but its source file(s) is stored in the right directory.
             //      --> In such situation the type parent namespace should be the namespace corresponding to the directory.
             // 2) ... is contained in the right namespace but its source file(s) is stored in the wrong directory
             //      --> In such situation the type source file should be moved to mainDir.
             // 3) ... is declared in multiple source files, stored in different directories.
             //      --> It would be preferable that all source files are stored in a single directory.
             typesDeclaredOutOfMainDir , 

             
mainDir = mainDir.ToString() }

3 namespaces matched

namespacestypesDeclaredOutOfMainDirmainDirFull Name
MathosTest11 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\ArithmeticMathosTest
MathosTest.Mathos_Main1 typec:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Statistics and DiceSimMathosTest.Mathos_Main
Mathos.Statistics3 typesc:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\StatisticsMathos.Statistics

Statistics

Stat   typesDeclaredOutOfMainDir   mainDir
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00

2670This group contains children groups
.NET Framework Usage  

  • 26 validated Rule(s)
  • 7 Rule(s) violated
  • 0 Rules or Queries with Error (syntax error, exception thrown, time-out)

850
System  

warning    Rule warning: Mark assemblies with CLSCompliant
// <Name>Mark assemblies with CLSCompliant</Name>
warnif count > 0 from a in Application.Assemblies where 
  
!a.HasAttribute ("System.CLSCompliantAttribute".AllowNoMatch())
select a

// The Common Language Specification (CLS) defines 
// naming restrictions, data types, and rules to which 
// assemblies must conform if they are to be used 
// across programming languages. Good design dictates 
// that all assemblies explicitly indicate CLS 
// compliance with CLSCompliantAttribute. If the 
// attribute is not present on an assembly, the 
// assembly is not compliant.

6 assemblies matched

assembliesFull Name
LaboratoryLaboratory
B_GeometryB_Geometry
MathosTestMathosTest
ProjectWebsiteProjectWebsite
Interactive MathematicsInteractive Mathematics
MathosMathos

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warning    Rule warning: Remove calls to GC.Collect()
// <Name>Remove calls to GC.Collect()</Name>
warnif count > 0 

let gcCollectMethods = ThirdParty.Methods.WithFullNameIn(
   
"System.GC.Collect()",
   
"System.GC.Collect(Int32)",
   
"System.GC.Collect(Int32,GCCollectionMode)")

from m in Application.Methods.UsingAny(gcCollectMethods)
select m

// It is preferrable to avoid calling GC.Collect() 
// explicitely in order to avoid some performance pitfall.
// More in information on this here:
// http://blogs.msdn.com/ricom/archive/2004/11/29/271829.aspx

5 methods matched

methodsFull Name
<Page_Load>b__a(Decimal[])ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__a (Decimal[])
<Page_Load>b__b(Decimal[])ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__b (Decimal[])
<Page_Load>b__c(Decimal[])ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__c (Decimal[])
<.ctor>b__b(Decimal[])Interactive_Mathematics.MainWindow+< >c__DisplayClass19.<.ctor>b__b(Decimal[] )
Benchmark(Action,Int32)Mathos.Testing.BenchmarkUtil.Benchmark (Action,Int32)

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warning    Rule warning: Don't call GC.Collect() without calling GC.WaitForPendingFinalizers()
// <Name>Don't call GC.Collect() without calling GC.WaitForPendingFinalizers()</Name>
warnif count > 0 

let gcCollectMethods = ThirdParty.Methods.WithFullNameIn(
   
"System.GC.Collect()",
   
"System.GC.Collect(Int32)",
   
"System.GC.Collect(Int32,GCCollectionMode)")

from m in Application.Methods.UsingAny(gcCollectMethods) where
  
!m.IsUsing ("System.GC.WaitForPendingFinalizers()".AllowNoMatch())
select new { m, m.NbLinesOfCode } 

// It is preferrable to avoid calling GC.Collect() 
// explicitely in order to avoid some performance 
// pitfall. But if you wish to call GC.Collect(), 
// you must do it this way:
//   GC.Collect();
//   GC.WaitForPendingFinalizers();
//   GC.Collect();
// To make sure that finalizer got executed, and 
// object with finalizer got cleaned properly.

4 methods matched

methods# lines of code (LOC)Full Name
<Page_Load>b__a(Decimal[])21ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__a (Decimal[])
<Page_Load>b__b(Decimal[])22ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__b (Decimal[])
<Page_Load>b__c(Decimal[])28ProjectWebsite._Default+< >c__DisplayClass1f.<Page_Load>b__c (Decimal[])
<.ctor>b__b(Decimal[])20Interactive_Mathematics.MainWindow+< >c__DisplayClass19.<.ctor>b__b(Decimal[] )

Statistics

Stat   # lines of code (LOC)
Sum:91
Average:22.75
Minimum:20
Maximum:28
Standard deviation:3.11
Variance:9.69
warning    Rule warning: Enum Storage should be Int32
// <Name>Enum Storage should be Int32</Name>
warnif count > 0 from f in Fields where 
   
f.Name == @"value__" && 
  
!f.FieldTypeIs ("System.Int32".AllowNoMatch()) &&
  
!f.IsThirdParty
select new { f, f.SizeOfInst, f.FieldType }

// An enumeration is a value type that defines 
// a set of related named constants. By default, 
// the System.Int32 data type is used to store 
// the constant value. Even though you can change 
// this underlying type, it is not necessary or 
// recommended for most scenarios. Note that there 
// is no significant performance gain in using 
// a data type smaller than Int32. If you cannot 
// use the default data type, you should use one 
// of the CLS-compliant integral types, Byte, 
// Int16, Int32, or Int64, to ensure that all of 
// the enumeration's values are representable in 
// CLS-compliant programming languages.

1 fields matched

fieldSize of instanceFieldTypeFull Name
value__1SByteMathos.Converter.Base.value__

Statistics

Stat   Size of instance   FieldType
Sum:10
Average:10
Minimum:10
Maximum:10
Standard deviation:00
Variance:00
warning    Rule warning: Do not raise too general exception types
// <Name>Do not raise too general exception types</Name>
warnif count > 0 from m in Application.Methods where
  
// Test for non-constructor, else this rule 
  // would warn on ctor of classes that derive 
  // from these exception types.
 !m.IsConstructor && (

    
m.CreateA("System.Exception".AllowNoMatch()) ||
    
m.CreateA("System.ApplicationException".AllowNoMatch()) ||
    
m.CreateA("System.SystemException".AllowNoMatch()) )
select m

11 methods matched

methodsFull Name
ReplaceRow(Int32,Vector)B_Geometry.BGeomMatrix.ReplaceRow(Int32 ,Vector)
GaussianElimination(BGeomMatrix,Vector ,Double[]&)B_Geometry.LinearAlgebra .GaussianElimination(BGeomMatrix,Vector ,Double[]&)
op_Addition(Vector,Vector)B_Geometry.Vector.op_Addition(Vector ,Vector)
op_Subtraction(Vector,Vector)B_Geometry.Vector.op_Subtraction(Vector ,Vector)
Subtract(Vector,Vector)B_Geometry.Vector.Subtract(Vector,Vector )
Subtract(Vector)B_Geometry.Vector.Subtract(Vector)
DotProduct(Vector)B_Geometry.Vector.DotProduct(Vector)
Cofactor()Mathos.Matrix.Cofactor()
Adjugate()Mathos.Matrix.Adjugate()
Inverse()Mathos.Matrix.Inverse()
GetNextTerm(Double[],Int32)Mathos.Calculus.FiniteCalculus .GetNextTerm(Double[],Int32)

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:

110
System.Collection  

warning    Rule warning: Collection properties should be read only
// <Name>Collection properties should be read only</Name>

// A writable collection property allows a user to replace the collection with 
// a completely different collection. A read-only property stops the collection 
// from being replaced but still allows the individual members to be set. 
// If replacing the collection is a goal, the preferred design pattern is to 
// include a method to remove all the elements from the collection 
// (with a call to the ICollection.Clear() method) and then re-populate the collection.

warnif count > 0

// First find collectionTypes 
let collectionInterfaces = ThirdParty.Types.WithFullNameIn(
               
"System.Collections.ICollection", "System.Collections.Generic.ICollection<T>")
where collectionInterfaces.Count() > 0
let collectionTypes = Types.ThatImplementAny(collectionInterfaces)
                      
.Union(collectionInterfaces).ToHashSet()

// Then find all property setters that have an associated 
// getter that returns a collection type.
from propGetter in Application.Methods.Where(
                          
m => m.IsPropertyGetter && 
                          
m.ReturnType != null &&
                          
collectionTypes.Contains(m.ReturnType))

let propSetter = propGetter.ParentType.Methods.WithSimpleName(
                    
propGetter.SimpleName.Replace("get_","set_"))
                  
.SingleOrDefault()

where  propSetter != null &&
      
!propSetter.IsPrivate

select new { propSetter, propGetter.ReturnType }

1 methods matched

methodReturnTypeFull Name
set_Elements(Double[])ArrayB_Geometry.Vector.set_Elements(Double[])

Statistics

Stat   ReturnType
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

010
System.Globalization  

warning    Rule warning: Float and Date Parsing must be culture aware
// <Name>Float and Date Parsing must be culture aware</Name>
warnif count > 0 
from m in ThirdParty.Types.WithFullNameIn( 
             
"System.DateTime", 
             
"System.Single", 
             
"System.Double",
             
"System.Decimal").ChildMethods()

  
where  m.NbParameters > 0 &&
        
(m.SimpleName == "Parse" || 
         
m.SimpleName == "ToString") &&
        
!m.Name.Contains("IFormatProvider")
select new { m, m.MethodsCallingMe }

2 methods matched

methodsMethodsCallingMeFull Name
Parse(String)1 methodSystem.Decimal.Parse(String)
Parse(String)3 methodsSystem.Double.Parse(String)

Statistics

Stat   MethodsCallingMe
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

Object Oriented Design

ok   Base class should not use derivatives
// <Name>Base class should not use derivatives</Name>
warnif count > 0 
from baseClass in JustMyCode.Types
where baseClass.IsClass && baseClass.NbChildren > 0 // <-- for optimization!
let derivedClassesUsed = baseClass.DerivedTypes.UsedBy(baseClass)
where derivedClassesUsed.Count() > 0
select new { baseClass, derivedClassesUsed }

No types matched

ok   Class shouldn't be too deep in inheritance tree
// <Name>Class shouldn't be too deep in inheritance tree</Name>
warnif count > 0 from t in JustMyCode.Types 
where t.IsClass
let baseClasses = t.BaseClasses.ExceptThirdParty()

// Warn for classes with 3 or more base classes.
// Notice that we don't count third-party classes 
// because this rule concerns your code design,
// not third-party libraries consumed design.
where baseClasses.Count() >= 3

select new { t, baseClasses, 
                
// The metric value DepthOfInheritance takes account
                // of third-party base classes
                t.DepthOfInheritance } 

// Branches too long in the derivation should be avoided.
// See the definition of the DepthOfInheritance metric here 
// http://www.ndepend.com/Metrics.aspx#DIT

No types matched

warning    Rule warning: Class with no descendant should be sealed if possible
// <Name>Class with no descendant should be sealed if possible</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsClass && 
  
t.NbChildren ==0 && 
 
!t.IsSealed && 
 
!t.IsStatic 
  
// && !t.IsPublic <-- You might want to add this condition 
  //                    if you are developing a framework
  //                    with classes that are intended to be 
  //                    sub-classed by your clients.
  orderby t.NbLinesOfCode descending
select new { t, t.NbLinesOfCode }

115 types matched

types# lines of code (LOC)Full Name
Matrix249Mathos.Matrix
Form1170B_Geometry.Form1
VectorsAndMatrices166MathosTest.VectorsAndMatrices
MainWindow122RubyInt.MainWindow
UncertainNumber112Mathos.Statistics.UncertainNumber
MainWindow99Interactive_Mathematics.MainWindow
BasisFunction98B_Geometry.BasisFunction
Shapes98MathosTest.Shapes
BGeomMatrix96B_Geometry.BGeomMatrix
TestofcomplexNumbers96MathosTest.TestofcomplexNumbers
Triangle93Mathos.Geometry.Shapes.Triangle
DoubleArthimeticTest90MathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegralApproximation88Laboratory.Module.IntegralApproximation
_Default87ProjectWebsite._Default
GeomUtils85B_Geometry.GeomUtils
Vector84Mathos.Vector
Vector83B_Geometry.Vector
Converter75Laboratory.Module.Converter
TestOfFractions75MathosTest.TestOfFractions
Get70Mathos.Arithmetic.Numbers.Get
Statistics57MathosTest.Statistics
Uncertainty52MathosTest.Uncertainty.Uncertainty
ComplexArithmeticTest50MathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest
ConverterTest48MathosTest.ConverterTest
LinearAlgebra45B_Geometry.LinearAlgebra
BCurve41B_Geometry.BCurve
Fibonacci41Mathos.PreCalculus.Sequences.Fibonacci
DiceSimulator40Mathos.Statistics.DiceSimulator
Trapezoid39Mathos.Geometry.Shapes.Trapezoid
DiscreteMathematics38MathosTest.DiscreteMathematics
FiniteCalculusTest38MathosTest.Mathos_Main.Calculus .FiniteCalculusTest
EquationSolver35Laboratory.Module.EquationSolver
Extension33RubyInt.Extension
RightCircularCone31Mathos.Geometry.Shapes.RightCircularCone
RightCircularCylinder31Mathos.Geometry.Shapes .RightCircularCylinder
RectangularPrism31Mathos.Geometry.Shapes.RectangularPrism
AngleConversionM30Mathos.Converter.AngleConversionM
SquarePyramid29Mathos.Geometry.Shapes.SquarePyramid
Uncertainty28Laboratory.Module.Uncertainty
coordinateStruct28MathosTest.coordinateStruct
CalculusTest27MathosTest.Calculus.CalculusTest
Rectangle27Mathos.Geometry.Shapes.Rectangle
Cube26Mathos.Geometry.Shapes.Cube
Circle26Mathos.Geometry.Shapes.Circle
RightTriangle26Mathos.Geometry.Shapes.RightTriangle
Parallelogram26Mathos.Geometry.Shapes.Parallelogram
NumberChecker25Laboratory.Module.NumberChecker
WebForm124Laboratory.Module.DataAnalysis.WebForm1
ElementaryTests24MathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
HelpWindow24RubyInt.HelpWindow
Square24Mathos.Geometry.Shapes.Square
PythagoreanTest23MathosTest.PythagoreanTest
Sphere23Mathos.Geometry.Shapes.Sphere
StatisticalDistributions20MathosTest.Mathos_Main .StatisticalDistributions
FinanceNetPresentValue18Laboratory.Module.Finance .FinanceNetPresentValue
LinearRegression17Laboratory.Module.DataAnalysis .LinearRegression
FinanceTest17MathosTest.FinanceTest
Check17Mathos.Arithmetic.Numbers.Check
Triangle16Laboratory.Module.Triangle
DataViewWindow16RubyInt.DataViewWindow
Calculate16Mathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate
BenchmarkUtil15Mathos.Testing.BenchmarkUtil
Ring15Mathos.Geometry.Shapes.Ring
GeometricProgression15Mathos.PreCalculus.Sequences .GeometricProgression
FinanceRemainingBalanceOfAnnuity14Laboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity
Program14B_Geometry.New.Program
GammaTests14MathosTest.Mathos_Main.SpecialFunctions .GammaTests
Ellipse14Mathos.Geometry.Shapes.Ellipse
GeomBox13B_Geometry.GeomBox
TemperatureConversion13Mathos.Converter.TemperatureConversion
LinearModels+LinearRegressionResults13Mathos.Statistics .LinearModels+LinearRegressionResults
FinanceAnnuityPaymentFutureValue12Laboratory.Module.Finance .FinanceAnnuityPaymentFutureValue
FinanceAnnuityPaymentPresentValue12Laboratory.Module.Finance .FinanceAnnuityPaymentPresentValue
FinanceFutureValue12Laboratory.Module.Finance .FinanceFutureValue
FinanceFutureValueOfAnAnnuity12Laboratory.Module.Finance .FinanceFutureValueOfAnAnnuity
FinancePresentValue12Laboratory.Module.Finance .FinancePresentValue
FinancePresentValueOfAnAnnuity12Laboratory.Module.Finance .FinancePresentValueOfAnAnnuity
DiceSimulatorTest12MathosTest.DiceSimulatorTest
SyntaxTest12MathosTest.Mathos_Main.SyntaxTest
ArithmeticProgression11Mathos.PreCalculus.Sequences .ArithmeticProgression
EquationSolverTest10MathosTest.EquationSolverTest
LinearModelsTest10MathosTest.LinearModelsTest
Torus10Mathos.Geometry.Shapes.Torus
Factorial9Laboratory.Module.Factorial
PreCalculus9MathosTest.PreCalculus
Statistics+Literals7MathosTest.Statistics+Literals
MyCompletionData7RubyInt.MyCompletionData
Register6Laboratory.Account.Register
TolerantUtilities6B_Geometry.TolerantUtilities
Convert6Mathos.Arithmetic.Numbers.Convert
App5RubyInt.App
FrmTable5Interactive_Mathematics.FrmTable
SingleArthimeticTest4MathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest
DenominatorNullException4Mathos.Exceptions .DenominatorNullException
InvalidCoordinateFormat4Mathos.Exceptions .InvalidCoordinateFormat
InvalidFractionFormatException4Mathos.Exceptions .InvalidFractionFormatException
InvalidTriangleException4Mathos.Exceptions .InvalidTriangleException
ResultsWindow3RubyInt.ResultsWindow
ConversionInfo3Mathos.Converter.ConversionInfo
ConversionBase3Mathos.Converter.ConversionBase

Statistics

Stat   # lines of code (LOC)
Sum:3 740
Average:32.52
Minimum:0
Maximum:249
Standard deviation:40.25
Variance:1 620
ok   Overrides of Method() should call base.Method()
// <Name>Overrides of Method() should call base.Method()</Name>
// Overrides of Method() should refine the behavior of base.Method().
// If base.Method() is not called, the base behavior is not refined but it is replaced.
// Violations of this rule are a sign of design flaw,
// especially if the design provides valid reasons 
// that advocates that the base behavior must be replaced and not refined.
//
// Discussions on this topic are available here:
//  http://stackoverflow.com/questions/1107022/should-i-call-the-base-class-implementation-when-overriding-a-method-in-c-sharp
//  http://stackoverflow.com/questions/2945147/make-sure-base-method-gets-called-in-c-sharp

warnif count > 0
from t in Types  // Take account of third-party types too

// Bother only classes with descendant
where t.IsClass && t.NbChildren > 0

from mBase in t.InstanceMethods
where  mBase.IsVirtual &&
      
!mBase.IsThirdParty &&
      
!mBase.IsAbstract && 
      
!mBase.IsExplicitInterfaceImpl
from mOverride in mBase.OverridesDirectDerived
where !mOverride.IsUsing(mBase)
select new { mOverride, shouldCall = mBase, definedInBaseClass = mBase.ParentType }

No methods matched

ok   Do not hide base class methods
// <Name>Do not hide base class methods</Name>
// 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.

// More on hiding vs. virtual usefulness here:
//  http://www.artima.com/intv/nonvirtual.html
//  http://blogs.msdn.com/b/ericlippert/archive/2008/05/21/method-hiding-apologia.aspx

warnif count > 0

// Define a lookup table indexing methods by their name including parameters signature.
let lookup = Methods.Where(m => !m.IsConstructor && !m.IsStatic && !m.IsGeneratedByCompiler)
                    
.ToLookup(m1 => m1.Name)

from t in Application.Types
where !t.IsStatic && t.IsClass &&
   
// Discard classes deriving directly from System.Object
   t.DepthOfInheritance > 1 
where t.BaseClasses.Any()

// For each methods not overriding any methods (new slot), 
// let's check if it hides by name some methods defined in base classe.
from m in t.InstanceMethods
where m.IsNewSlot && !m.IsExplicitInterfaceImpl && !m.IsGeneratedByCompiler

// Notice how lookup is used to quickly retrieve methods with same name as m.
// This makes the query 10 times faster than iterating each base methods to check their name.
let baseMethodsHidden = lookup[m.Name].Where(m1 => m1 != m && t.DeriveFrom(m1.ParentType))

where baseMethodsHidden.Count() > 0
select new { m, baseMethodsHidden }

No methods matched

warning    Rule warning: A stateless class or structure might be turned into a static type
// <Name>A stateless class or structure might be turned into a static type</Name>
// This rule indicates stateless types that might 
// eventually be turned into static classes.
warnif count > 0 from t in JustMyCode.Types where
  
!t.IsStatic &&                  
  
!t.IsGeneric &&
   
t.InstanceFields.Count() == 0 &&

   
// Don't match:
   // --> types that implement some interfaces.
   t.NbInterfacesImplemented == 0 &&

   
// --> or classes that have sub-classes children.                            
   t.NbChildren == 0 &&

   
// --> or classes that have a base class
   ((t.IsClass && t.DepthOfDeriveFrom("System.Object".AllowNoMatch()) == 1) ||
     
t.IsStructure) 

   
select t  

37 types matched

typesFull Name
GeometryVisUtilsB_Geometry.GeometryVisUtils
GeomUtilsB_Geometry.GeomUtils
LinearAlgebraB_Geometry.LinearAlgebra
ProgramB_Geometry.New.Program
TestofcomplexNumbersMathosTest.TestofcomplexNumbers
PreCalculusMathosTest.PreCalculus
DiceSimulatorTestMathosTest.DiceSimulatorTest
DiscreteMathematicsMathosTest.DiscreteMathematics
coordinateStructMathosTest.coordinateStruct
EquationSolverTestMathosTest.EquationSolverTest
FinanceTestMathosTest.FinanceTest
LinearModelsTestMathosTest.LinearModelsTest
PythagoreanTestMathosTest.PythagoreanTest
ShapesMathosTest.Shapes
ConverterTestMathosTest.ConverterTest
VectorsAndMatricesMathosTest.VectorsAndMatrices
TestOfFractionsMathosTest.TestOfFractions
StatisticsMathosTest.Statistics
Statistics+LiteralsMathosTest.Statistics+Literals
CalculusTestMathosTest.Calculus.CalculusTest
UnitTest1MathosTest.SpecialFunctions.UnitTest1
UncertaintyMathosTest.Uncertainty.Uncertainty
StatisticalDistributionsMathosTest.Mathos_Main .StatisticalDistributions
SyntaxTestMathosTest.Mathos_Main.SyntaxTest
DoubleArthimeticTestMathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegerArthimeticTestMathosTest.Mathos_Main.Arithmetic .IntegerArthimeticTest
DecimalArithmeticMathosTest.Mathos_Main.Arithmetic .DecimalArithmetic
FiniteCalculusTestMathosTest.Mathos_Main.Calculus .FiniteCalculusTest
ElementaryTestsMathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
GammaTestsMathosTest.Mathos_Main.SpecialFunctions .GammaTests
BenchmarkUtilMathos.Testing.BenchmarkUtil
AngleConversionMMathos.Converter.AngleConversionM
TemperatureConversionMathos.Converter.TemperatureConversion
CheckMathos.Arithmetic.Numbers.Check
GetMathos.Arithmetic.Numbers.Get
ConvertMathos.Arithmetic.Numbers.Convert
CalculateMathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warning    Rule warning: Non-static classes should be instantiated or turned to static
// <Name>Non-static classes should be instantiated or turned to static</Name>
// Notice that classes only instantiated through reflection, like plug-in root classes
// are matched by this rules.
warnif count > 0
from t in JustMyCode.Types
where  t.IsClass &&
    
//!t.IsPublic &&   // if you are developing a framework, 
                       // you might not want to match public classes
      !t.IsStatic && 
      
!t.IsAttributeClass && // Attributes class are never seen as instantiated
      !t.DeriveFrom("System.MarshalByRefObject".AllowNoMatch()) // Types instantiated through remoting infrastructure
       
// find the first constructor of t called
let ctorCalled = t.Constructors.FirstOrDefault(ctor => ctor.NbMethodsCallingMe > 0)

// match t if none of its constructors is called.
where ctorCalled == null
select new { t, t.Visibility }

73 types matched

typesVisibilityFull Name
AboutPublicLaboratory.About
DefaultPublicLaboratory.Default
GlobalPublicLaboratory.Global
ModulesPublicLaboratory.Modules
SiteMasterPublicLaboratory.SiteMaster
ChangePasswordPublicLaboratory.Account.ChangePassword
ChangePasswordSuccessPublicLaboratory.Account.ChangePasswordSuccess
LoginPublicLaboratory.Account.Login
RegisterPublicLaboratory.Account.Register
ConverterPublicLaboratory.Module.Converter
EquationSolverPublicLaboratory.Module.EquationSolver
FactorialPublicLaboratory.Module.Factorial
IntegralApproximationPublicLaboratory.Module.IntegralApproximation
MConverterPublicLaboratory.Module.MConverter
NumberCheckerPublicLaboratory.Module.NumberChecker
TrianglePublicLaboratory.Module.Triangle
UncertaintyPublicLaboratory.Module.Uncertainty
LinearRegressionPublicLaboratory.Module.DataAnalysis .LinearRegression
WebForm1PublicLaboratory.Module.DataAnalysis.WebForm1
FinanceAnnuityPaymentFutureValuePublicLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue
FinanceAnnuityPaymentPresentValuePublicLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue
FinanceFutureValuePublicLaboratory.Module.Finance .FinanceFutureValue
FinanceFutureValueOfAnAnnuityPublicLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity
FinanceNetPresentValuePublicLaboratory.Module.Finance .FinanceNetPresentValue
FinancePresentValuePublicLaboratory.Module.Finance .FinancePresentValue
FinancePresentValueOfAnAnnuityPublicLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity
FinanceRemainingBalanceOfAnnuityPublicLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity
Form1PublicB_Geometry.Form1
GeomBoxPublicB_Geometry.GeomBox
GeometryVisUtilsPublicB_Geometry.GeometryVisUtils
GeomUtilsInternalB_Geometry.GeomUtils
LinearAlgebraPublicB_Geometry.LinearAlgebra
ProgramPublicB_Geometry.New.Program
TestofcomplexNumbersPublicMathosTest.TestofcomplexNumbers
PreCalculusPublicMathosTest.PreCalculus
DiceSimulatorTestPublicMathosTest.DiceSimulatorTest
DiscreteMathematicsPublicMathosTest.DiscreteMathematics
coordinateStructPublicMathosTest.coordinateStruct
EquationSolverTestPublicMathosTest.EquationSolverTest
FinanceTestPublicMathosTest.FinanceTest
LinearModelsTestPublicMathosTest.LinearModelsTest
PythagoreanTestPublicMathosTest.PythagoreanTest
ShapesPublicMathosTest.Shapes
ConverterTestPublicMathosTest.ConverterTest
VectorsAndMatricesPublicMathosTest.VectorsAndMatrices
TestOfFractionsPublicMathosTest.TestOfFractions
StatisticsPublicMathosTest.Statistics
Statistics+LiteralsPrivateMathosTest.Statistics+Literals
CalculusTestPublicMathosTest.Calculus.CalculusTest
UnitTest1PublicMathosTest.SpecialFunctions.UnitTest1
UncertaintyPublicMathosTest.Uncertainty.Uncertainty
StatisticalDistributionsPublicMathosTest.Mathos_Main .StatisticalDistributions
SyntaxTestPublicMathosTest.Mathos_Main.SyntaxTest
ComplexArithmeticTestPublicMathosTest.Mathos_Main.Arithmetic .ComplexArithmeticTest
DoubleArthimeticTestPublicMathosTest.Mathos_Main.Arithmetic .DoubleArthimeticTest
IntegerArthimeticTestPublicMathosTest.Mathos_Main.Arithmetic .IntegerArthimeticTest
SingleArthimeticTestPublicMathosTest.Mathos_Main.Arithmetic .SingleArthimeticTest
DecimalArithmeticPublicMathosTest.Mathos_Main.Arithmetic .DecimalArithmetic
FiniteCalculusTestPublicMathosTest.Mathos_Main.Calculus .FiniteCalculusTest
ElementaryTestsPublicMathosTest.Mathos_Main.SpecialFunctions .ElementaryTests
GammaTestsPublicMathosTest.Mathos_Main.SpecialFunctions .GammaTests
MainWindowPublicRubyInt.MainWindow
_DefaultPublicProjectWebsite._Default
MainWindowPublicInteractive_Mathematics.MainWindow
BenchmarkUtilPublicMathos.Testing.BenchmarkUtil
AngleConversionMPublicMathos.Converter.AngleConversionM
TemperatureConversionPublicMathos.Converter.TemperatureConversion
NumberListPublicMathos.Statistics.NumberList
CheckPublicMathos.Arithmetic.Numbers.Check
GetPublicMathos.Arithmetic.Numbers.Get
ConvertPublicMathos.Arithmetic.Numbers.Convert
CalculatePublicMathos.Geometry.CoordinateGeometry .TwoDimensional.Calculate
FibonacciPublicMathos.PreCalculus.Sequences.Fibonacci

Statistics

Stat   Visibility
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Methods should be declared static if possible
// <Name>Methods should be declared static if possible</Name>
warnif count > 0

// When an instance method can be safely declared as static you should declare it as static.
// Since it doesn't use any instance data and method of its type and base-types,
// you should consider if such a method could be moved to a static utility class
// or if it is strongly related enough to its current declaring type to stay in it.
//
// Turning an instance method into a static method is a micro performance optimization
// since a static method is a bit cheaper to invoke than an instance method.

from t in JustMyCode.Types.Where(t =>
   
!t.IsStatic && !t.IsInterface &&
   
!t.IsEnumeration && !t.IsDelegate &&
   
!t.IsGeneratedByCompiler)

let methodsThatCanBeMadeStatic = 
   
from m in t.InstanceMethods

   
// An instance method can be turned to static if it is not virtual, 
   // not using the this reference and also, not using
   // any of its class or base classes instance fields or instance methods.
   where !m.IsAbstract && !m.IsVirtual &&
         
!m.AccessThis && !m.IsExplicitInterfaceImpl &&

          
// Optimization: Using FirstOrDefault() avoid to check all members, 
          //               as soon as one member is found
          //               we know the method m cannot be made static.
          m.MembersUsed.FirstOrDefault(
              
mUsed => !mUsed.IsStatic && 
                       
(mUsed.ParentType == t || 
                        
t.DeriveFrom(mUsed.ParentType))
          
) == null 
   
select m

from m in methodsThatCanBeMadeStatic
let staticFieldsUsed = m.ParentType.StaticFields.UsedBy(m).Where(f => !f.IsGeneratedByCompiler)
select new { m, staticFieldsUsed }

229 methods matched

methodsstaticFieldsUsedFull Name
Page_Load(Object,EventArgs)0 fieldLaboratory.About.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Default.Page_Load(Object ,EventArgs)
Application_Start(Object,EventArgs)0 fieldLaboratory.Global.Application_Start (Object,EventArgs)
Application_End(Object,EventArgs)0 fieldLaboratory.Global.Application_End(Object ,EventArgs)
Application_Error(Object,EventArgs)0 fieldLaboratory.Global.Application_Error (Object,EventArgs)
Session_Start(Object,EventArgs)0 fieldLaboratory.Global.Session_Start(Object ,EventArgs)
Session_End(Object,EventArgs)0 fieldLaboratory.Global.Session_End(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Modules.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.SiteMaster.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Account.ChangePassword .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Account.ChangePasswordSuccess .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.EquationSolver .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Factorial.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.IntegralApproximation .Page_Load(Object,EventArgs)
EvaluateExpression(String,Double)0 fieldLaboratory.Module.IntegralApproximation .EvaluateExpression(String,Double)
IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)0 fieldLaboratory.Module.IntegralApproximation .IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)
IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)0 fieldLaboratory.Module.IntegralApproximation .IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)
IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)0 fieldLaboratory.Module.IntegralApproximation .IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.NumberChecker .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Triangle.Page_Load (Object,EventArgs)
ToDoubleC(String)0 fieldLaboratory.Module.Triangle.ToDoubleC (String)
pow(Decimal,Decimal)0 fieldLaboratory.Module.Uncertainty.pow (Decimal,Decimal)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.DataAnalysis .LinearRegression.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.DataAnalysis.WebForm1 .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceFutureValue.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity.Page_Load (Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceNetPresentValue.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinancePresentValue.Page_Load(Object ,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .Page_Load(Object,EventArgs)
Page_Load(Object,EventArgs)0 fieldLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .Page_Load(Object,EventArgs)
glControl1_MouseUp(Object,MouseEventArgs )1 fieldB_Geometry.Form1.glControl1_MouseUp (Object,MouseEventArgs)
glControl1_MouseDown(Object ,MouseEventArgs)2 fieldsB_Geometry.Form1.glControl1_MouseDown (Object,MouseEventArgs)
button1_Click(Object,EventArgs)1 fieldB_Geometry.Form1.button1_Click(Object ,EventArgs)
DrawCurve(Double)1 fieldB_Geometry.Form1.DrawCurve(Double)
DrawCube()0 fieldB_Geometry.Form1.DrawCube()
AreApproximatelyEqual(Double,Double)0 fieldMathosTest.TestofcomplexNumbers .AreApproximatelyEqual(Double,Double)
IsApproximatelyZero(Double)0 fieldMathosTest.TestofcomplexNumbers .IsApproximatelyZero(Double)
ComplexNumberConstructorsWithNonZeroValu edParameters()0 fieldMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithNonZeroVal uedParameters()
ComplexNumberConstructorsWithZeroValuedP arameters()0 fieldMathosTest.TestofcomplexNumbers .ComplexNumberConstructorsWithZeroValued Parameters()
TestEqualityOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestEqualityOfComplexNos()
TestAdditionOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestAdditionOfComplexNos()
TestSubtractionOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestSubtractionOfComplexNos()
TestMultiplicationOfComplexNos()0 fieldMathosTest.TestofcomplexNumbers .TestMultiplicationOfComplexNos()
TestComplexFractionFromString()0 fieldMathosTest.TestofcomplexNumbers .TestComplexFractionFromString()
CalculateSum()0 fieldMathosTest.PreCalculus.CalculateSum()
ArithmeticProgression()0 fieldMathosTest.PreCalculus .ArithmeticProgression()
GeometricProgression()0 fieldMathosTest.PreCalculus .GeometricProgression()
DiceDiff()0 fieldMathosTest.DiceSimulatorTest.DiceDiff()
Find()0 fieldMathosTest.DiscreteMathematics.Find()
FindLargePrimes()0 fieldMathosTest.DiscreteMathematics .FindLargePrimes()
Factorial()0 fieldMathosTest.DiscreteMathematics.Factorial ()
Remainder()0 fieldMathosTest.DiscreteMathematics.Remainder ()
FactorialBigIntegerTest()0 fieldMathosTest.DiscreteMathematics .FactorialBigIntegerTest()
OtherStuff()0 fieldMathosTest.DiscreteMathematics .OtherStuff()
IsDivisibleBy()0 fieldMathosTest.DiscreteMathematics .IsDivisibleBy()
GetFactors()0 fieldMathosTest.DiscreteMathematics .GetFactors()
CoordinateBasic()0 fieldMathosTest.coordinateStruct .CoordinateBasic()
TestingExtensionMethods()0 fieldMathosTest.coordinateStruct .TestingExtensionMethods()
TestVisualRepresentation()0 fieldMathosTest.coordinateStruct .TestVisualRepresentation()
QuadraticEquationExTest()0 fieldMathosTest.EquationSolverTest .QuadraticEquationExTest()
QuadraticEquationTest()0 fieldMathosTest.EquationSolverTest .QuadraticEquationTest()
SystemOfTwoEquationsTest()0 fieldMathosTest.EquationSolverTest .SystemOfTwoEquationsTest()
FutureValue()0 fieldMathosTest.FinanceTest.FutureValue()
PresentValue()0 fieldMathosTest.FinanceTest.PresentValue()
NetPresentValue()0 fieldMathosTest.FinanceTest.NetPresentValue()
PresentValueOfAnnuity()0 fieldMathosTest.FinanceTest .PresentValueOfAnnuity()
FutureValueOfAnnuity()0 fieldMathosTest.FinanceTest .FutureValueOfAnnuity()
AnnuityPaymentPresentValue()0 fieldMathosTest.FinanceTest .AnnuityPaymentPresentValue()
AnnuityPaymentFutureValue()0 fieldMathosTest.FinanceTest .AnnuityPaymentFutureValue()
RemainingBalanceOfAnnuity()0 fieldMathosTest.FinanceTest .RemainingBalanceOfAnnuity()
PredictionTest()0 fieldMathosTest.LinearModelsTest .PredictionTest()
TestDiff()0 fieldMathosTest.LinearModelsTest.TestDiff()
FindHypotenuse()0 fieldMathosTest.PythagoreanTest .FindHypotenuse()
FindHypotenuseValidateInputs()0 fieldMathosTest.PythagoreanTest .FindHypotenuseValidateInputs()
FindNonHypotenuse()0 fieldMathosTest.PythagoreanTest .FindNonHypotenuse()
FindNonHypotenuseValidateInputs()0 fieldMathosTest.PythagoreanTest .FindNonHypotenuseValidateInputs()
CircleTest()0 fieldMathosTest.Shapes.CircleTest()
CubeTest()0 fieldMathosTest.Shapes.CubeTest()
ParallelogramTest()0 fieldMathosTest.Shapes.ParallelogramTest()
RectangleTest()0 fieldMathosTest.Shapes.RectangleTest()
RectangularPrismTest()0 fieldMathosTest.Shapes.RectangularPrismTest()
RightCircularConeTest()0 fieldMathosTest.Shapes.RightCircularConeTest( )
RightCircularCylinderTest()0 fieldMathosTest.Shapes .RightCircularCylinderTest()
SphereTest()0 fieldMathosTest.Shapes.SphereTest()
SquareTest()0 fieldMathosTest.Shapes.SquareTest()
SquarePyramidTest()0 fieldMathosTest.Shapes.SquarePyramidTest()
TrapezoidTest()0 fieldMathosTest.Shapes.TrapezoidTest()
RightTriangleTest()0 fieldMathosTest.Shapes.RightTriangleTest()
TriangleTest()0 fieldMathosTest.Shapes.TriangleTest()
LengthConversion()0 fieldMathosTest.ConverterTest .LengthConversion()
SpeedConversion()0 fieldMathosTest.ConverterTest.SpeedConversion ()
MassConversion()0 fieldMathosTest.ConverterTest.MassConversion( )
VolumeConversion()0 fieldMathosTest.ConverterTest .VolumeConversion()
AreaConversion()0 fieldMathosTest.ConverterTest.AreaConversion( )
PressureConversion()0 fieldMathosTest.ConverterTest .PressureConversion()
PowerConversion()0 fieldMathosTest.ConverterTest.PowerConversion ()
BaseConversions()0 fieldMathosTest.ConverterTest.BaseConversions ()
UnitConverterTest()0 fieldMathosTest.ConverterTest .UnitConverterTest()

Statistics

Stat   staticFieldsUsed
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Constructor should not call a virtual methods
// <Name>Constructor should not call a virtual methods</Name>

// Returns constructor of a non-sealed type calling virtual methods.
// In such a situation, if a derived class overrides the method,
// then the override method will be called before the derived constructor.
// This makes the class fragile to derive from.
//
// Violations reported can be solved by re-designing object initialisation
// or by marking the parent class as sealed, if possible.

warnif count > 0
from t in Application.Types where 
   
t.IsClass &&
  
!t.IsGeneratedByCompiler &&
  
!t.IsSealed

from ctor in t.Constructors 
let virtualMethodsCalled = from mCalled in ctor.MethodsCalled
                           
where mCalled.IsVirtual &&
                                
(mCalled.ParentType == t ||
                                 
t.DeriveFrom(mCalled.ParentType))
                           
select mCalled
where virtualMethodsCalled.Count() > 0

select new { ctor , 
             
virtualMethodsCalled, 
             
// If there is no derived type, it might be 
             // an opportunity to mark t as sealed.
             t.DerivedTypes }

6 methods matched

methodsvirtualMethodsCalledDerivedTypesFull Name
.ctor()1 method0 typeRubyInt.HelpWindow..ctor()
.ctor()1 method0 typeRubyInt.ResultsWindow..ctor()
.ctor(MainWindow)1 method0 typeRubyInt.DataViewWindow..ctor(MainWindow)
.ctor()1 method0 typeRubyInt.MainWindow..ctor()
.ctor()1 method0 typeInteractive_Mathematics.FrmTable..ctor()
.ctor()1 method0 typeInteractive_Mathematics.MainWindow..ctor ()

Statistics

Stat   virtualMethodsCalled   DerivedTypes
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
ok   Avoid the Singleton pattern
//<Name>Avoid the Singleton pattern</Name>
warnif count > 0
from t in Application.Types
where !t.IsStatic && !t.IsAbstract && (t.IsClass || t.IsStructure)

// All ctors of a singleton are private
where t.Constructors.Where(ctor => !ctor.IsPrivate).Count() == 0

// A singleton contains one static field of its parent type, to reference the unique instance
let staticFieldInstances = t.StaticFields.WithFieldType(t)
where staticFieldInstances.Count() == 1
select new { t, staticFieldInstance = staticFieldInstances.First() }

// The Singleton pattern consists in syntactically enforcing that a class 
// has just one unique instance.
// At first glance, this pattern looks appealing and it is widely used.
// However, we discourage you from using singleton classes because experience
// shows that singletons often result in less testable and less maintainable code.
// More details available in these discussions:
//  http://codebetter.com/patricksmacchia/2011/05/04/back-to-basics-usage-of-static-members/
//  http://adamschepis.com/blog/2011/05/02/im-adam-and-im-a-recovering-singleton-addict/

No types matched

warning    Rule warning: Don't assign static fields from instance methods
// <Name>Don't assign static fields from instance methods</Name>
// Assigning static fields from instance methods leads to
// poorly maintainable and non thread-safe code.
// It is advised to assign static fields inline or from class constructor.
warnif count > 0
from f in Application.Fields where 
  
f.IsStatic &&
 
!f.IsLiteral &&
 
!f.IsInitOnly &&
 
!f.IsGeneratedByCompiler &&
  
// Contract API define such a insideContractEvaluation static field
  f.Name != "insideContractEvaluation"
let assignedBy = f.MethodsAssigningMe.Where(m => !m.IsStatic)
where assignedBy .Count() > 0
select new { f, assignedBy }

2 fields matched

fieldsassignedByFull Name
session_curve1 methodB_Geometry.Form1.session_curve
mouse_clicked2 methodsB_Geometry.Form1.mouse_clicked

Statistics

Stat   assignedBy
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warning    Rule warning: Avoid empty interfaces
// <Name>Avoid empty interfaces</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsInterface && 
  
t.NbMethods == 0
select new { t, t.TypesThatImplementMe }

// 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.

7 types matched

typesTypesThatImplementMeFull Name
INaturalNumber5 typesMathos.Arithmetic.Numbers.INaturalNumber
IInteger4 typesMathos.Arithmetic.Numbers.IInteger
IRationalNumber3 typesMathos.Arithmetic.Numbers .IRationalNumber
IIRationalNumber2 typesMathos.Arithmetic.Numbers .IIRationalNumber
IRealNumber1 typeMathos.Arithmetic.Numbers.IRealNumber
IImaginary1 typeMathos.Arithmetic.Numbers.IImaginary
IComplex0 typeMathos.Arithmetic.Numbers.IComplex

Statistics

Stat   TypesThatImplementMe
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
ok   Avoid types initialization cycles
// <Name>Avoid types initialization cycles</Name>
warnif count > 0

// The class constructor (also called static constructor, and named cctor in IL code)
// of a type, if any, is executed by the CLR at runtime, the first time the type is used.
// A cctor doesn't need to be explicitely declared in C# or VB.NET, to exist in compiled IL code.
// Having a static field inline initialization is enought to have 
// the cctor implicitely declared in the parent class or structure.
//
// If the cctor of a type t1 is using the type t2 and if the cctor of t2 is using t1,
// some type initialization unexpected and hard-to-diagnose buggy behavior can occur.
// Such a cyclic chain of initialization is not necessarily limited to two types
// and can embrace N types in the general case.
// More information on types initialization cycles can be found here:
// http://msmvps.com/blogs/jon_skeet/archive/2012/04/07/1808561.aspx
 
// The present code rule enumerates types initialization cycles.
// Some false positives can appear if some lambda expressions are defined 
// in cctors or in methods called by cctors. In such situation, this rule
// considers these lambda expressions as executed at type initialization time, 
// while it is not necessarily the case.
 
// Types initialization cycle can only happen between types of an assembly.
from assembly in Application.Assemblies
                
let cctorSuspects = assembly.ChildMethods.Where(
  
m => m.IsClassConstructor &&
       
// Optimization: types involved in a type cycle necessarily don't have type level.
       m.ParentType.Level == null)

where cctorSuspects.Count() > 1
let typesSuspects = cctorSuspects.ParentTypes().ToHashSet()

//
// dicoTmp associates to each type suspect T, a set of types from typesSuspects
// that contains at least a method or a field used directly or indirectly by the cctor of T.
//
let dicoTmp = cctorSuspects.ToDictionary(
    
cctor => cctor.ParentType,
    
cctor => ((IMember)cctor).ToEnumerable().FillIterative(
              
members => from m in members 
                         
from mUsed in (m is IMethod) ? (m as IMethod).MembersUsed : new IMember[0]
                         
where mUsed.ParentAssembly == assembly 
                         
select mUsed)
              
.DefinitionDomain
              
.Select(m => m.ParentType) // Don't need .Distinct() here, because of ToHashSet() below.
              .Except(cctor.ParentType)
              
.Intersect(typesSuspects)
              
.ToHashSet()
) 

//
// dico associates to each type suspect T, the set of types initialized (directly or indirectly)
// by the initialization of T. This second step is needed, because if a cctor of a type T1 
// calls a member of a type T2, not only the cctor of T1 triggers the initialization of T2,
// but also it triggers the initialization of all types that are initialized by T2 initialization.
//
let dico = typesSuspects.Where(t => dicoTmp[t].Count() > 0).ToDictionary(
   
typeSuspect => typeSuspect,
   
typeSuspect => typeSuspect.ToEnumerable().FillIterative(
                         
types => from t in types
                                  
from tUsed in dicoTmp[t]
                                  
select tUsed)
                   
.DefinitionDomain
                   
.Except(typeSuspect)
                   
.ToHashSet()
)


//
// Now that dico is prepared, detect the cctor cycles
//
from t in dico.Keys

   
// Thanks to the work done to build dico, it is now pretty easy
   // to spot types involved in an initialization cyle with t! 
   let usersAndUseds = from tTmp in dico[t]
                       
where dico.ContainsKey(tTmp) && dico[tTmp].Contains(t)
                       
select tTmp
   
where usersAndUseds.Count() > 0
 
   
// Here we've found type(s) both using and used by the suspect type.
   // A cycle involving the type t is found!
   let typeInitCycle = usersAndUseds.Append(t)


   
// Compute methodsCalled and fieldsUsed, useful to explore
   // how a cctor involved in a type initialization cycle, triggers other type initialization.
   let methodsCalledDepth = assembly.ChildMethods.DepthOfIsUsedBy(t.ClassConstructor)
   
let fieldsUsedDepth = assembly.ChildFields.DepthOfIsUsedBy(t.ClassConstructor)

   
let methodsCalled = methodsCalledDepth.DefinitionDomain.OrderBy(m => methodsCalledDepth[m]).ToArray()
   
let fieldsUsed = fieldsUsedDepth.DefinitionDomain.OrderBy(f => fieldsUsedDepth[f]).ToArray()

// Use the tick box to: Group cctors methods By parent types
select new { t.ClassConstructor, 
             
cctorsCycle= typeInitCycle.Select(tTmp => tTmp.ClassConstructor),

             
// methodsCalled and fieldsUsed are members used directly and indirectly by the cctor.
             // Export these members to the dependency graph (right click the cell Export/Append ... to the Graph)
             // and see how the cctor trigger the initialization of other types
             methodsCalled,
             
fieldsUsed 
}

No methods matched

API Breaking Changes

ok   API Breaking Changes: Types
// <Name>API Breaking Changes: Types</Name>
// This rule warns if a publicly visible type is 
// not publicly visible anymore or if it has been removed.
// Such type can break the code of your clients.

warnif count > 0 from t in codeBase.OlderVersion().Application.Types
where t.IsPubliclyVisible && 

     
// The type has been removed and its parent assembly hasn't been removed ...
     ( (t.WasRemoved() && !t.ParentAssembly.WasRemoved()) ||

     
// ... or the type is not publicly visible anymore
       !t.WasRemoved() && !t.NewerVersion().IsPubliclyVisible)

select new { t,
             
NewVisibility = (t.WasRemoved() ? " " : t.NewerVersion().Visibility.ToString()) }

No types matched

ok   API Breaking Changes: Methods
// <Name>API Breaking Changes: Methods</Name>
// This rule warns if a publicly visible method is 
// not publicly visible anymore or if it has been removed.
// Such method can break the code of your clients.

warnif count > 0 from m in codeBase.OlderVersion().Application.Methods
where m.IsPubliclyVisible && 

     
// The method has been removed and its parent type hasn't been removed ...
     ( (m.WasRemoved() && !m.ParentType.WasRemoved()) ||

     
// ... or the method is not publicly visible anymore
       !m.WasRemoved() && !m.NewerVersion().IsPubliclyVisible)

select new { m,
             
NewVisibility = (m.WasRemoved() ? " " : m.NewerVersion().Visibility.ToString()) }

No methods matched

ok   API Breaking Changes: Fields
// <Name>API Breaking Changes: Fields</Name>
// This rule warns if a publicly visible field is 
// not publicly visible anymore or if it has been removed.
// Such field can break the code of your clients.

warnif count > 0 from f in codeBase.OlderVersion().Application.Fields
where f.IsPubliclyVisible &&

     
// The field has been removed and its parent type hasn't been removed ...
     ( (f.WasRemoved() && !f.ParentType.WasRemoved()) ||

     
// ... or the field is not publicly visible anymore
       !f.WasRemoved() && !f.NewerVersion().IsPubliclyVisible)

select new { f,
             
NewVisibility = (f.WasRemoved() ? " " : f.NewerVersion().Visibility.ToString()) }

No fields matched

ok   API Breaking Changes: Interfaces and Abstract Classes
// <Name>API Breaking Changes: Interfaces and Abstract Classes</Name>
// This rule warns if a publicly visible interface or abstract class 
// has been changed and contains new abstract methods or 
// if some abstract methods have been removed.
// This can break the code of clients 
// that implement such interface or derive from such abstract class.

warnif count > 0 from tNewer in Application.Types where 
 
(tNewer.IsInterface || tNewer.IsClass && tNewer.IsAbstract) && 
  
tNewer.IsPubliclyVisible && 
  
tNewer.IsPresentInBothBuilds()

let tOlder = tNewer.OlderVersion() where tOlder.IsPubliclyVisible

let methodsRemoved = tOlder.Methods.Where(m => m.IsAbstract && m.WasRemoved())
let methodsAdded = tNewer.Methods.Where(m => m.IsAbstract && m.WasAdded())

where methodsAdded.Count() > 0 || methodsRemoved.Count() > 0
select new { tNewer, methodsAdded, methodsRemoved }

No types matched

ok   Broken serializable types
// <Name>Broken serializable types</Name>
// Find breaking changes in types marked with SerializableAttribute.
warnif count > 0

from t in Application.Types where

  
// Collect types tagged with SerializableAttribute
  t.HasAttribute("System.SerializableAttribute".AllowNoMatch())  && 
 
!t.IsDelegate &&
  
t.IsPresentInBothBuilds() &&
  
t.HasAttribute(t)

  
// Find newer and older versions of NonSerializedAttribute
  let newNonSerializedAttribute = ThirdParty.Types.WithFullName("System.NonSerializedAttribute").SingleOrDefault()
  
let oldNonSerializedAttribute = newNonSerializedAttribute == null ? null : newNonSerializedAttribute.OlderVersion()

  
// Find added or removed fields not marked with NonSerializedAttribute
  let addedInstanceField = from f in t.InstanceFields where 
                             
f.WasAdded() && 
                             
(newNonSerializedAttribute == null || !f.HasAttribute(newNonSerializedAttribute))
                           
select f
  
let removedInstanceField = from f in t.OlderVersion().InstanceFields where 
                             
f.WasRemoved() && 
                             
(oldNonSerializedAttribute == null || !f.HasAttribute(oldNonSerializedAttribute))
                           
select f
  
where addedInstanceField.Count() > 0 || removedInstanceField.Count() > 0

select new { t, addedInstanceField, removedInstanceField }

// From http://msdn.microsoft.com/library/system.serializableattribute.aspx :
//   All the public and private fields in a type that are marked by the 
//   SerializableAttribute  are serialized by default, unless the type 
//   implements the ISerializable interface to  override the serialization process. 
//   The default serialization process excludes fields that are marked 
//   with the NonSerializedAttribute attribute.

No types matched

ok   Avoid transforming immutable types into mutable types
// <Name>Avoid transforming immutable types into mutable types</Name>

// Immutability is a strong property on a type.
// Breaking immutability can result in serious problem for an algorithm consummer
// that has been written taking account of the type immutability.

// To visualize changes in code, right-click a matched type and select:
//  - Compare older and newer versions of source file
//  - Compare older and newer versions disassembled with Reflector

warnif count > 0 
from t in Application.Types where
  
t.IsPresentInBothBuilds() &&
 
!t.IsStatic &&
 
!t.IsImmutable && 
  
t.OlderVersion().IsImmutable

let mutableFields = from f in t.InstanceFields where !f.IsImmutable select f

select new { t, mutableFields }

No types matched

ok   Avoid changing enumerations Flags status
// <Name>Avoid changing enumerations Flags status</Name>

// Being tagged with the Flags attribute is a strong property for an enumeration.
// Changing the Flags status of an enumeration has significant impact for its client.
warnif count > 0 

let oldFlags = codeBase.OlderVersion().ThirdParty.Types.WithFullName("System.FlagsAttribute").SingleOrDefault()
let newFlags = ThirdParty.Types.WithFullName("System.FlagsAttribute").SingleOrDefault()
where oldFlags != null && newFlags != null

from t in Application.Types where
  
t.IsEnumeration &&
  
t.IsPresentInBothBuilds() 
let isFlags = t.HasAttribute(newFlags)
let wasFlags = t.OlderVersion().HasAttribute(oldFlags) 
where isFlags != wasFlags
select new { t, isFlags, wasFlags }

No types matched

ok   API: New publicly visible types
// <Name>API: New publicly visible types</Name>
// List types that are new in the public surface of your assemblies

from t in Application.Types
where t.IsPubliclyVisible && 

     
// The type has been removed and its parent assembly hasn't been removed ...
     ( (t.WasAdded() && !t.ParentAssembly.WasAdded()) ||

     
// ... or the type existed but was not publicly visible
       !t.WasAdded() && !t.OlderVersion().IsPubliclyVisible)

select new { t,
             
OldVisibility = (t.WasAdded() ? " " : t.OlderVersion().Visibility.ToString()) }

No types matched

ok   API: New publicly visible methods
// <Name>API: New publicly visible methods</Name>
// List methods that are new in the public surface of your assemblies

from m in Application.Methods
where m.IsPubliclyVisible && 

     
// The method has been removed and its parent assembly hasn'm been removed ...
     ( (m.WasAdded() && !m.ParentType.WasAdded()) ||

     
// ... or the t existed but was not publicly visible
       !m.WasAdded() && !m.OlderVersion().IsPubliclyVisible)

select new { m,
             
OldVisibility = (m.WasAdded() ? " " : m.OlderVersion().Visibility.ToString()) }

No methods matched

ok   API: New publicly visible fields
// <Name>API: New publicly visible fields</Name>
// List fields that are new in the public surface of your assemblies

from f in Application.Fields
where f.IsPubliclyVisible && 

     
// The method has been removed and its parent assembly hasn'f been removed ...
     ( (f.WasAdded() && !f.ParentType.WasAdded()) ||

     
// ... or the t existed but was not publicly visible
       !f.WasAdded() && !f.OlderVersion().IsPubliclyVisible)

select new { f,
             
OldVisibility = (f.WasAdded() ? " " : f.OlderVersion().Visibility.ToString()) }

No fields matched

Code Diff Summary

ok   New assemblies
// <Name>New assemblies</Name>
from a in Application.Assemblies where a.WasAdded()
select new { a, a.NbLinesOfCode }

No assemblies matched

ok   Assemblies removed
// <Name>Assemblies removed</Name>
from a in codeBase.OlderVersion().Application.Assemblies where a.WasRemoved()
select new { a, a.NbLinesOfCode }

No assemblies matched

ok   Assemblies where code was changed
// <Name>Assemblies where code was changed</Name>
from a in Application.Assemblies where a.CodeWasChanged()
select new { a, a.NbLinesOfCode, 
             
oldNbLinesOfCode = a.OlderVersion().NbLinesOfCode.GetValueOrDefault() ,
             
delta = (int) a.NbLinesOfCode.GetValueOrDefault() - a.OlderVersion().NbLinesOfCode.GetValueOrDefault() }

No assemblies matched

ok   New namespaces
// <Name>New namespaces</Name>
from n in Application.Namespaces where 
 
!n.ParentAssembly.WasAdded() &&
  
n.WasAdded()
select new { n, n.NbLinesOfCode }

No namespaces matched

ok   Namespaces removed
// <Name>Namespaces removed</Name>
from n in codeBase.OlderVersion().Application.Namespaces where 
 
!n.ParentAssembly.WasRemoved() &&
  
n.WasRemoved()
select new { n, n.NbLinesOfCode }

No namespaces matched

ok   Namespaces where code was changed
// <Name>Namespaces where code was changed</Name>
from n in Application.Namespaces where n.CodeWasChanged()
select new { n, n.NbLinesOfCode, 
             
oldNbLinesOfCode = n.OlderVersion().NbLinesOfCode.GetValueOrDefault() ,
             
delta = (int) n.NbLinesOfCode.GetValueOrDefault() - n.OlderVersion().NbLinesOfCode.GetValueOrDefault() }

No namespaces matched

ok   New types
// <Name>New types</Name>
from t in Application.Types where 
 
!t.ParentNamespace.WasAdded() &&
  
t.WasAdded()
select new { t, t.NbLinesOfCode }

No types matched

ok   Types removed
// <Name>Types removed</Name>
from t in codeBase.OlderVersion().Application.Types where 
 
!t.ParentNamespace.WasRemoved() &&
  
t.WasRemoved()
select new { t, t.NbLinesOfCode }

No types matched

ok   Types where code was changed
// <Name>Types where code was changed</Name>
// To visualize changes in code, right-click a matched type and select:
//  - Compare older and newer versions of source file
//  - Compare older and newer versions disassembled with Reflector

from t in Application.Types where t.CodeWasChanged() 
//select new { t, t.NbLinesOfCode }
select new { t, t.NbLinesOfCode, 
             
oldNbLinesOfCode = t.OlderVersion().NbLinesOfCode ,
             
delta = (int?) t.NbLinesOfCode - t.OlderVersion().NbLinesOfCode } 
/*from t in Application.Types where t.CodeWasChanged() && t.IsPresentInBothBuild
select new { t, t.NbLinesOfCode, 
             oldNbLinesOfCode = t.OlderVersion().NbLinesOfCode ,
             delta = (int) t.NbLinesOfCode - t.OlderVersion().NbLinesOfCode }*/

No types matched

ok   Heuristic to find types moved from one namespace or assembly to another
// <Name>Heuristic to find types moved from one namespace or assembly to another</Name>
let typesRemoved = codeBase.OlderVersion().Types.Where(t => t.WasRemoved())
let typesAdded = Types.Where(t => t.WasAdded())

from tMoved in typesAdded.Join(
   
typesRemoved,
   
t => t.Name,
   
t => t.Name,
   
(tNewer, tOlder) => new { tNewer, 
                             
OlderParentNamespace = tOlder.ParentNamespace,
                             
OlderParentAssembly = tOlder.ParentAssembly  } ) 
select tMoved

No types matched

ok   Types directly using one or several types changed
// <Name>Types directly using one or several types changed</Name>
let typesChanged = Application.Types.Where(t => t.CodeWasChanged()).ToHashSet()

from t in JustMyCode.Types.UsingAny(typesChanged) where
  
!t.CodeWasChanged() && 
  
!t.WasAdded()
let typesChangedUsed = t.TypesUsed.Intersect(typesChanged) 
select new { t, typesChangedUsed }

No types matched

ok   Types indirectly using one or several types changed
// <Name>Types indirectly using one or several types changed</Name>
let typesChanged = Application.Types.Where(t => t.CodeWasChanged()).ToHashSet()

// 'depth' represents a code metric defined on types using
// directly or indirectly any type where code was changed.
let depth = JustMyCode.Types.DepthOfIsUsingAny(typesChanged) 

from t in depth.DefinitionDomain where
  
!t.CodeWasChanged() && 
  
!t.WasAdded()

let typesChangedDirectlyUsed = t.TypesUsed.Intersect(typesChanged) 
let depthOfUsingTypesChanged = depth[t]
orderby depthOfUsingTypesChanged 

select new { t, depthOfUsingTypesChanged, typesChangedDirectlyUsed }

No types matched

ok   New methods
// <Name>New methods</Name>
from m in Application.Methods where 
 
!m.ParentType.WasAdded() &&
  
m.WasAdded()
select new { m, m.NbLinesOfCode }

No methods matched

ok   Methods removed
// <Name>Methods removed</Name>
from m in codeBase.OlderVersion().Application.Methods where 
 
!m.ParentType.WasRemoved() &&
  
m.WasRemoved()
select new { m, m.NbLinesOfCode }

No methods matched

ok   Methods where code was changed
// <Name>Methods where code was changed</Name>
// To visualize changes in code, right-click a matched method and select:
//  - Compare older and newer versions of source file
//  - Compare older and newer versions disassembled with Reflector

from m in Application.Methods where m.CodeWasChanged()
select new { m, m.NbLinesOfCode, 
             
oldNbLinesOfCode = m.OlderVersion().NbLinesOfCode ,
             
delta = (int?) m.NbLinesOfCode - m.OlderVersion().NbLinesOfCode }

No methods matched

ok   Methods directly calling one or several methods changed
// <Name>Methods directly calling one or several methods changed</Name>
let methodsChanged = Application.Methods.Where(m => m.CodeWasChanged()).ToHashSet()

from m in JustMyCode.Methods.UsingAny(methodsChanged ) where
  
!m.CodeWasChanged() && 
  
!m.WasAdded()
let methodsChangedCalled = m.MethodsCalled.Intersect(methodsChanged) 
select new { m, methodsChangedCalled }

No methods matched

ok   Methods indirectly calling one or several methods changed
// <Name>Methods indirectly calling one or several methods changed</Name>
let methodsChanged = Application.Methods.Where(m => m.CodeWasChanged()).ToHashSet()

// 'depth' represents a code metric defined on methods using
// directly or indirectly any method where code was changed.
let depth = JustMyCode.Methods.DepthOfIsUsingAny(methodsChanged) 

from m in depth.DefinitionDomain where
  
!m.CodeWasChanged() && 
  
!m.WasAdded()

let methodsChangedDirectlyUsed = m.MethodsCalled.Intersect(methodsChanged) 
let depthOfUsingMethodsChanged = depth[m]
orderby depthOfUsingMethodsChanged 

select new { m, depthOfUsingMethodsChanged, methodsChangedDirectlyUsed }

No methods matched

ok   New fields
// <Name>New fields</Name>
from f in Application.Fields where 
 
!f.ParentType.WasAdded() &&
  
f.WasAdded()
select new { f }

No fields matched

ok   Fields removed
// <Name>Fields removed</Name>
from f in codeBase.OlderVersion().Application.Fields where 
 
!f.ParentType.WasRemoved() &&
  
f.WasRemoved()
select new { f }

No fields matched

ok   Third party types that were not used and that are now used
// <Name>Third party types that were not used and that are now used</Name>
from t in ThirdParty.Types where t.IsUsedRecently()
select new { t, t.Methods, t.Fields, t.TypesUsingMe }

No types matched

ok   Third party types that were used and that are not used anymore
// <Name>Third party types that were used and that are not used anymore</Name>
from t in codeBase.OlderVersion().Types where t.IsNotUsedAnymore()
select new { t, t.Methods, t.Fields, TypesThatUsedMe = t.TypesUsingMe }

No types matched

ok   Third party methods that were not used and that are now used
// <Name>Third party methods that were not used and that are now used</Name>
from m in ThirdParty.Methods where 
  
m.IsUsedRecently() &&
 
!m.ParentType.IsUsedRecently()
select new { m, m.MethodsCallingMe }

No methods matched

ok   Third party methods that were used and that are not used anymore
// <Name>Third party methods that were used and that are not used anymore</Name>
from m in codeBase.OlderVersion().Methods where 
  
m.IsNotUsedAnymore() &&
 
!m.ParentType.IsNotUsedAnymore()
select new { m, MethodsThatCalledMe = m.MethodsCallingMe}

No methods matched

ok   Third party fields that were not used and that are now used
// <Name>Third party fields that were not used and that are now used</Name>
from f in ThirdParty.Fields where 
  
f.IsUsedRecently() &&
 
!f.ParentType.IsUsedRecently()
select new { f, f.MethodsUsingMe }

No fields matched

ok   Third party fields that were used and that are not used anymore
// <Name>Third party fields that were used and that are not used anymore</Name>
from f in codeBase.OlderVersion().Fields where 
  
f.IsNotUsedAnymore() &&
 
!f.ParentType.IsNotUsedAnymore()
select new { f, MethodsThatUsedMe = f.MethodsUsingMe }

No fields matched

Test and Code Coverage

ok   C.R.A.P method code metric
// <Name>C.R.A.P method code metric</Name>
// Change Risk Analyzer and Predictor (i.e. CRAP) code metric
// This code metric helps in pinpointing overly complex and untested code.
// Reference: http://www.artima.com/weblogs/viewpost.jsp?thread=215899
// Formula:   CRAP(m) = comp(m)^2 * (1 – cov(m)/100)^3 + comp(m)
warnif count > 0
from m in JustMyCode.Methods

// Don't match too short methods
where m.NbLinesOfCode > 10

let CC = m.CyclomaticComplexity
let uncov = (100 - m.PercentageCoverage) / 100f
let CRAP = (CC * CC * uncov * uncov * uncov) + CC
where CRAP != null && CRAP > 30
orderby CRAP descending, m.NbLinesOfCode descending
select new { m, CRAP, CC, uncoveredPercentage = uncov*100, m.NbLinesOfCode }

No methods matched

ok   Complex methods partially covered by tests should be 100% covered
// <Name>Complex methods partially covered by tests should be 100% covered</Name>
warnif count > 0 from m in JustMyCode.Methods 
 
where 
     
// These metrics' definitions are available here: 
     // http://www.ndepend.com/Metrics.aspx#MetricsOnMethods
     (  m.NbLinesOfCode > 30 || 
        
m.ILCyclomaticComplexity > 50 || 
        
m.ILNestingDepth > 4 || 
        
m.NbVariables > 8) && 

     
// Take care only of complex methods 
     // already partially covered, but not completely covered.
     m.PercentageCoverage > 0 &&
     
m.PercentageCoverage < 100

  
orderby m.NbLinesOfCodeNotCovered ascending,
          
m.NbLinesOfCode descending
select new { m, m.PercentageCoverage, m.NbLinesOfCode, 
             
m.NbLinesOfCodeCovered, m.NbLinesOfCodeNotCovered, 
             
m.ILCyclomaticComplexity, m.ILNestingDepth, m.NbVariables }  

No methods matched

ok   Method changed poorly covered
// <Name>Method changed poorly covered</Name>
from m in Application.Methods where 
  
m.PercentageCoverage < 30 && 
  
m.CodeWasChanged() 
  
orderby m.NbLinesOfCode descending, 
           
m.NbLinesOfCodeNotCovered ,
           
m.PercentageCoverage
select new { m, m.PercentageCoverage, m.NbLinesOfCode, 
             
m.NbLinesOfCodeNotCovered }  

No methods matched

ok   Method added poorly covered
// <Name>Method added poorly covered</Name>
from m in Application.Methods where
  
m.NbLinesOfCode > 0 &&
  
m.PercentageCoverage < 30 && 
  
m.WasAdded() 
  
orderby m.NbLinesOfCode descending, 
           
m.NbLinesOfCodeNotCovered ,
           
m.PercentageCoverage
select new { m, m.PercentageCoverage, m.NbLinesOfCode, 
             
m.NbLinesOfCodeNotCovered } 

No methods matched

ok   Types 95% to 99% covered
// <Name>Types 95% to 99% covered</Name>
from t in Application.Types where 
  
t.PercentageCoverage >= 95 && 
  
t.PercentageCoverage <= 99 &&
 
!t.IsGeneratedByCompiler

  
let methodsCulprit = t.Methods.Where(m => m.PercentageCoverage < 100)

  
orderby t.NbLinesOfCode descending , 
           
t.NbLinesOfCodeNotCovered ,
           
t.PercentageCoverage
select new { t, t.PercentageCoverage, t.NbLinesOfCode, 
             
t.NbLinesOfCodeNotCovered, methodsCulprit } 

// Having types 100% covered by tests is a good idea because 
// the small portion of code hard to cover, is also the 
// portion of code that is the most likely to contain bugs.

No types matched

ok   Namespaces 95% to 99% covered
// <Name>Namespaces 95% to 99% covered</Name>
from n in Application.Namespaces where 
  
n.PercentageCoverage >= 95 && 
  
n.PercentageCoverage <= 99 

  
let methodsCulprit = n.ChildMethods.Where(m => m.PercentageCoverage < 100)

  
orderby n.NbLinesOfCode descending , 
           
n.NbLinesOfCodeNotCovered ,
           
n.PercentageCoverage
select new { n, n.PercentageCoverage, n.NbLinesOfCode, 
             
n.NbLinesOfCodeNotCovered, methodsCulprit  } 

// Having types 100% covered by tests is a good idea because 
// the small portion of code hard to cover, is also the 
// portion of code that is the most likely to contain bugs.

No namespaces matched

ok   Types tagged with FullCoveredAttribute should be 100% covered
// <Name>Types tagged with FullCoveredAttribute should be 100% covered</Name>
warnif count > 0 
from t in Application.Types where
  
t.HasAttribute ("NDepend.Attributes.FullCoveredAttribute".AllowNoMatch()) &&
  
t.PercentageCoverage < 100

let notFullCoveredMethods = t.Methods.Where(
                               
m =>  m.NbLinesOfCode> 0 && 
                                     
m.PercentageCoverage < 100 &&
                                    
!m.HasAttribute("NDepend.Attributes.UncoverableByTestAttribute".AllowNoMatch()))

orderby t.NbLinesOfCodeNotCovered descending 

select new { t, t.PercentageCoverage, t.NbLinesOfCodeNotCovered, notFullCoveredMethods,
                
t.NbLinesOfCode, t.NbLinesOfCodeCovered }

// By using a FullCoveredAttribute, you can signify to developers
// that a class is, and must remain in the future, 100% covered by tests.
// If you don't want to link NDepend.API.dll, 
// you can use your own attribute and adapt this rule.

// Having types 100% covered by tests is a good idea because 
// the small portion of code hard to cover, is also the 
// portion of code that is the most likely to contain bugs.

No types matched

ok   Types 100% covered should be tagged with FullCoveredAttribute
// <Name>Types 100% covered should be tagged with FullCoveredAttribute</Name>
warnif count > 0 from t in JustMyCode.Types where
 
!t.HasAttribute ("NDepend.Attributes.FullCoveredAttribute".AllowNoMatch()) &&
  
t.PercentageCoverage == 100 &&
 
!t.IsGeneratedByCompiler
select new { t, t.NbLinesOfCode }

// By using a FullCoveredAttribute, you can signify to developers
// that a class is, and must remain in the future, 100% covered by tests.
// If you don't want to link NDepend.API.dll, you can use your own attribute and adapt this rule.

// Having types 100% covered by tests is a good idea because 
// the small portion of code hard to cover, is also the 
// portion of code that is the most likely to contain bugs.

No types matched

ok   Types not covered at all
// <Name>Types not covered at all</Name>
from t in Application.Types where 
  
t.PercentageCoverage == 0
  
orderby t.NbLinesOfCode descending
select new { t, t.NbLinesOfCode } 

No types matched

ok   Namespaces not covered at all
// <Name>Namespaces not covered at all</Name>
from n in Application.Namespaces where 
  
n.PercentageCoverage == 0
  
orderby n.NbLinesOfCode descending
select new { n, n.NbLinesOfCode} 

No namespaces matched

ok   Test Methods
// <Name>Test Methods</Name>

// We advise to not include test assemblies in code analyzed by NDepend.
// But if you wish the current query to run properly, 
// you'll need to consider test assemblies in your list of application assemblies analyzed by NDepend..

let testAttr = ThirdParty.Types.WithNameIn("TestAttribute", "TestCaseAttribute")
let testMethods = Methods.TaggedWithAnyAttributes(testAttr)
from m in testMethods 
select m

No methods matched

ok   Methods directly called by test Methods
// <Name>Methods directly called by test Methods</Name>

// Lists all methods directly called by tests methods.
// Overrides of virtual and absract methods, called through polymorphism, are not listed.
// Methods solely invoked through a delegate are not listed.
// Methods solely invoked through reflection are not listed.

// We advise to not include test assemblies in code analyzed by NDepend.
// But if you wish the current query to run properly, 
// you'll need to consider test assemblies in your list of application assemblies analyzed by NDepend..

let testAttr = ThirdParty.Types.WithNameIn("TestAttribute", "TestCaseAttribute")
let testMethods = Methods.TaggedWithAnyAttributes(testAttr).ToHashSet()

// --- Uncomment this line if your test methods are in dedicated test assemblies ---
//let testAssemblies = testMethods.ParentAssemblies().ToHashSet()

from m in Application.Methods.UsedByAny(testMethods)

// --- Uncomment this line if your test methods are in dedicated test assemblies ---
//where !testAssemblies.Contains(m.ParentAssembly)

select new { m , 
             
calledByTests = m.MethodsCallingMe.Intersect(testMethods ),
             
// --- Uncomment this line if your project import some coverage data ---
             // m.PercentageCoverage 
}

No methods matched

ok   Methods directly and indirectly called by test Methods
// <Name>Methods directly and indirectly called by test Methods</Name>

// Lists all methods called directly or indirectly by tests methods.
// Overrides of virtual and absract methods, called through polymorphism, are not listed.
// Methods solely invoked through a delegate are not listed.
// Methods solely invoked through reflection are not listed.

// We advise to not include test assemblies in code analyzed by NDepend.
// But if you wish the current query to run properly, 
// you'll need to consider test assemblies in your list of application assemblies analyzed by NDepend.

let testAttr = from t in ThirdParty.Types.WithNameIn("TestAttribute", "TestCaseAttribute") select t
let testMethods = Methods.TaggedWithAnyAttributes(testAttr)

// --- Uncomment this line if your test methods are in dedicated test assemblies ---
// let testAssemblies = testMethods.ParentAssemblies().ToHashSet()

let depthOfCalledByTest = Application.Methods.DepthOfIsUsedByAny(testMethods)
from pair in depthOfCalledByTest
where pair.Value > 0 
orderby pair.Value ascending
// --- Uncomment this line if your test methods are in dedicated test assemblies ---
//&& !testAssemblies.Contains(pair.CodeElement.ParentAssembly)

select new { 
  
method = pair.CodeElement, 
  
// (depthOfCalledByTests == 1) means that the method is directly called by tests
  // (depthOfCalledByTests == 2) means that the method is directly called by a method directly called by tests
  // ...
  depthOfCalledByTests = pair.Value,
  
// --- Uncomment this line if your project import some coverage data ---
  // m.PercentageCoverage
}

No methods matched

Dead Code

ok   Potentially dead Types
// <Name>Potentially dead Types</Name>
warnif count > 0
// Filter procedure for types that should'nt be considered as dead
let canTypeBeConsideredAsDeadProc = new Func<IType, bool>(
   
t => !t.IsPublic && //   Public types might be used by client applications of your assemblies.
         t.Name != "Program" && 
        
!t.IsGeneratedByCompiler &&

         
// If you don't want to link NDepend.API.dll, you can use your own IsNotDeadCodeAttribute and adapt this rule.
        !t.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&

        
// Exclude static types that define only const fields
        // because they cannot be seen as used in IL code.
        !(t.IsStatic && t.NbMethods == 0 && !t.Fields.Where(f => !f.IsLiteral).Any()))


// Select types unused
let typesUnused = 
   
from t in JustMyCode.Types where
   
t.NbTypesUsingMe == 0 && canTypeBeConsideredAsDeadProc(t)
   
select t

// Dead types = types used only by unused types (recursive)
let deadTypesMetric = typesUnused.FillIterative(
types => from t in codeBase.Application.Types.UsedByAny(types).Except(types)
         
where canTypeBeConsideredAsDeadProc(t) &&
               
t.TypesUsingMe.Intersect(types).Count() == t.NbTypesUsingMe
         
select t)

from t in deadTypesMetric.DefinitionDomain
select new { t, t.TypesUsingMe, depth = deadTypesMetric[t] }

No types matched

warningCritical    Critical Rule warning: Potentially dead Methods
// <Name>Potentially dead Methods</Name>
warnif count > 0
// Filter procedure for methods that should'nt be considered as dead
let canMethodBeConsideredAsDeadProc = new Func<IMethod, bool>(
    
m => !m.IsPubliclyVisible &&       // Public methods might be used by client applications of your assemblies.
         !m.IsEntryPoint &&            // Main() method is not used by-design.
         !m.IsExplicitInterfaceImpl && // The IL code never explicitely calls explicit interface methods implementation.
         !m.IsClassConstructor &&      // The IL code never explicitely calls class constructors.
         !m.IsFinalizer &&             // The IL code never explicitely calls finalizers.
         !m.IsVirtual &&               // Only check for non virtual method that are not seen as used in IL.
         !(m.IsConstructor &&          // Don't take account of protected ctor that might be call by a derived ctors.
           m.IsProtected) &&
         
!m.IsEventAdder &&            // The IL code never explicitely calls events adder/remover.
         !m.IsEventRemover &&
         
!m.IsGeneratedByCompiler &&
         
!m.ParentType.IsDelegate &&

         
// Methods tagged with these two attributes are called by the serialization infrastructure.
         !m.HasAttribute("System.Runtime.Serialization.OnSerializingAttribute".AllowNoMatch()) &&
         
!m.HasAttribute("System.Runtime.Serialization.OnDeserializedAttribute".AllowNoMatch()) &&

         
// If you don't want to link NDepend.API.dll, you can use your own IsNotDeadCodeAttribute and adapt this rule.
         !m.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()))

// Get methods unused
let methodsUnused = 
   
from m in JustMyCode.Methods where 
   
m.NbMethodsCallingMe == 0 && 
   
canMethodBeConsideredAsDeadProc(m)
   
select m

// Dead methods = methods used only by unused methods (recursive)
let deadMethodsMetric = methodsUnused.FillIterative(
   
methods => // Unique loop, just to let a chance to build the hashset.
              from o in (new object()).ToEnumerable()
              
// Use a hashet to make Intersect calls much faster!
              let hashset = methods.ToHashSet()
              
from m in codeBase.Application.Methods.UsedByAny(methods).Except(methods)
              
where canMethodBeConsideredAsDeadProc(m) &&
                    
// Select methods called only by methods already considered as dead
                    hashset.Intersect(m.MethodsCallingMe).Count() == m.NbMethodsCallingMe
              
select m)

from m in JustMyCode.Methods.Intersect(deadMethodsMetric.DefinitionDomain)
select new { m, m.MethodsCallingMe, depth = deadMethodsMetric[m] }

14 methods matched

methodsMethodsCallingMedepthFull Name
Application_Start(Object,EventArgs)0 method0Laboratory.Global.Application_Start (Object,EventArgs)
Application_End(Object,EventArgs)0 method0Laboratory.Global.Application_End(Object ,EventArgs)
Application_Error(Object,EventArgs)0 method0Laboratory.Global.Application_Error (Object,EventArgs)
Session_Start(Object,EventArgs)0 method0Laboratory.Global.Session_Start(Object ,EventArgs)
Session_End(Object,EventArgs)0 method0Laboratory.Global.Session_End(Object ,EventArgs)
IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)0 method0Laboratory.Module.IntegralApproximation .IntegrateUsingRectangleMethod(String ,Decimal,Decimal,Decimal)
IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)0 method0Laboratory.Module.IntegralApproximation .IntegrateUsingTrapezoidalRule(String ,Decimal,Decimal,Decimal)
IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)0 method0Laboratory.Module.IntegralApproximation .IntegrateUsingSimpsonsRule(String ,Decimal,Decimal,Decimal)
.ctor()0 method0B_Geometry.GeomUtils..ctor()
.ctor()0 method0MathosTest.Statistics+Literals..ctor()
AreApproximatelyEqual(Complex,Complex)0 method0MathosTest.Mathos_Main.SpecialFunctions .ElementaryTests.AreApproximatelyEqual (Complex,Complex)
IsApproximatelyZero(Double)0 method0MathosTest.Mathos_Main.SpecialFunctions .GammaTests.IsApproximatelyZero(Double)
Button_MouseEnter(Object,MouseEventArgs)0 method0RubyInt.HelpWindow.Button_MouseEnter (Object,MouseEventArgs)
IsTriangle(Double,Double,Double)0 method0Mathos.Geometry.Shapes.Triangle .IsTriangle(Double,Double,Double)

Statistics

Stat   MethodsCallingMe   depth
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Critical Rule warning: Potentially dead Fields
// <Name>Potentially dead Fields</Name>
warnif count > 0
from f in JustMyCode.Fields where
   
f.NbMethodsUsingMe == 0 && 
   
!f.IsPublic &&     // Although not recommended, public fields might be used by client applications of your assemblies.
   !f.IsLiteral &&    // The IL code never explicitely uses literal fields.
   !f.IsEnumValue &&  // The IL code never explicitely uses enumeration value.
   f.Name !=  "value__"  && // Field named 'value__' are relative to enumerations and the IL code never explicitely uses them.
   !f.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&
   
!f.IsGeneratedByCompiler
   
// If you don't want to link NDepend.API.dll, you can use your own IsNotDeadCodeAttribute and adapt this rule.
select f

38 fields matched

fieldsFull Name
HyperLink1Laboratory.Default.HyperLink1
Table1Laboratory.Modules.Table1
HeadContentLaboratory.SiteMaster.HeadContent
NavigationMenuLaboratory.SiteMaster.NavigationMenu
MainContentLaboratory.SiteMaster.MainContent
ChangeUserPasswordLaboratory.Account.ChangePassword .ChangeUserPassword
LoginUserLaboratory.Account.Login.LoginUser
RegisterUserWizardStepLaboratory.Account.Register .RegisterUserWizardStep
Panel1Laboratory.Module.Converter.Panel1
CalculateButtonLaboratory.Module.Converter .CalculateButton
ErrorLabelLaboratory.Module.Converter.ErrorLabel
SolveSystemOfTwoEquationLaboratory.Module.EquationSolver .SolveSystemOfTwoEquation
SolveQuadraticEquationLaboratory.Module.EquationSolver .SolveQuadraticEquation
CalculateButtonLaboratory.Module.Factorial .CalculateButton
Label1Laboratory.Module.IntegralApproximation .Label1
Label2Laboratory.Module.IntegralApproximation .Label2
CalculateButtonLaboratory.Module.IntegralApproximation .CalculateButton
Label3Laboratory.Module.IntegralApproximation .Label3
Label4Laboratory.Module.IntegralApproximation .Label4
Label5Laboratory.Module.IntegralApproximation .Label5
returnvalueLaboratory.Module.MConverter.returnvalue
CalculateButtonLaboratory.Module.NumberChecker .CalculateButton
ErrorLabelLaboratory.Module.NumberChecker .ErrorLabel
CalculateButtonLaboratory.Module.Triangle .CalculateButton
CalculateButtonLaboratory.Module.Uncertainty .CalculateButton
ErrorLabelLaboratory.Module.Uncertainty.ErrorLabel
Button1Laboratory.Module.DataAnalysis .LinearRegression.Button1
FindNthTermLaboratory.Module.DataAnalysis.WebForm1 .FindNthTerm
Button1Laboratory.Module.DataAnalysis.WebForm1 .Button1
CalculateButtonLaboratory.Module.Finance .FinanceAnnuityPaymentFutureValue .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceAnnuityPaymentPresentValue .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceFutureValue.CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceFutureValueOfAnAnnuity .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceNetPresentValue.CalculateButton
CalculateButtonLaboratory.Module.Finance .FinancePresentValue.CalculateButton
CalculateButtonLaboratory.Module.Finance .FinancePresentValueOfAnAnnuity .CalculateButton
CalculateButtonLaboratory.Module.Finance .FinanceRemainingBalanceOfAnnuity .CalculateButton
CalcProjectWebsite._Default.Calc

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
ok   Wrong usage of IsNotDeadCodeAttribute
// <Name>Wrong usage of IsNotDeadCodeAttribute</Name>

// This IsNotDeadCodeAttribute can be used to signify that 
// despite a member could be removed without provoking any syntax error 
// (we also say it is dead code), your intention is to not remove this member.
// Default 'Dead Code' code rules take account of this attribute.
// IsNotDeadCodeAttribute is defined in NDepend.API.dll
// If you don't want to link NDepend.API.dll, you can use 
// your own IsNotDeadCodeAttribute and adapt this rule.
warnif count == 1

let tAttr = Types.WithFullName("NDepend.Attributes.IsNotDeadCodeAttribute").FirstOrDefault()
where tAttr != null

// Get types that do a wrong usage of IsNotDeadCodeAttribute
let types = from t in Application.Types where 
   
t.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&

   
( // types used don't need to be tagged with IsNotDeadCodeAttribute!
     t.NbTypesUsingMe > 0  ||
   
     
// Static types that define only const fields cannot be seen as used in IL code.
     // They don't need to be tagged with IsNotDeadCodeAttribute.
     (t.IsStatic && t.NbMethods == 0 && !t.Fields.Where(f => !f.IsLiteral).Any())
   
)
   
select t

// Get methods that do a wrong usage of IsNotDeadCodeAttribute
let methods = from m in Application.Methods where 
   
m.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&
   
m.NbMethodsCallingMe > 0
   
select m

// Get fields that do a wrong usage of IsNotDeadCodeAttribute
let fields = from f in Application.Fields where 
   
f.HasAttribute("NDepend.Attributes.IsNotDeadCodeAttribute".AllowNoMatch()) &&
   
f.NbMethodsUsingMe > 0
   
select f

where types.Count() > 0 || methods.Count() > 0 || fields.Count() > 0
select new { tAttr, types , methods, fields }

No types matched

Trend Charts


Lines of Code


Rules Violated


Rules Violations


Percentage Coverage by Tests

No Trend Data has been logged for this Chart.

Max


Average


Third-Party Usage

Assemblies Dependencies

Assembly Depends on Is referenced by
Laboratory v1.0.0.0mscorlib v4.0.0.0 ; System.Web v4.0.0.0 ; System v4.0.0.0 ; Mathos v1.0.5.1 ; System.Numerics v4.0.0.0 ; MathParser v1.0.5.0 ; System.Core v4.0.0.0 ; -
B_Geometry v1.0.0.0mscorlib v4.0.0.0 ; System v4.0.0.0 ; System.Windows.Forms v4.0.0.0 ; OpenTK.GLControl v1.0.0.0 ; OpenTK v1.0.0.0 ; System.Drawing v4.0.0.0 ; -
MathosTest v1.0.0.0mscorlib v4.0.0.0 ; Mathos v1.0.5.1 ; System v4.0.0.0 ; System.Numerics v4.0.0.0 ; System.Core v4.0.0.0 ; -
RubyInt v1.0.0.0mscorlib v4.0.0.0 ; PresentationFramework v4.0.0.0 ; System v4.0.0.0 ; PresentationCore v4.0.0.0 ; System.Core v4.0.0.0 ; ICSharpCode.AvalonEdit v4.4.0.9727 ; System.Xaml v4.0.0.0 ; Microsoft.Scripting v1.0.0.0 ; MathParser v1.0.5.0 ; Mathos v1.0.5.1 ; IronRuby v1.0.0.0 ; System.Xml v4.0.0.0 ; MahApps.Metro v0.13.1.0 ; WindowsBase v4.0.0.0 ; Microsoft.Threading.Tasks v1.0.12.0 ; -
ProjectWebsite v1.0.0.0mscorlib v4.0.0.0 ; MathParser v1.0.5.0 ; System.Web v4.0.0.0 ; Mathos v1.0.5.1 ; -
Interactive Mathematics v1.0.0.0mscorlib v4.0.0.0 ; PresentationFramework v4.0.0.0 ; System v4.0.0.0 ; System.Xaml v4.0.0.0 ; MathParser v1.0.5.0 ; PresentationCore v4.0.0.0 ; WindowsBase v4.0.0.0 ; Microsoft.CSharp v4.0.0.0 ; System.Core v4.0.0.0 ; Mathos v1.0.5.1 ; -
Mathos v1.0.5.1mscorlib v4.0.0.0 ; System.Numerics v4.0.0.0 ; System.Core v4.0.0.0 ; System v4.0.0.0 ; Laboratory v1.0.0.0 ; MathosTest v1.0.0.0 ; RubyInt v1.0.0.0 ; ProjectWebsite v1.0.0.0 ; Interactive Mathematics v1.0.0.0 ;

Assemblies Build Order

  1. Laboratory
  2. B_Geometry
  3. MathosTest
  4. RubyInt
  5. ProjectWebsite
  6. Interactive Mathematics
  7. Mathos

Assemblies Build Order

  1. Laboratory
  2. B_Geometry
  3. MathosTest
  4. RubyInt
  5. ProjectWebsite
  6. Interactive Mathematics
  7. Mathos

Analysis Log : Information and Warnings

Here are Logs emitted during NDepend analysis.
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
warningCriticalBegin full analysis with NDepend v5.4.1.8430
warningCriticalNo Baseline for Comparison loaded.
warningCriticalCan't load the assembly {Microsoft.VisualStudio.QualityTools.UnitTestFramework}: Can't find the .NET assembly {Microsoft.VisualStudio.QualityTools.UnitTestFramework} in specified folders. Has it been compiled properly? Is the NDepend project missing the containing folder of the .NET assembly?
warningCriticalCan't load the assembly {System.Threading.Tasks}: Several .NET assemblies have the name {System.Threading.Tasks} but they are different. - C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\RubyInt\bin\Debug\System.Threading.Tasks.dll v0.0 34 528 bytes - C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\System.Threading.Tasks.dll v0.0 30 344 bytes
warningCriticalCan't load the assembly {System.Runtime}: Several .NET assemblies have the name {System.Runtime} but they are different. - C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\RubyInt\bin\Debug\System.Runtime.dll v0.0 22 208 bytes - C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\System.Runtime.dll v0.0 36 440 bytes
warningCriticalConcurrent mode
warningCritical.NET Assembly loaded from {C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Mathos\bin\Debug} Mathos.dll v1.0.5.1
warningCritical.NET Assembly loaded from {C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\bin\Debug} MathosTest.dll v1.0.0.0
warningCritical.NET Assemblies loaded from {C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Interactive Mathematics\bin\Debug} Interactive Mathematics.exe v1.0.0.0 MathParser.dll v1.0.5.0
warningCritical.NET Assembly loaded from {C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\ProjectWebsite\bin} ProjectWebsite.dll v1.0.0.0
warningCritical.NET Assembly loaded from {C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\Laboratory\bin} Laboratory.dll v1.0.0.0
warningCritical.NET Assemblies loaded from {C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\B_Geometry\bin\Debug} B_Geometry.exe v1.0.0.0 OpenTK.GLControl.dll v1.0.0.0 OpenTK.dll v1.0.0.0
warningCritical.NET Assemblies loaded from {C:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\RubyInt\bin\Debug} RubyInt.exe v1.0.0.0 MahApps.Metro.dll v0.13.1.0 ICSharpCode.AvalonEdit.dll v4.4.0.9727 Microsoft.Scripting.dll v1.0.0.0 IronRuby.dll v1.0.0.0 Microsoft.Threading.Tasks.dll v1.0.12.0
warningCritical.NET Assemblies loaded from {C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319} mscorlib.dll v4.0.0.0 System.Numerics.dll v4.0.0.0 System.Core.dll v4.0.0.0 System.dll v4.0.0.0 System.Xaml.dll v4.0.0.0 Microsoft.CSharp.dll v4.0.0.0 System.Web.dll v4.0.0.0 System.Windows.Forms.dll v4.0.0.0 System.Drawing.dll v4.0.0.0 System.Xml.dll v4.0.0.0
warningCritical.NET Assemblies loaded from {C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF} PresentationFramework.dll v4.0.0.0 PresentationCore.dll v4.0.0.0 WindowsBase.dll v4.0.0.0
warningCriticalVersioning issue: Assembly {Laboratory v1.0.0.0} references {MathParser v1.0.7.2} but NDepend has loaded {MathParser v1.0.5.0}
warningCriticalAssembly {Microsoft.VisualStudio.QualityTools.UnitTestFramework} is referenced by {MathosTest} but is not found.
warningCriticalVersioning issue: Assembly {RubyInt v1.0.0.0} references {MathParser v1.0.7.2} but NDepend has loaded {MathParser v1.0.5.0}
warningCriticalAssembly {System.Threading.Tasks} is referenced by {RubyInt} but is not found.
warningCriticalAssembly {System.Runtime} is referenced by {RubyInt} but is not found.
warningCriticalThe source file {c:\Users\Artem Los\Documents\Visual Studio 2013\Projects\mathos\MathosTest\Mathos Main\Statistics and DiceSim\LinearModels.cs} (last modified 2014-10-25 23:07:36) and the PDB file of the assembly {MathosTest} (last modified 2014-10-25 22:24:34) are not in-sync.
warningCritical185 source files parsed ; all source files found ; 1 source file not in-sync with PDB
warningCritical0 code rule has been extracted from code.
warningCriticalNo dependency cycle detected in assemblies referencement graph.
warningCritical11-27-2014 19:11:41 Analyse dependencies of your application.
warningCritical11-27-2014 19:11:46 Log trend metrics values.
warningCritical11-27-2014 19:11:47 Execute queries and rules
warningCritical6 critical rules are violated. - Methods too complex - critical - Potentially dead Methods - Potentially dead Fields - Don't assign a field from many methods - Exception class name should be suffixed with 'Exception' - Avoid having different types with same name
warningCritical11-27-2014 19:11:48 NDepend analysis done. Duration: 00:08
warningCritical11-27-2014 19:11:48 Building the report (standard).