Exemple #1
0
        /// <summary>
        /// Main method (Entry point)
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.Write("\n\t\t\t  Demonstrating Parser");
            Console.Write("\n\t =========================================================\n");
            ReqOneTwo();
            ReqThree();
            Console.WriteLine("Following files are being evaluated:\t");
            Dictionary <string, List <Elem> > dicTables = new Dictionary <string, List <Elem> >();
            ResultSet oResult = new ResultSet();

            Console.Write("\n\n\t\t  Displaying Type Tables ");
            Console.Write("\n\t\t ==========================\n");
            TAnal objTAnalysis = new TAnal();

            dicTables = objTAnalysis.DoTypeAnalysis(GetFilesFromArg(args[0]));
            oResult.WriteTypeAnalysisResult(dicTables);
            Display.ShowTypeTables(dicTables);
            Console.Write("\n\t\t  Displaying Dependencies ");
            Console.Write("\n\t\t =========================\n");
            Dependencies objDependencies = new Dependencies();
            Dictionary <string, HashSet <string> > dicDependencies = new Dictionary <string, HashSet <string> >();

            dicDependencies = objDependencies.DoAnalysis(dicTables);
            oResult.WriteDepAnalysisResult(dicDependencies);
            Display.ShowDependencies(dicDependencies);
            Console.Write("\n\t\t  Displaying Strong Components ");
            Console.Write("\n\t\t ===============================\n");
            Scc objScc = new Scc();
            HashSet <List <string> > lstScc = objScc.GetSCC(dicDependencies);

            oResult.WriteSCCResult(lstScc);
            Display.ShowSCC(lstScc);
            Console.Write("\n\n");
            //Console.ReadLine();
        }
        /// <summary>
        /// Test Stub for Display package
        /// </summary>
        /// <param name="args"></param>
#if (TEST_DISPLAY)
        static void Main(string[] args)
        {
            Console.Write("\n  Testing Display Package");
            Console.Write("\n ===========================\n");
            Dictionary <string, HashSet <string> > dependencies = new Dictionary <string, HashSet <string> >();
            HashSet <string> lst = new HashSet <string> {
                "file2.cs", "file3.cs"
            };

            dependencies.Add("file1.cs", lst);
            Elem oElem = new Elem();

            oElem.type = "class";
            oElem.name = "testclass";
            Dictionary <string, List <Elem> > dicMetrics = new Dictionary <string, List <Elem> >();
            List <Elem> repoLoc = new List <Elem> {
                oElem
            };

            dicMetrics.Add("file1.cs", repoLoc);
            Console.Write("\n  showMetricsTable method\n");
            Display.showMetricsTable("file1.cs", repoLoc);
            Console.Write("\n  ShowTypeTables method\n");
            Display.ShowTypeTables(dicMetrics);
            Console.Write("\n  ShowDependencies method");
            Display.ShowDependencies(dependencies);
            HashSet <List <string> > lstScc = new HashSet <List <string> >();
            List <string>            lstcc  = new List <string> {
                "file1", "file2", "file3"
            };

            Console.Write("\n  ShowSCC method\n");
            lstScc.Add(lstcc);
            Display.ShowSCC(lstScc);
            Console.ReadLine();
        }