Summary: This section describes the predefined Environment Profiles supplied with the extension and the custom Environment Profiles that can be created where required.
Environment Profiles can only be managed by the legacy CAST Management Studio (no interface available in AIP Console to do this).
Introduction
Environment Profiles are a set of predefined (by CAST) or custom configuration settings that can be included in an analysis:
Predefined Environment Profiles
Predefined Environment Profiles are applied to analyses automatically by the extension, depending on the technology options you choose, whether at default level or at Application or Analysis Unit level.
CAST provides one predefined Environment Profile in the .NET Analyzer extension that can be included in an analysis. This predefined Environment Profile is for defining the JavaScript libraries used in your source code that you want to flag as "external". When flagged as external, JavaScript objects matching the definition will be analyzed and stored in the CAST Analysis Service (thus allowing links to resolve correctly), however the objects will not appear in the CAST Engineering Dashboard. This prevents the "pollution" of Technical Size measures, module/application grades, and violation lists (among others) with large numbers of JavaScript objects that are not used and not maintained by the Development team.
Custom Environment Profiles
A custom Environment Profile can be particularly useful where you have several Analysis Units (for example a large project that has been split) that rely on the same specific settings. By creating a custom Environment Profile that defines these settings, you avoid having to configure each Analysis Unit with the same settings - instead you simply include the custom Environment Profile at Application or Analysis Unit level using the Custom Environment Profile option. When the analysis is run, the settings in the Environment Profile are taken into account.
For the .NET Analyzer extension, it is possible to create Environment Profiles as follows:
- JavaScript libraries used in your source code that you want to flag as "external"
Managing custom Environment Profiles
If you want to create new custom Environment Profiles, you need to use the Environment Profile Manager. This can be accessed from the Analysis tab in the Application or Analysis Unit:
The Profile Manager will then launch:
- The left hand section displays a collapsible list of any Predefined or existing Custom Environment Profiles listed by technology, then by profile name. If this the first time you have used the Environment Profile dialog box, then this section will only contain the CAST AIP predefined profiles - they will be grayed out. If you have already created profiles then you can expand the list and select the profile you want to modify or delete.
- The right hand section provides the means to define new profiles and get access to existing profiles for modification and deletion purposes.
Creating a custom profile
After clicking the icon next to DotNET Environment Profile, a new screen will be displayed containing various tabs:
- General > For defining a name for the Environment Profile and for defining Class Paths
- JavaScript Frameworks > For defining the JavaScript libraries used in your source code that you want to flag as "external".
General tab
- Enter a name for the Environment Profile. Choose a name that is easily recognizable as this name will be displayed in the left hand collapsible list and will be used when you add the Environment Profile at Application or Analysis Unit level.
JavaScript Frameworks tab
The JavaScript Frameworks tab allows you to define the JavaScript libraries used in your source code that you want to flag as "external". When flagged as external, JavaScript objects matching the definition will be analyzed and stored in the CAST Analysis Service (thus allowing links to resolve correctly), however the objects will not appear in the CAST Engineering Dashboard. This prevents the "pollution" of Technical Size measures, module/application grades, and violation lists (among others) with large numbers of JavaScript objects that are not used and not maintained by the Development team.
Method | Allows you to choose between two methods of detecting your JavaScript Frameworks:
|
Value | Displays the Regular Expression or value you have entered. This will be used to match items. |
User Comment | A comment that you can add to help distinguish your item. |
- Click the icon to create a new matching rule - the Add/Edit Rule dialog box will be displayed.
- Next choose the Method from the drop down list - choose between File Path and File Content
Next add the Value to match. You can use Regular Expressions, for example:
- * = a string of characters not containing any "/". E.g.: *-jquery.js (would match custom-jquery.js)
- ** = a string of characters that contain "/". E.g.: **-jquery.js (would match test/project/new/custom-jquery.js, or test/custom2-jquery.js)
- ? = one character. E.g.: ?-jquery.js (would match a-jquery.js)
- Next add a User Comment to help you distinguish the matching criteria.
For example:
Enabling custom Environment Profiles
Use the following options in the Analysis tab at Application/Analysis Unit level to select a custom Environment Profile you have created (click to enlarge):