On this page: |
Summary: this pages describes all analysis configuration options that are available for the JEE Analyzer. |
The CAST Management Studio has three levels at which analysis configuration options can be set:
Technology |
|
Application |
|
Analysis Unit |
|
Some settings at Application and Analysis Unit level have a "Reset" option - using this will reset the option to the value set at the parent level: |
Using the Technology level or Application level options, validate the Analysis settings for JEE packages. Make any update as required. These settings apply to the Technology or Application as a whole (i.e. all Analysis Units):
As explained in JEE Analyzer - Packaging, delivering and analyzing your source code, the CAST Delivery Manager Tool extracts relevant information used to create the automated analysis configuration from the JEE project files. Currently the extension supports these build project files:
For any other build project format (e.g. Apache -ant) the CAST Delivery Manager Tool will not be able to automatically retrieve build information: no Analysis Unit will be created and no analysis configuration provided. To address this situation, the Analysis Unit and the analysis configuration should be created manually. This case falls outside of the out-of-the-box support and is out of scope of a standard analysis. |
To inspect the auto-generated analysis configuration, you should review the settings in each Analysis Unit - they can be accessed through the Application editor:
The available options for configuring an analysis are described below. Note that some options are not available at specific levels (Technology/Application/Analysis Unit):
This tab and its child tabs (Java, Resources and Web Application) show the location of each type of source code in the JEE Analysis Unit - this is determined automatically by the CAST Delivery Manager Tool. You should, however, review the configuration and make any changes you need (click to enlarge):
Java File Extensions | This section displays a list of the file extensions that are included in the current file filter for your Java code analysis. Only files that match these file extensions will be taken into account during the analysis. | |
Java Files | Use this section to include or exclude specific source files for the Analysis Unit for analysis purposes - these are mainly to be used when you are manually creating your Analysis Unit but can also be used if you are modifying an automatically created Analysis Unit.
|
XML / properties files
These options manage the location of your XML and .properties files.
You can find out more about:
|
XML File Extensions | This section displays a list of the file extensions that are included in the current file filter for the XML files in your analysis. Only files that match these file extensions will be taken into account during the analysis.
| |
Also use Project Root Path for XML / Property Files | If you select this option, the project root path (i.e. the location of the .project file for the Analysis Unit) will be used as a source for the XML / .properties files. If you wish to add additional source files use the option described below. | |
XML / Property Files | Use this section to include or exclude specific source files for the Analysis Unit for analysis purposes - these are mainly to be used when you are manually creating your Analysis Unit but can also be used if you are modifying an automatically created Analysis Unit.
|
The JEE Analyzer extension supports the analysis of web applications that do not contain a web.xml application descriptor. In this situation, the "Web Application Root Path" (i.e. the location of web server files such as *.XHTML and *.JSP) can be automatically discovered by the analyzer based on the location of the web files on disk. To this end, the field Web Application Root Path at Analysis Unit level is now an optional field in the CAST Management Studio. If the source code does not contain a web.xml file, the Web Application Root Path is now automatically discovered by exploring each Analysis Unit's project path (i.e. the location of the .project file) on disk, however, it can be overridden manually. |
Web Application Root Path | Indicates the folder that is defined as the web application root folder for the Analysis Unit for analysis purposes. The Web Application Root Path is the path to the folder that contains web server files (*.XHTML, *.JSP etc.). This field does not need to be populated (i.e. it is optional). If this Analysis Unit has been automatically defined during the "Set as Current Version", then the JEE Analyzer will attempt to populate this field automatically. You can choose a different location (use Browse) if necessary, however, CAST recommends letting the CAST Management Studio handle this. Note that:
| |
Web Application Descriptor | Indicates the JEE application's Web Application Descriptor. By default, the JEE Analyzer will use the Web Application Root Path set above and append \WEB-INF\web.xml. If this is not correct for your application, you can choose a new Application Descriptor.
|
Web Server
Web Server File Extensions | This section displays a list of the file extensions that are included in the current file filter for your source code analysis. Only files that match these file extensions will be included in the analysis. | |
Also use Web Application Root Path for Web Server Files | If you select this option, the Web Application Root Path will be used as a source for the web server files. If you wish to add additional source files use the option described below. | |
Web Server Files | Use this section to include or exclude specific source files for the Analysis Unit for analysis purposes - these are mainly to be used when you are manually creating your Analysis Unit but can also be used if you are modifying an automatically created Analysis Unit.
|
Web Client Files The JEE Analyzer does not support the analysis of web client files such as *.HTML, *.CSS, *.JS. These files must now handled by the HTML5 and JavaScript extension. |
Java Version | The analyzer will assume that that latest version of the JDK has been used to compile the application source code. If your application source code does not use the latest JDK, you can override the selection manually:
| |||||||
Class Paths | Class Paths are automatically discovered by the CAST Delivery Manager Tool through the inspection of the project files. If the project files are missing, Class Paths must be added manually to the Analysis Unit and must be discovered via inspection of the delivered source code or by inquiring with the Application Team. The analyzer uses this information to search for external classes that are referenced in project code but not defined in your source code files. Classpath entries can be either a file or a folder. When analyzing a folder, the analyzer assumes that classes are correctly deployed on disk and that they respect the naming convention where a package maps to a folder and a class maps to a file.
|
This section governs the settings that will be applied if your JEE project is defined as a web application:
Enable JEE Web Profile Analysis
YES | When set to the default YES position, the analyzer is capable of analyzing web files (.JSP, .XHTML etc) even if no Web Application Descriptor (web.xml) is present in each Analysis Unit in the Application. These web files are instead identified for analysis by exploring each Analysis Unit's Analysis Unit's project path (i.e. the location of the .project file). |
NO | When set to the NO position, the behaviour will revert to pre-CAST AIP 8.2.x. In other words a Web Application Descriptor (web.xml) must be present in the Application and defined in the relevant field in each Analysis Unit in order that web files (.JSP, .XHTML etc.) are analyzed. |
Web Client Files The JEE Analyzer does not support the analysis of web client files such as *.HTML, *.CSS, *.JS. These files must now handled by the HTML5 and JavaScript extension. |
JEE (Servlets/JSP) version used by the application
The analyzer will assume that that latest Servlet/JSP version has been used to compile the application source code.
Use the drop down list box to choose the correct option if your application source code uses an older version. It is possible to obtain the JSP version in use by opening the application's web.xml file and locating the DTD version used to define the servlet - this is the servlet version. The servlet version is 2.3 in the example below:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> |
Using this information, see the table below for equivalence:
Servlet version | JSP version |
---|---|
2.1 or 2.2 | 1.1 |
2.3 | 1.2 |
2.4 | 2.0 |
2.5 | 2.1 |
3.0 | 2.2 |
3.1 | 2.3 |
For more information about frameworks see JEE framework analysis. |
The Framework section governs the analysis settings used when a specific Java framework is present in your source code. These pre-defined settings are designed to address specific recurrent issues during analysis and correspond to default Environment Profiles. Each framework has an associated drop down list box with various options:
By default, the option for these Frameworks will be set to "Latest". In other words, the analyzer always assumes that you are using the latest available release supported by the JEE analyzer extension. You can override the default setting if required:
Note that from in JEE Analyzer ≥ 1.1.0, the Struts Version combo box has no impact: by default, all supported versions of Apache Struts are handled by default. The combo box will be removed in a future release. |
Auto discovery and configuration of Web Services (WBS Services) and Enterprise Java Bean (EJB) is not supported. The CAST AI Admin will need to gather the required information from the application team or inspect the delivered source code to determine the proper configuration of these parameters. Then a decision will need to be made to select the correct version of each:
Web Services | EJB |
Note:
|
Other frameworks, such as those listed below are always handled "out-of-the box":
Note:
|
When unsupported frameworks (i.e. not supported out-of the box) are part of the delivery, a Custom Environment Profile needs to be created to enable correct processing. To identify unknown frameworks or custom frameworks, there are various methods:
Framework | DTD | ||
---|---|---|---|
Hibernate |
| ||
iBATIS |
| ||
Spring |
|
Framework | Libraries |
---|---|
Hibernate | hibernate3.jar |
iBATIS | ibatis-common-2.jar |
Spring | spring-1.2.7.jar |
If you have detected this framework through an XML file, you can start to customize the support of this XML (see Manage XML configuration files), but in any case, CAST recommend that you read up how it works and how it is configured. |
This section enables you to define Regular Expressions (that match character strings in your selected files) that you want to replace with other text:
|
Add called files to selected files list | Selecting this option will automatically add any files to the list of files selected for analysis that are called by files that you have already selected. | |
Add included files to selected files list | Selecting this option will add any files to the analysis list that are included in files that you have already selected. | |
Maximal Complexity | This option enables you to manually enter a percentage which will refer to the m complexity of the analysis process.
When the limit is reached, links to the function will be created correctly, but links from the function will not be created. You should alter the complexity percentage if your analyses are taking a long time to complete with the default setting of 100%. Changing the percentage to a lower figure will reduce the number of function analyses for a given file, thus improving performance. Remember though that doing will cause some links not to be created. |
Use Inference Engine | Use this option to activate the Inference Engine during the analysis. Run time type information will be computed in order to simulate program behaviour during execution of the analyzer and thus identify additional links that would not otherwise be "discovered" using standard analysis techniques. This technology detects a reference to an object wherever its name is mentioned, regardless of the context in which this reference occurs. Please note that disabling the Inference Engine:
|
String Concatenation | When the Inference Engine is active, this value limits the number of strings that will be found during the search of each object value. Note that limiting the number of strings can lead to incomplete results, however, performance is improved. |
Procedure Call Depth | When the Inference Engine is active, this value limits the number of intermediate values that the Inference Engine must resolve in order to obtain the value of the object that is being searched for. Note that limiting the number of intermediate values can lead to incomplete results, however, performance is improved. The lowest value you can enter is 1. |
Local Procedure Complexity | When the Inference Engine is active, this value limits searches of large methods that have a high Cyclomatic Complexity level. |
Procedure Call Depth | When the User Input Security feature is active, this value limits the number of intermediate values that the User Input Security Engine must resolve in order to obtain the value of the object that is being searched for. Note that limiting the number of intermediate values can lead to incomplete results, however, performance is improved. The lowest value you can enter is 1. |
Number of Instances | This option allows you to limit the number of objects held in memory before they are committed to disk during the save process of an analysis. Please contact CAST Support before modifying this option. |
See the CAST Management Studio help for more information about this global option.
The Platform Setting tab is only visible at Technology level. |
CAST Script Library Directory | As part of CAST's framework XML Configuration file and Java Annotation extraction process via XQuery and Zorba, you are free to design your own XQuery files that will output data to a .castscript file in a syntax that can be understood by the analyzer. However, if you want to develop your own functions that will be outputted into the .castscript file, then you must specify these functions and their parent files in a specific location. You can use the Custom CAST Script Root Library path option (see above) to define this location. These libraries will then be used when they are invoked in the .castscript file during the analysis. Please see Manage XML configuration files for more information about this. |
CAST Tags Extension Folder | Use this option to designate a local folder that will contain your .tagsextension files. An absolute path to the folder is required. Please see Manage JSP custom tags for more information. |
Choose Deployment Folder | This option can be used when an analysis fails if a path to .JAR file (or its subfolders) that is unpacked to disk during the analysis exceeds the maximum Windows file path length (260 characters). CAST recommends entering a folder located near the root of the drive (for example D:\CAST) or a folder with as short a path as possible. |
XQuery Command | This option enables you to use a custom parsing method for parsing your XML Configuration files (for example an XSLT transformation) with a parser of your choice (for example XQuilla). If you intend to use this option you need to enter a command line as specified in the following example for XQuilla (see http://xqilla.sourceforge.net/CommandLine). C:\Program Files\XQilla\xquilla.exe $(CASTCommonDir)\EnvProf\iBatis\iBatis.xquery -i $(Input) -o $(Output) -v root $(AppRoot)
Note that these macros are all case-sensitive. Please see also: JEE Analyzer - Environment Profiles |
If the CAST Delivery Manager Tool did not detect any inter-Analysis Unit dependencies (i.e. Discovered dependencies) then it will create a "global" default dependency between JEE and JEE. CAST highly recommends that this default rule is removed if the deployed package contains more than three Analysis Units. In addition, CAST highly recommends that you avoid creating a custom JEE > JEE rule if the deployed package contains more than three Analysis Units.
This global default rule can cause the creation of inaccurate links between objects which has a knock on effect on Quality Rule results and on Quality Rule results and on Transaction flow.
When the automated configuration fails or it is not possible (i.e. project build file format not supported), the CAST AI Admin must resort to an in-depth inspection of the source code to build the Analysis Unit and configure them manually. For typical JEE applications this would require the identification of all application components including:
Please see the following pages for more information about advanced J2EE analysis configuration:
The discovering of frameworks, other than Hibernate, Struts or Spring, supported out-of the-box by CAST AIP, is based on pattern matching on the .jar files delivered. Configuration for those is a simple Yes (if a .jar file matching is found) and No otherwise. When unsupported frameworks (i.e. not supported out-of the box) are part of the delivery, a Custom Environment Profile need to be created to enable correct processing. See Review Dynamic Links for further details about how to address missing links situations.