示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetricInfo" /> class.
 /// Creates metric info from given indicators.
 /// </summary>
 /// <param name="indicatorBatch">Info about indicators.</param>
 /// <param name="ratingBatch">Info about ratings.</param>
 /// <param name="quantityBatch">Info about quantities.</param>
 /// <param name="includedParsers">Syntax parsers of included source files.</param>
 /// <param name="hasResolvedOccurances">
 /// Determine whether info will contains occurrences of nodes related to metric.
 /// </param>
 private MetricInfo(
     IndicatorProcessor.ResultBatch indicatorBatch,
     RatingProcessor.ResultBatch ratingBatch,
     QuantityProcessor.ResultBatch quantityBatch,
     IEnumerable <SyntaxParser> includedParsers,
     bool hasResolvedOccurances)
 {
     this.indicatorBatch         = indicatorBatch;
     this.ratingBatch            = ratingBatch;
     this.quantityBatch          = quantityBatch;
     this.HasResolvedOccurrences = hasResolvedOccurances;
     IncludeParsers(includedParsers.ToArray());
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetricInfo" /> class.
        /// Creates metric info for given sources.
        /// </summary>
        /// <param name="resolveOccurances">
        /// Determine whether evidences of occurrences in sources code should be stored.
        /// </param>
        /// <param name="parser">Syntax parser of source code.</param>
        private MetricInfo(bool resolveOccurances, SyntaxParser parser)
        {
            if (!parser.IsParsed)
            {
                // We need content in parser to be parsed
                parser.Parse();
            }

            indicatorBatch = ProcessingServices.ProcessIndicators(resolveOccurances, parser);
            ratingBatch    = ProcessingServices.ProcessRatings(resolveOccurances, parser);
            quantityBatch  = ProcessingServices.ProcessQuantities(resolveOccurances, parser);

            HasResolvedOccurrences = resolveOccurances;
            IncludeParsers(parser);
        }
示例#3
0
 internal static IndicatorProcessor.ResultBatch MergeIndicators(IndicatorProcessor.ResultBatch b1,
                                                                IndicatorProcessor.ResultBatch b2)
 {
     return(indicatorProcessors.MergeResults(b1, b2));
 }