Static Analyzer
Tizen Static Analyzer is a source code analysis tool that finds bugs in Tizen applications:
-
Running the Static Analyzer
Describes how to launch the Tizen Static Analyzer with your application.
-
Detectable Bugs
Defines the types of bugs Tizen Static Analyzer can detect.
-
Viewing Static Analyzer Results
Describes the results analyzed by Tizen Static Analyzer.
Running the Static Analyzer
To run a static analysis for your application:
-
In the Project Explorer view, right-click the project and select Check Potential Bugs with Build.
- View the analysis results in the Potential Bugs view on the right side.
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
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.
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:
- Go to Windows > Show View > Other.
- Type Potential Bugs.
- Select Potential Bugs and click OK.
Figure: 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