Example #1
0
        //Method which starts the execution of all the functionalties in all the packages
        public bool startExecutive()
        {
            commandLineParser.Args = args;
            commandLineParser.parseCommandLines();

            fileManager.Patterns = commandLineParser.Patterns;
            fileManager.Recurse  = commandLineParser.Recurse;

            foreach (string path in commandLineParser.DirectoryPaths)
            {
                fileManager.findFiles(path);
            }

            analyzer.Files = fileManager.getFiles();

            foreach (string path in commandLineParser.FilePaths)
            {
                analyzer.Files.Add(path);
            }

            analyzer.FindRelationship = commandLineParser.Relationships;
            analyzer.analyze();

            analyzer.generateXml = commandLineParser.Xml;

            display.displayTypesDetails();

            if (!commandLineParser.Relationships)
            {
                display.displayComplexityDetails();
            }
            else
            {
                display.displayRelationshipsDetails();
            }

            if (analyzer.generateXml == true)
            {
                xmlDislay.generateXmlTypesDetails();

                if (commandLineParser.Relationships)
                {
                    xmlDislay.generateRelationshipsDetails();
                }
                else
                {
                    xmlDislay.generateXmlComplexityDetails();
                }

                xmlDislay.saveXml();
            }

            return(true);
        }
Example #2
0
            //Test Stub
            public static void Main(String[] args)
            {
                XmlDisplay xmlDisplayForTestStub = new XmlDisplay();
                Repository rep = Repository.getInstance();
                /* If the package is run as stand alone application
                  * then add the default values for the member variables
                 */
                try
                {
                    if (rep.locations.Count == 0)
                    {
                        Console.WriteLine("The repository is empty. Nothing to display");
                    }

                    xmlDisplayForTestStub.generateXmlTypesDetails();
                    xmlDisplayForTestStub.generateXmlComplexityDetails();
                    xmlDisplayForTestStub.generateRelationshipsDetails();
                }
                catch
                {
                    Console.WriteLine("Error occured during xml generation. Check the input parameters");
                }
            }