Search in sources :

Example 1 with PsiCFGAnalysisUtil

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();
}
Also used : PsiCFGAnalysisUtil(com.android.tools.idea.experimental.codeanalysis.utils.PsiCFGAnalysisUtil) PsiCFGClass(com.android.tools.idea.experimental.codeanalysis.datastructs.PsiCFGClass)

Aggregations

PsiCFGClass (com.android.tools.idea.experimental.codeanalysis.datastructs.PsiCFGClass)1 PsiCFGAnalysisUtil (com.android.tools.idea.experimental.codeanalysis.utils.PsiCFGAnalysisUtil)1