コード例 #1
0
        private void IncrementOccurenceCount(string counterName)
        {
            IMetricsDataStore storage = dataProvider.GetDataStore();
            int currentCount;

            storage.TryGetDataItem <int>(counterName, out currentCount);
            storage.SetDataItem <int>(counterName, ++currentCount);
        }
コード例 #2
0
        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);
        }
コード例 #3
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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        public void InitializeSelf()
        {
            IMetricsDataStore storage = dataProvider.GetDataStore();

            storage.SetDataItem <int>(LinesOfCodeData, LinesOfCodeStrategy.InitialLinesOfCode);
        }
コード例 #6
0
        public void InitializeSelf()
        {
            IMetricsDataStore storage = dataProvider.GetDataStore();

            storage.SetDataItem <int>(CyclomaticComplexityeData, CyclomaticComplexityStrategy.InitialComplexity);
        }