- Qt Creator Manual
- Static Code Analysis
- Qt Creator Manual 11.0.0-beta2

Checking Code Coverage ◦ Using Valgrind Code Analysis Tools

# Static Code Analysis

Axivion Suite is a tool suite for protecting software from erosion. Static code analysis, architecture analysis, and code-smells-detection enable you to:

- Check the source code for potential runtime errors.
- Use metrics to generate quantitative information about the internal quality of the source code.
- Run style checks to achieve compliance with coding guidelines.
- Detect both duplicates and similar pieces of code in the source code.
- Recognize cyclical dependencies at different levels.
- Detect unreachable code.

The experimental Axivion plugin integrates the Axivion dashboard server into Qt Creator.

To use the plugin, you must set up a project in the Axivion dashboard server and link to it from Qt Creator. You can then see style violations in the Edit mode and descriptions and issue counts in the Axivion view.

The editor shows style violations as inline annotations. Hover the mouse over an annotation to bring up a tool tip with a short description of the issue.

Select the button to view detailed information about the issue in the Axivion view.

To view the issue counts, select (Show Dashboard).

## Enabling the Axivion Plugin

To enable the Axivion plugin:

1. Select Help > About Plugins > Code Analyzer > Axivion to enable the plugin.
2. Select Restart Now to restart Qt Creator and load the plugin.

## Connecting to Axivion Dashboard Servers

To connect to Axivion:

1. Select Edit > Preferences > Axivion.

2. Select Edit to create a connection to the Axivion dashboard server.

3. In Dashboard URL, enter the URL of the server.
4. In Description, enter a free-text description of the server.
5. In Access token, enter the IDE application token that you created in the server, in user preferences.

## Linking to Dashboards

To link a project to a dashboard:

1. Projects > Project Settings > Axivion.

2. Select Fetch Projects to list projects from Axivion.
3. Select a project, and then select Link Project to link to it.

To unlink a project, select Unlink Project.

## Viewing Issue Counts

The Axivion view lists the numbers of the following types of issues that Axivion found in the linked project:

- AV - architecture violations, such as hidden dependencies
- CL - duplicates and similar pieces of code
- CY - call, component, and include cycles
- DE - dead code
- MV - violations of metrics based on lines and tokens, nesting, cyclomatic complexity, control flow, and so on.
- SV - style violations, such as deviations from the naming or coding conventions

To clear the view, select (Clear).

Checking Code Coverage ◦ Using Valgrind Code Analysis Tools