private void IncrementOccurenceCount(string counterName) { IMetricsDataStore storage = dataProvider.GetDataStore(); int currentCount; storage.TryGetDataItem <int>(counterName, out currentCount); storage.SetDataItem <int>(counterName, ++currentCount); }
public void InitializeSelf() { IMetricsDataStore storage = dataProvider.GetDataStore(); storage.SetDataItem <double>(ABCScoreAccumulator, 0); storage.SetDataItem <int>(AssignmentCount, 0); storage.SetDataItem <int>(BranchingCount, 0); storage.SetDataItem <int>(CallCount, 0); }
public void Process(SyntaxNode node) { IMetricsDataStore storage = dataProvider.GetDataStore(); if (linesToCount.Contains(node.Kind())) { int currentComplexity; storage.TryGetDataItem <int>(CyclomaticComplexityeData, out currentComplexity); storage.SetDataItem <int>(CyclomaticComplexityeData, ++currentComplexity); } }
public void Process(SyntaxNode node) { IMetricsDataStore storage = dataProvider.GetDataStore(); if (linesToCount.Contains(node.Kind())) { if (node.Kind() == SyntaxKind.IfStatement && node.Parent != null && node.Parent.Kind() == SyntaxKind.ElseClause) { return; // Only count the 'else' in an 'else if'. } int currentLOC; storage.TryGetDataItem <int>(LinesOfCodeData, out currentLOC); storage.SetDataItem <int>(LinesOfCodeData, ++currentLOC); } }
public void InitializeSelf() { IMetricsDataStore storage = dataProvider.GetDataStore(); storage.SetDataItem <int>(LinesOfCodeData, LinesOfCodeStrategy.InitialLinesOfCode); }
public void InitializeSelf() { IMetricsDataStore storage = dataProvider.GetDataStore(); storage.SetDataItem <int>(CyclomaticComplexityeData, CyclomaticComplexityStrategy.InitialComplexity); }