The checks cover every aspect of developing apps and plugins with JUCE from DSP to GUI. They’re mostly inspired by the JUCE Coding Standards, this forum post from @sudara, and other general best practices.
Some notable checks include:
JUCE Coding Standards checks
- Check for
== nullptrfor pointer andstd::functioncomparisons - Check for explicit
unsigned int, not justunsigned - Check everything has a leak detector that should
- Check order of
public,protected, andprivatein classes - Check for passing small JUCE types by value (
juce::Colour,juce::Point, etc.) - Check for pre-increment
juce-realtime-safety
Check for things like locks, allocations, and system calls in your audio playbacks. Use [[clang::nonblocking]] to allow Clang-Tidy to follow function calls to ensure the entire callstack is realtime safe.
juce::ValueTree checks
- Check for adding listeners to temporaries
- Check for unbound
juce::CachedValues - Check for use of an unchecked child tree which could be invalid
- Check for missing undo managers
- Check for
==comparisons on new/temporary trees (which would always return false)
Accessibility checks
- Check all widgets have titles
- Check custom widgets have custom accessibility handlers
JUCE vs STL checks
Configurable checks to always prefer JUCE equivalents to STL, or vice versa.
std::vectorvsjuce::Arraystd::unordered_mapvsjuce::HashMapstd::setvsjuce::SortedSetstd::spanvsjuce::Spanstd::vector<std::byte>orstd::span<std::byte>overjuce::MemoryBlock- … and many more
Webview checks
- Check for
pageAboutToLoad()not properly implemented - Check for dev servers being used in Release builds
- Check for hardcoded resource provider URLs (which aren’t cross-platform)
- Check for missing MIME types
- Check for incompatible Windows options
Other common mistakes
- Not calling
removeListener()in a listener’s destructor - Not stopping
juce::Threadorjuce::HighResolutionTimerin the destructor - Not resetting a component’s look-and-feel in its destructor
- Calling
repaint()frompaint(), causing infinite repainting - Using a
juce::Timerto callrepaint()instead of ajuce::VBlankAttachment - Capturing
thisin async and callback lambdas - Declaring widget attachments before their widgets in a class so the widget is destroyed before the attachment
- Doing expensive things like loading images in
paint() - Using
#ifdefinstead of#ifwith JUCE macros - … and many many more!
There are over 80 checks in total, with some checks covering multiple different patterns so well over 100 unique warnings JuceTidy can produce.