Mobile native Wearable native

Static Analyzer

Tizen Static Analyzer is a source code analysis tool that finds bugs in Tizen applications:

Running the Static Analyzer

To run a static analysis for your application:

  1. In the Project Explorer view, right-click the project and select Check Potential Bugs with Build.

    Running the Static Analyzer

  2. View the analysis results in the Potential Bugs view on the right side.

    Potential Bugs view

You can also enable the LLVM Static Analyzer to be run during the build process. Change the setting in the project properties: Tizen SDK > Static Analysis.

Figure: Static analysis properties

Static analysis properties

Detectable Bugs

Tizen Static Analyzer can detect bugs at compile time based on a set of predefined error conditions. The following table defines the set of bugs detectable by Tizen Static Analyzer.

Table: Detectable bugs
Bug Description
Memory Mismanagement Detects memory leaks, double free, double delete, mismatched allocator/deallocator, and use-after free problems.
Resource Mismanagement Detects dynamically-allocated resources, such as a file or socket that has not been closed or has been improperly handled.
Out of bound access Detects out-of-bound access of an array at static time.
Null Dereference Detects dereference of a null pointer.
Divide by Zero Detects division by zero issues.
Invalid Usage of C String API's Detects invalid access and usage of C string API's, such as passing a null pointer to strcpy.

Viewing Static Analyzer Results

The Tizen Static Analyzer results are displayed in the Potential Bug view after the analysis is completed.

The Potential Bug view opens automatically, when you make a build or check potential bugs. To open the Potential Bugs explicitly:

  1. Go to Windows > Show View > Other.
  2. Type Potential Bugs.
  3. Select Potential Bugs and click OK.

Figure: Opening the Potential Bug view

Opening the Potential Bug view

Opening the Potential Bug view

In the Potential Bug view, you can group the warnings based on type or file. You can also select any particular bug and expand it to see the complete flow, which resulted in the issue.

Figure: Static Analyzer Results

Static Analyzer Results

Go to top