Exemplo n.º 1
0
        public static HashSet <IMemberData> Members(IEnumerable <IAssemblyData> assemblies)
        {
            var assemblySet = Prepare(assemblies);
            var result      = new UnusedMemberFinder(configuration).FindIn(assemblySet);

            return(result.UnusedMembers);
        }
Exemplo n.º 2
0
        public static HashSet<IMemberData> Members(IEnumerable<IAssemblyData> assemblies)
        {
            var assemblySet = Prepare(assemblies);
            var result = new UnusedMemberFinder(configuration).FindIn(assemblySet);

            return result.UnusedMembers;
        }
Exemplo n.º 3
0
        public static AssemblyStatistic[] Statistics(IEnumerable <IAssemblyData> assemblies)
        {
            var assemblySet = Prepare(assemblies);
            var result      = new UnusedMemberFinder(configuration).FindIn(assemblySet);

            return((
                       from assembly in assemblies
                       let inAssembly = new Func <IMemberData, bool>(m => m.Assembly == assembly)
                                        let allMethods = result.AllMembers.Where(inAssembly)
                                                         let unusedMethods = result.UnusedMembers.Where(inAssembly)
                                                                             let ignoredMethods = result.IgnoredMembers.Where(inAssembly)
                                                                                                  select new AssemblyStatistic {
                AssemblyData = assembly,
                UnusedMembers = unusedMethods.ToArray(),
                UnusedMemberRatio = (double)unusedMethods.Count() / allMethods.Count(),
                IgnoredMemberRatio = (double)ignoredMethods.Count() / allMethods.Count(),
                InspectedAsRoot = assemblySet.Roots.Contains(assembly)
            }
                       ).ToArray());
        }
Exemplo n.º 4
0
        public static AssemblyStatistic[] Statistics(IEnumerable<IAssemblyData> assemblies)
        {
            var assemblySet = Prepare(assemblies);
            var result = new UnusedMemberFinder(configuration).FindIn(assemblySet);

            return (
                from assembly in assemblies
                let inAssembly = new Func<IMemberData, bool>(m => m.Assembly == assembly)
                let allMethods = result.AllMembers.Where(inAssembly)
                let unusedMethods = result.UnusedMembers.Where(inAssembly)
                let ignoredMethods = result.IgnoredMembers.Where(inAssembly)
                select new AssemblyStatistic {
                    AssemblyData       = assembly,
                    UnusedMembers      = unusedMethods.ToArray(),
                    UnusedMemberRatio  = (double)unusedMethods.Count() / allMethods.Count(),
                    IgnoredMemberRatio = (double)ignoredMethods.Count() / allMethods.Count(),
                    InspectedAsRoot    = assemblySet.Roots.Contains(assembly)
                }
            ).ToArray();
        }