34 references to MetricsHelper
Roslyn.Diagnostics.Analyzers (34)
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (2)
56MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, child.CoupledNamedTypes); 69int maintainabilityIndex = grandChildCount > 0 ? MetricsHelper.GetAverageRoundedMetricValue(maintainabilityIndexTotal, grandChildCount) : 100;
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.EventMetricData.cs (6)
34long linesOfCode = MetricsHelper.GetLinesOfCode(declarations, @event, context); 36MetricsHelper.ComputeCoupledTypesAndComplexityExcludingMemberDecls(declarations, @event, coupledTypesBuilder, context); 37MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, @event.Type); 43MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, child.CoupledNamedTypes); 50int maintainabilityIndex = !children.IsEmpty ? MetricsHelper.GetAverageRoundedMetricValue(maintainabilityIndexTotal, children.Length) : 100; 51MetricsHelper.RemoveContainingTypes(@event, coupledTypesBuilder);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.FieldMetricData.cs (5)
33long linesOfCode = MetricsHelper.GetLinesOfCode(declarations, field, context); 35MetricsHelper.ComputeCoupledTypesAndComplexityExcludingMemberDecls(declarations, field, coupledTypesBuilder, context); 36MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, field.Type); 39MetricsHelper.RemoveContainingTypes(field, coupledTypesBuilder); 49return MetricsHelper.NormalizeAndRoundMaintainabilityIndex(171 - 5.2 * computationalComplexityVolume - 0.23 * cyclomaticComplexity - 16.2 * logEffectiveLinesOfCode);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.MethodMetricData.cs (6)
33long linesOfCode = MetricsHelper.GetLinesOfCode(declarations, method, context); 35MetricsHelper.ComputeCoupledTypesAndComplexityExcludingMemberDecls(declarations, method, coupledTypesBuilder, context); 36MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, method.Parameters); 39MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, method.ReturnType); 44MetricsHelper.RemoveContainingTypes(method, coupledTypesBuilder); 60return MetricsHelper.NormalizeAndRoundMaintainabilityIndex(171 - 5.2 * computationalComplexityVolume - 0.23 * cyclomaticComplexity - 16.2 * logEffectiveLinesOfCode);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (5)
72MetricsHelper.ComputeCoupledTypesAndComplexityExcludingMemberDecls(declarations, namedType, coupledTypesBuilder, context); 81MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, child.CoupledNamedTypes); 102long linesOfCode = MetricsHelper.GetLinesOfCode(declarations, namedType, context); 106MetricsHelper.RemoveContainingTypes(namedType, coupledTypesBuilder); 177return MetricsHelper.NormalizeAndRoundMaintainabilityIndex(171 - 5.2 * logAvgComputationalComplexityVolume - 0.23 * avgCyclomaticComplexity - 16.2 * logAvgLinesOfCode);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamespaceMetricData.cs (3)
54MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, child.CoupledNamedTypes); 68MetricsHelper.GetLinesOfCode(@namespace.DeclaringSyntaxReferences, @namespace, context); 69int maintainabilityIndex = !children.IsEmpty ? MetricsHelper.GetAverageRoundedMetricValue(maintainabilityIndexTotal, children.Length) : 100;
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.PropertyMetricData.cs (7)
34long linesOfCode = MetricsHelper.GetLinesOfCode(declarations, property, context); 36MetricsHelper.ComputeCoupledTypesAndComplexityExcludingMemberDecls(declarations, property, coupledTypesBuilder, context); 37MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, property.Parameters); 38MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, property.Type); 44MetricsHelper.AddCoupledNamedTypes(coupledTypesBuilder, context.WellKnownTypeProvider, child.CoupledNamedTypes); 51int maintainabilityIndex = !children.IsEmpty ? MetricsHelper.GetAverageRoundedMetricValue(maintainabilityIndexTotal, children.Length) : 100; 52MetricsHelper.RemoveContainingTypes(property, coupledTypesBuilder);