コード例 #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 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));
        }