예제 #1
0
        public void Index()
        {
            log.Info("About to index public objects in the following projects...");
            IDictionary <string, Project> projects = ProjectDiscovery.Discover("ProjectConfiguration");
            List <Project> projectList             = new List <Project>(projects.Values);

            projectList.ForEach(project => log.InfoFormat("\t{0}", project));

            log.Info("About to gather all declared public objects...");
            List <PublicObject> publics = GatherPublicObjects(projectList);

            log.InfoFormat("Found total of {0} public objects...", publics.Count());

            log.Info("About to find occurrences of all declared public objects...");
            List <Occurrence> occurrences = new List <Occurrence>();

            projectList.ForEach(p => occurrences.AddRange(FindOccurrences(publics, p)));
            log.InfoFormat("Found total of {0} occurrences ...", occurrences.Count);

            log.Info("About to publish the results ...");
            using (DatabasePublisher publisher = new DatabasePublisher())
            {
                publisher.Publish(occurrences);
            }
            log.Info("Results published ...");
            log.Info("Done.");
        }
예제 #2
0
        static void Main()
        {
            log.Info("CallByNameChecker - About to check Call By Name usage in the following projects...");
            IDictionary <string, Project> projects = ProjectDiscovery.Discover("ProjectConfiguration");

            foreach (Project project in projects.Values)
            {
                log.InfoFormat("\t{0}", project);
            }

            log.Info("CallByNameChecker - About to find all Call By Name occurrences...");
            Finder            finder      = new Finder(projects.Values);
            List <CallByName> occurrences = finder.Find();

            log.InfoFormat("CallByNameChecker - Found total of {0} Call By Names...", occurrences.Count());

            CheckDangerousUsage(occurrences);
            CheckDuplicateEvents(projects, occurrences);

            log.Info("CallByNameChecker - Done.");
        }