mirror of
https://github.com/Studio3T/robomongo.git
synced 2025-12-04 16:25:19 -05:00
Page:
Static Code Analysis
Pages
Build Robomongo (0.8.x 0.9.0 RC9)
Feature Spec
Home
How Welcome Tab works
How to export to CSV
How to use SSH port forwarding with Robo 3T
New Release Check List
Notes: Upgrade to MongoDB 4.0
Package Robomongo
Qt Build System
Restore connection strings from versions below 0.9.0 RC2
Robo 3T Schematics: Build, Class and UI Diagrams
Robomongo Code Quality
Robomongo Code Review
Robomongo Coding Style
Robomongo Config File Guide
Robomongo Config File
Robomongo Cplusplus 11, 14 Transition Guide
Robomongo ECMAScript 2015 (aka ES6) Support
Static Code Analysis
Tests
Translator's guide
Unit Tests
Upgrade Guide From MongoDB 3.2 to 3.4 and 3.4 to 4.0
Upgrade Guide to MongoDB 4.2 from 4.0
macOS Upgrade Guide
No results
19
Static Code Analysis
Gökhan Şimşek edited this page 2021-01-06 16:14:40 +03:00
Table of Contents
1. Visual Studio 2019 & clang-tidy
In addition to scripts below, we also use real time clang-tidy code analysis which is visible while coding in visual studio editor - a new feature in Visual Studio 2019. (https://devblogs.microsoft.com/cppblog/code-analysis-with-clang-tidy-in-visual-studio/)
Our list of checks: clang-checks.txt
Note: Currently, cmake does not support enabling this feature. That's why, bin/configure script uses enable-visual-studio-clang-tidy.py to enable this feature automatically.
2. Scripts
To run static code analysis, go to bin directory. And execute one of the following scripts:
(Runs in release mode by default, add debug when needed & supported)
|-- Run Static Code Analysis:
|
| // macOS, Linux
| $ bin/run-clang-tidy
| $ bin/run-scan-build
|
| // Windows
| $ bin/run-cppcheck <FILE_PATH OR DIR> (Default: /src/robomongo/)
| $ bin/run-vs-code-analysis
|__________________________________________________________________
E.g.:
// macOS, Linux
\robo\bin>run-clang-tidy
....
------------------------------------------------
clang-tidy finished
Mode : Release
CLANG_TIDY_BUILD_DIR: /opt/robo/build/clang-tidy-Release
Command executed : /opt/robo/bin/run-clang-tidy.py -checks=bugprone-*,cert-*,clang-analyzer-*,cppcoreguidelines-*,concurrency-*,hicpp-*,llvm-*,misc-*,performance-*,readability-* /opt/robo/src/robomongo/
------------------------------------------------
// Windows
\robo\bin>run-cppcheck.bat
---------------------- Running cppcheck ----------------------
Checking ..\src\robomongo\app\main.cpp ...
Checking ..\src\robomongo\app\main.cpp: Q_OS_MAC...
Checking ..\src\robomongo\app\main.cpp: Q_OS_WIN...
1/125 files checked 0% done
Checking ..\src\robomongo\app\main_mongo.cpp ...
...
---------------------- Info ----------------------
Cppcheck 2.1
Command called: cppcheck ..\src\robomongo\ --enable=all --std=c++17
---------------------- End of cppcheck ----------------------