## CodeScanner preferences

Use the CodeScanner General page in the Preferences window (Figure 1) or the project's properties window (Figure 2) to define where CodeScanner should output its generated report files and the format. You can also export and import Codescanner configuration files to enable sharing file types and rule sets across projects and programming teams.

Figure 1. CodeScanner global settings

Name | Description
--- | ---
Configure Project Specific Settings... | Click to open the project Properties window and configure CodeScanner for that specific project. NOTE Only visible in the global CodeScanner preference panels. This also applies to the File Filters and Rules pages
CodeScanner directory | Type the path, or click Browse to locate codescanner.exe.
Generate HTML report | Activate to generate reports in HTML format. Reports are stored in the Reports directory and can be viewed using a browser.
Generate XML report | Activate to generate reports in XML format. Reports are stored in the Reports directory and can be viewed using a browser.
Reports directory | Type the path, or click Browse to set the location the generated report files are stored.
Enable Knowledge Base Scanning | If enabled, CodeScanner will scan code and detect possible API issues related to a specific SDK, for example when porting to a new Touch UI SDK. For each SDK, specific porting information is defined as a set of rules specified in XML files. CodeScanner will import the rules and add them to the existing set of CodeScanner rules to be used during scanning operations. The results will be displayed in the Console view and as information markers in source code. Click on an information marker or right-click on marker and select Quick Fix to display more information. Details of a CodeScanner/knowledge base marker are shown in a contextual help dialog when the mouse hovers over a particular marker. Each Quick Fix related information has an icon image. A light bulb icon indicates a link to an external reference, which can be accessed by double-clicking. A green dot icon means there is no external reference. To show information markers in the Problems view make sure that Show > Show All is selected in the View Menu (upside down triangle icon) in the Problems view. Right-click on a marker and select View More Information or Quick Fix for additional information. Click Reference>> link button for additional information.
Import Settings... | Click to import a CodeScanner settings file.
Export Settings... | Click to export a CodeScanner settings file of the current configuration settings in XML format. Export your settings to enable you to add custom rules to the file.
Restore Defaults | Click to restore to system defaults. CodeScanner directory setting will be updated to current path of CodeScanner executable. Other settings in the General tab will be cleared, including the Reports directory.

Figure 2. Quick Fix Command for CodeScanner Information Marker

Figure 3. Information Marker for CodeScanner Result

The CodeScanner plug-in supports a named extension point named "com.carbide.cpp.codescanner.rules". Other plugins can contribute CodeScanner rules by adding this extension point to the plugin.xml file and specifying the plugin-relative location of the rules xml files in the location element of this extension.

For example:

<plugin>
<extension point="com.carbide.cpp.codescanner.rules">
<ruleSet
name="Touch SDK"
location="data/rules"
/>
</extension>
</plugin>

When the "Enable Knowledge Base Scanning" option is enabled, CodeScanner will locate plugins using this extension point and then read the rules in the xml files. Plugins that contain SDK information can be updated by using the Software Updates feature in the Help menu.

In the Express edition of Carbide.c++, the CodeScanner preference page is diasbled. In the Express version, when you select the Run CodeScanner command, CodeScanner will read the rules using the KnowledgeBase extension point and perform scanning ONLY with these rules (existing CodeScanner rules will be exlcuded).

NOTE If you install a newer version of Carbide over an existing workspace, you may receive an error that CodeScanner cannot be found when trying to run CodeScanner. If this occurs, ensure that the CodeScanner directory is updated in both the CodeScanner global preference panel and the project specific CodeScanner panel.
Example directory: C:\Program Files\Nokia\Carbide.c++ v2\plugins\com.nokia.carbide.cpp.codescanner_2.0.0.002_2008xxxxxxxx\Tools

### CodeScanner for projects

CodeScanner options can also be set at the project level. Right-click the project and choose Properties, then select the Carbide.c++ > Carbide CodeScanner element in the properties list. Click a tab to view the appropriate page and set its options.

Figure 4. CodeScanner project settings

CodeScanner options specific to the project.

Name | Description
--- | ---
Enable Project Specific Settings | Activate to set project specific CodeScanner settings. By default a project in the workspace uses the global CodeScanner settings unless this option is activated.
Configure Workspace Settings... | Click to open the Preferences window and configure CodeScanner for the workspace. NOTE Only visible in the project CodeScanner property panels.
Enable Knowledge Base Scanning | If enabled, CodeScanner will scan code and detect possible porting issues related to a specific SDK. For each SDK, specific porting information is defined as a set of rules specified in XML files. CodeScanner will import the rules and add them to the existing set of CodeScanner rules to be used during scanning operations. The results will be displayed in the Problems view as information markers pointing to source code locations.
Scan project automatically | Activate to automatically run CodeScanner every time you build the project.

##### Other references

- CodeScanner File Filters
- CodeScanner Rules