Esempio n. 1
0
        private AnalysisConfig CreateAnalysisConfig(string fileFullPath, IAnalysisResultHandler cliAnalysisResultHandler, AnalysisConfig baseAnalysisConfig)
        {
            AnalysisConfig _config = new AnalysisEntityFactory().CopyAnalysisConfigWithoutSourcecode(baseAnalysisConfig);

            _config.ResultHandler      = cliAnalysisResultHandler;
            _config.SourceFileFullPath = fileFullPath;
            _config.GenerateFileNameWithSourceFileFullPath();
            _config.GenerateModulePath();

            return(_config);
        }
        internal void WriteJson(List <AnalysisResult> resultList)
        {
            if (resultList.Count == 0)
            {
                return;
            }

            string resultFolderStr = DexterConfig.Instance.DexterHome + "/" + DexterConfig.RESULT_FOLDER_NAME;

            DexterUtil.CreateFolderIfNotExist(resultFolderStr);

            IAnalysisEntityFactory factory    = new AnalysisEntityFactory();
            AnalysisResult         baseResult = factory.CreateAnalysisResultList(resultList);

            RemoveOldResultFile(baseResult, resultFolderStr);
            WriteJsonResult(baseResult, resultFolderStr);
        }
Esempio n. 3
0
        public AnalysisConfig ToAnalysisConfig()
        {
            AnalysisEntityFactory configFactory  = new AnalysisEntityFactory();
            AnalysisConfig        analysisConfig = configFactory.CreateAnalysisConfig();

            analysisConfig.ProjectName        = ProjectName;
            analysisConfig.ProjectFullPath    = ProjectFullPath + "/";
            analysisConfig.ModulePath         = ModulePath;
            analysisConfig.SourceBaseDirList  = SourceDirList;
            analysisConfig.HeaderBaseDirList  = HeaderDirList;
            analysisConfig.SnapshotId         = SnapshotId;
            analysisConfig.ResultFileFullPath = ResultFileFullPath;

            string type = ConfigType;

            switch (type)
            {
            case "PROJECT":
                analysisConfig.AnalysisConfigType = DexterConfig.AnalysisType.PROJECT;
                break;

            case "SNAPSHOT":
                analysisConfig.AnalysisConfigType = DexterConfig.AnalysisType.SNAPSHOT;
                break;

            case "FOLDER":
                analysisConfig.AnalysisConfigType = DexterConfig.AnalysisType.FOLDER;
                break;

            case "FILE":
                analysisConfig.AnalysisConfigType = DexterConfig.AnalysisType.FILE;
                break;

            default:
                analysisConfig.AnalysisConfigType = DexterConfig.AnalysisType.UNKNOWN;
                break;
            }

            return(analysisConfig);
        }