示例#1
0
        public LinesCalculator(IAssemblySymbol assembly) : base(SyntaxWalkerDepth.Node)
        {
            this.assembly = assembly;
            var methodStatistics = new MethodStatistics(MethodLengthAnalyzer.GetMaxLineCount(assembly), MethodParameterCountAnalyzer.GetMaxParameterCount(assembly));
            var typeStatistics   = new TypeStatistics(TypeLengthAnalyzer.GetMaxLineCount(assembly), FieldCountAnalyzer.GetMaxFieldCount(assembly));

            statistics = new Statistics(typeStatistics, methodStatistics);
        }
示例#2
0
        static Statistics GetEmptyStatistics(string[] args)
        {
            if (!args.Contains(ConfigurationArgument))
            {
                return(null);
            }

            var defaults         = args.SkipWhile(s => s != ConfigurationArgument).Skip(1).Take(4).Select(int.Parse).ToList();
            var methodStatistics = new MethodStatistics(defaults[0], defaults[1]);
            var typeStatistics   = new TypeStatistics(defaults[2], defaults[3]);

            return(new Statistics(typeStatistics, methodStatistics));
        }
示例#3
0
 public string Print(bool onlyNumbers)
 {
     return(TypeStatistics.Print(onlyNumbers) + "\n" + MethodStatistics.Print(onlyNumbers));
 }
示例#4
0
 public Statistics Concat(Statistics other)
 {
     return(new Statistics(TypeStatistics.Concat(other.TypeStatistics), MethodStatistics.Concat(other.MethodStatistics)));
 }
示例#5
0
 public Statistics(TypeStatistics typeStatistics, MethodStatistics methodStatistics)
 {
     TypeStatistics   = typeStatistics;
     MethodStatistics = methodStatistics;
 }