Ejemplo n.º 1
0
        static async Task <ClassAttributeUpdater> GetClassUpdater(Project project)
        {
            var compilation = await project.GetCompilationAsync();

            var maxParameters   = MethodParameterCountAnalyzer.GetMaxParameterCount(compilation.Assembly);
            var maxMethodLength = MethodLengthAnalyzer.GetMaxLineCount(compilation.Assembly);
            var maxTypeLength   = TypeLengthAnalyzer.GetMaxLineCount(compilation.Assembly);
            var maxFieldCount   = FieldCountAnalyzer.GetMaxFieldCount(compilation.Assembly);

            return(new ClassAttributeUpdater(project.Solution.Workspace, maxParameters, maxMethodLength, maxTypeLength, maxFieldCount));
        }
Ejemplo n.º 2
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);
        }