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); }
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)); }
public string Print(bool onlyNumbers) { return(TypeStatistics.Print(onlyNumbers) + "\n" + MethodStatistics.Print(onlyNumbers)); }
public Statistics Concat(Statistics other) { return(new Statistics(TypeStatistics.Concat(other.TypeStatistics), MethodStatistics.Concat(other.MethodStatistics))); }
public Statistics(TypeStatistics typeStatistics, MethodStatistics methodStatistics) { TypeStatistics = typeStatistics; MethodStatistics = methodStatistics; }