Online Manual



Configuring the Analysis

Configuring the Analysis

To transition from the phase Not Analyzed to Being Analyzed, you need to start computing the new analysis or loading the previously stored analysis. Saving and loading of the analysis is discussed further. This chapter describes how to configure and start the new source analysis.

The key concept of SourceGlider is that you need to collect all the analysis information before using analysis outcome. This means that you need to understand what you want to analyze, configure the analysis properly, compute the analysis and use its outcome. If you realize that the computed analysis is not what you want, you will need to recompute the analysis from the beginning. Although there are possibilities to dynamically change the set of analyzed sources (see Modifying the Analysis), it is recommended to correctly define all the parameters before the start of analysis.

There are two types of analyses: Composite Analysis and Quick Analysis. Quick Analysis (Local Analysis) is perfect when you need to analyze only one Compilation Unit (either Java source file or class file with attached source). Composite Analysis is needed to analyze several Compilation Units.

Note: Computing the Composite Analysis on several Compilation Units (Working Set) is not the same as the consecutive computing of Quick Analyses on each Compilation Unit of the Working Set, because there is a dataflow information that "flows" through these units (e.g. some methods declared in one unit are used in another one), and only Composite Analysis is able to analyze this information.

Quick Analysis (Local Analysis)

Quick Analysis is performed on exactly one Compilation Unit. You need to select this unit or some Java Element inside this unit before starting Quick Analysis. Simply position the caret at some method/type/field name in the Java Editor or select some method/type/field in Package Explorer or Outline views (more on selecting Java Elements is described in Selection of Java Elements).

You can launch Quick Analysis by one of three ways:

  • Press Ctrl+` on the keyboard (` is the button on the keyboard above the Tab button)
  • Select Source Analysis > Show Analysis Report in the Eclipse menu
  • Follow the corresponding link in the Analysis Report View

Note: Ctrl+` combination is also used in Composite Analysis to force the change of Java Element in the Analysis Report View. You can change this combination in the Settings.

Quick Analysis runs almost instantly except for extremely big source files. Therefore unlike Composite Analysis, Analysis Progress View and Analysis Console are not being shown during Quick Analysis. Quick Analysis always computes the full set of possible analyses for particular Compilation Unit.

Right after Quick Analysis finishes, Analysis Report View will be available for Java Element context Queries.

Note: Quick Analysis is also called Local Analysis, because it contains only one analyzed Compilation Unit. Therefore you may get incomplete results, for example if you search the usages for some public variable, SourceGlider will show results for only one Compilation Unit. Don't be confused by this limitation. When Quick Analysis is active, the special message appears on the Analysis Report View with a description of possible limitations.

Composite Analysis

You can launch Composite Analysis by either of three ways:

  • Press button in the toolbar
  • Select Source Analysis > Start Analysis in the Eclipse menu
  • Follow the corresponding link in the Analysis Report View

Before the transition to Being Analyzed phase you need to configure the Composite Analysis using Composite Analysis Wizard. Wizard has two pages: Working Set Page and Analysis Complexity Page. First page customizes the set of source files needed to analyze (Working Set). The second page customizes the type of analysis performed on these source files.

Both pages have Summary Pane at the bottom of dialog that shows the total size of chosen Working Set, estimated analysis time and estimated analysis runtime memory, which value is based on the total size of Working Set and total analysis complexity.

Working Set Page

Working Set is the set of Compilation Units (either Java source files or class files with attached sources) on which the source analysis runs.

Working Set Page allows to choose Working Set, load and store predefined Working Sets and set Units Processing option.

The central part is the tree viewer that displays all Java projects currently opened in the workspace. The total size of all Compilation Units for each folder is calculated and displayed in the tree view. You can select either separate Compilation Units or the entire folders. In the latter case all recursive Compilation Unit children will be selected.

Note: You cannot select Jar packages, you can only select separate class files inside them.

When you add particular files or folders to the Working Set, the total size and estimated analysis time at the Estimation Pane are recomputed.

Select All and Deselect All buttons help to select/deselect all Compilation Units in all projects of the workspace.

Save Working Set opens the dialog where you can save the current Working Set with a particular name. The default name is the name of the project if all selected Compilation Units are located inside some particular project. Stored Working Sets are persistent across Eclipse launches.

Load Working Set opens the similar dialog where you can choose previously saved Working Set and load it.

Before loading of particular Working Set you can inspect its contents.

In both Save Working Set and Load Working Set dialogs you can remove particular saved Working Sets if they are no longer needed.

Load Analysis is the another way to load stored analysis.

Units Processing is an option to customize the Units Processing mechanism that is used during computing analysis phase.

  • Process units together allows to handle all Compilation Units as a single set of units. This method is faster than separate processing but not safe when units contain compilation errors. If due to compilation errors some units fail to process, the whole analysis will fail too.
  • Process units separately allows to handle all Compilation Units one by one. If due to compilation errors some units fail to process, the whole analysis will not fail.

Press Next to move to Analysis Complexity Page or Finish to apply the default analysis complexity settings and start the analysis now.

Analysis Complexity Page

Analysis Complexity Page allows to customize analysis complexity: you can choose several Analysis Types, options and profiles.

Analysis Type is the particular type of analysis, one of:

  • Callees Analysis
  • Objects Analysis
  • Dependencies Analysis
  • etc...

Each Analysis Type is dependent on zero or more other Analysis Types. For example for computing Callees Analysis it is necessary to compute Types Analysis first.

More on types of analyses see the Reference.

Analysis Option is the option that is related to some particular Analysis Type. For example, the option Handle Arrays regulates the Points To (Equals) Analysis whether to compute Points To information for arrays or not.

Analysis Profile is the set of Analysis Types with particular Analysis Options, e.g. Dependencies+ is the set of the Analysis Types that are related to Dependencies Analysis and all other analyses that are being computed not slower than Dependencies Analysis.

More on Analysis Profiles see the Reference.

Using the table at the top of the Analysis Complexity Page you can select individually each Analysis Type. The column dependencies shows the list of direct prerequisite Analysis Types. The column estimated time shows estimated time of computing particular Analysis Type (on particular Working Set). When you select some Analysis Type, all other types that are transitive dependent on selected type will be also selected. It is not permitted to deselect particular Analysis Type if there are other selected types that are transitive dependent on deselecting type.

When you select some particular Analysis Type of Analysis Profile, its textual description appears at the Description group.

Select All and Deselect All buttons help to select/deselect all available Analysis Types.

You can customize analysis by selecting/deselecting some Analysis Options in the Analysis Options Pane at the left. Options that refer to currently non-selected Analysis Type are disabled.

Instead of selecting Analysis Types individually, you can select the Analysis Profile in the Analysis Profile List at the right. All Analysis Types that belong to particular Analysis Profile will be automatically selected. When you select some Analysis Types individually, the currently selected Analysis Profile (if there is any) is deselected.

Arrays Filters and Threads Filters buttons are the another way to customize Analysis Filters.

Both pages remember the previous settings. That means if you launch Composite Analysis Wizard again, Working Set Page will contain previously chosen Working Set, while Analysis Complexity Page will contain previous analysis complexity settings.