Beispiel #1
0
        private static void Enumerate(IEnumerable <MetadataTables> tables)
        {
            var tree = new NamespaceTree();

            foreach (var moduleTables in tables)
            {
                EnumerateExtensionMethods(moduleTables);
                tree.Add(moduleTables);
                ModuleEnumerated(moduleTables);
            }

            Counter_Types +=
                (from ns in tree.GetAllNamespaces()
                 from t in ns.GetTypeDefs()
                 select 1).Count();
        }
Beispiel #2
0
        private static void Statistics(NamespaceTree tree, bool dump)
        {
            var x =
                from ns in tree.GetAllNamespaces()
                let count = ns.GetTypeDefs().Count()
                            group ns by count into g
                            let gCount = g.Count()
                                         orderby g.Key descending
                                         select new { Size = g.Key, Count = gCount };

            foreach (var p in x)
            {
                if (dump)
                {
                    _output.WriteLine("{0}\t{1}", p.Size, p.Count);
                }
            }

            Counter_Types = x.Sum((a) => a.Size);
            if (dump)
            {
                _output.WriteLine("Namespace size: total {0}, avg {1}", Counter_Types, x.Average((a) => a.Size));
            }
        }
Beispiel #3
0
        private static void Statistics(NamespaceTree tree, bool dump)
        {
            var x =
                from ns in tree.GetAllNamespaces()
                let count = ns.GetTypeDefs().Count()
                group ns by count into g
                let gCount = g.Count()
                orderby g.Key descending
                select new { Size = g.Key, Count = gCount };

            foreach (var p in x) {
                if (dump) {
                    _output.WriteLine("{0}\t{1}", p.Size, p.Count);
                }
            }

            Counter_Types = x.Sum((a) => a.Size);
            if (dump) {
                _output.WriteLine("Namespace size: total {0}, avg {1}", Counter_Types, x.Average((a) => a.Size));
            }
        }
Beispiel #4
0
        private static void Enumerate(IEnumerable<MetadataTables> tables)
        {
            var tree = new NamespaceTree();
            foreach (var moduleTables in tables) {
                EnumerateExtensionMethods(moduleTables);
                tree.Add(moduleTables);
                ModuleEnumerated(moduleTables);
            }

            Counter_Types +=
                (from ns in tree.GetAllNamespaces()
                 from t in ns.GetTypeDefs()
                 select 1).Count();
        }