Analyzing Application Quality by Using Code Analysis Tools
The Code Analysis window is available all editions of Visual Studio 2013.
|
Code Analysis window |
Code analysis warnings now appear on the Code Analysis tool window. The window helps you manage and resolve code analysis warnings. |
|
Filter warning messages |
On the window, you can filter messages on the Code Analysis window by keyword, project, and severity. |
|
Code editor highlighting |
Selecting a message in the window Code Analysis highlights the line in the source code editor where the message was triggered. |
|
C++ message suppression |
On the Code Analysis window, you can insert a pragma into the source code that suppresses a selected warning. |
|
C++ rule sets |
Like managed code, you can now specify the analysis rules that you want to apply to code analysis runs by creating or using rule sets. |
You can run code analysis on Visual Basic, C#, and C/++ code in Windows Store apps. For more information, see Analyzing the code quality of Windows Store apps with Visual Studio code analysis in the Windows Dev Center.
The new concurrency warnings help you ensure locking disciplines in multithreaded C/C++ programs. The analyzer detects a number of concurrency bugs, including potential race conditions, lock order inversions, caller/callee locking contract violations, and mismatched synchronization operations.
|
Race condition. Variable <var> should be protected by lock <lock>. |
|
|
Failing to use interlocked operation properly for variable <var>. |
|
|
Lock order violation. Acquiring lock <lock> with level <level> causes order inversion. |
|
|
Caller failing to hold lock <lock> before calling function <func>. |
|
|
Caller failing to release lock <lock> before calling function <func>. |
|
|
Caller cannot hold any lock before calling <func>. |
|
|
Failing to release lock <lock> in function <func>. |
|
|
Failing to acquire or to hold lock <lock> in <func>. |
|
|
Releasing unheld lock <lock> in function <func>. |
|
|
Missing annotation _Requires_lock_held_(<lock>) or _No_competing_thread_ at function <func>. Otherwise it could be a race condition. Variable <var> should be protected by lock <lock>. |
|
|
Missing annotation <annotation> at function <func>. |
|
|
Concurrency SAL annotation error |
|
|
Caller possibly failing to hold lock <lock> before calling function <func>. |
|
|
Possibly failing to release lock |
|
|
Possibly failing to acquire or to hold lock <lock> in function <func>. |
|
|
Possibly releasing unheld lock <lock> in function <func>. |
|
|
The Drivers module has inferred that the current function is not the correct type of function |
|
|
Dereferencing NULL pointer |
Code analysis for managed code provides information about managed assemblies, such as violations of the programming and design rules set forth in the Microsoft .NET Framework Design Guidelines. Warning messages identify any relevant programming and design issues and, when it is possible, supply information about how to fix the problem.