use of com.android.tools.idea.experimental.codeanalysis.utils.PsiCFGAnalysisUtil in project android by JetBrains.
the class CodeAnalysisMain method analyze.
public void analyze(@NotNull AnalysisScope scope) {
// PsiDocumentManager.getInstance(mProject).commitAllDocuments();
//Create a mScene for this project.
//Each project has its own mScene.
mScene = PsiCFGScene.createFreshInstance(mProject);
PsiCFGAnalysisUtil AnalysisUtil = mScene.analysisUtil;
//Get list of java files available in this project
int fileCount = scope.getFileCount();
//LOG.info("File count in scope " + fileCount);
PsiFile[] allFilesInScope = findAllJavaFiles(mProject, scope);
//LOG.info("File count in visitor " + allFilesInScope.length);
//outputFileNames(allFilesInScope);
//Extract all java classes from java files.
//Consider these classes are application classes.
//As they are written by developer
initiateProjectClassesFromPsiFile(allFilesInScope);
PsiCFGClass[] allClasses = mScene.getAllApplicationClasses();
//Perform the analysis
AnalysisUtil.performStage0();
AnalysisUtil.performStage1();
AnalysisUtil.performStage2();
AnalysisUtil.performStage3();
AnalysisUtil.performStage4();
//AnalysisUtil.summarizeStage();
AnalysisUtil.performStage5();
AnalysisUtil.performStage6();
}
Aggregations