Exemple #1
0
        static void Main(string[] args)
        {
            string            path        = null;
            List <string>     patterns    = new List <string>();
            List <string>     options     = null;
            FileMgr           fileManager = new FileMgr();
            CommandLineParser arguments   = new CommandLineParser();
            bool x_display = false;
            bool r_display = false;

            //****************fetches for the path,patterns and options given by the user***************//
            path     = arguments.processPath(args);
            patterns = arguments.processPattern(args);
            options  = arguments.processOptions(args);



            if ((options.Contains("/x")) || (options.Contains("/X"))) //Checks if the user wants the display in XML format
            {
                x_display = true;
            }
            if ((options.Contains("/s")) || (options.Contains("/S"))) //Checks if the user wants to search for the files in the sub directories
            {
                fileManager.recursion = true;
            }
            if ((options.Contains("/r")) || (options.Contains("/R"))) //Checks if the user wants to view the relationships
            {
                r_display = true;
            }
            Analyzer anal = new Analyzer();

            Display DispObj = new Display();

            string[] files = fileManager.getFiles(path, patterns); //returns all the files
            anal.doAnalysis(files);
            anal.reldoAnalysis(files);

            xml_class xml_obj = new xml_class();

            if ((r_display != true) && (x_display != true))
            {
                DispObj.DisplayReport(anal.typesBetweenFiles);
                DispObj.complete(anal.rel_BetweenFiles);
            }
            if (r_display)
            {
                DispObj.complete(anal.rel_BetweenFiles);
            }

            if (x_display)
            {
                xml_obj.display(anal.typesBetweenFiles, anal.rel_BetweenFiles);
            }
        }
Exemple #2
0
        void Main(string[] args)
        {
            FileMgr       file     = new FileMgr();
            List <string> patterns = new List <string>();
            string        path     = ("../../");

            patterns.Add("*.*");
            string[] files    = file.getFiles(path, patterns);
            Analyzer analyzer = new Analyzer();

            analyzer.doAnalysis(files);
            analyzer.reldoAnalysis(files);
            foreach (Elem e in typesBetweenFiles)
            {
                Console.Write("\n  {0,-10}  {1,-25}  {2,-5}  {3,-5}  {4,-5}  {5,5} ", e.type, e.name, e.begin, e.end, e.size, e.prog_complexity);
            }

            Console.WriteLine("\n \n The relationships between the types above are as follows\n");
            foreach (relationelem e in list_relations)
            {
                if (e.isInheritance == true)
                {
                    Console.WriteLine("\n  {0} is inheriting from {1}", e.b_class, e.a_class);
                }
            }


            foreach (relationelem e in list_relations)
            {
                if (e.isAggregation == true)
                {
                    Console.Write("\n  {0} is aggregating  {1}", e.a_class, e.b_class);
                }
            }



            foreach (relationelem e in list_relations)
            {
                if (e.isComposition == true)
                {
                    Console.Write("\n  {0} Composition  {1}", e.a_class, e.b_class);
                }
            }
        }