I'm using this fork to contribute features and fixes to the upstream project. In order to create good pull requests, I'm rebasing my feature branches, squashing and reordering commits, etc. If you fork this repository be aware that my development branches may rewrite history without prior notice.
Analyzing the source code with clang-tidy and clazy gets a large amount of messages:
I would like to fix at least those which are potential errors, but also as much as possible from others. My categories are, in descending order of importance:
FIXME Should definitely be fixed.
TODO Probably no errors, but should be changed.
CHECK Check for possible consequences. What have been the original intentions for that?
NOTE Performance and code improvements.
Here the categorized list of messages together with a short explanation:
[ ] TODO: clazy-detaching-temporary Don't call QList::first() on temporary.
[ ] NOTE: clazy-fully-qualified-moc-types slot arguments need to be fully-qualified. Not relevant
[x] FIXME: clazy-incorrect-emit Emitting inside constructor probably has no effect.
[ ] NOTE: clazy-non-pod-global-static non-POD static. Not a problem for applications (not libraries)
[ ] CHECK clazy-overloaded-signal signal is overloaded. Overloaded signals requires annoying casts during connects, which are not very elegant. This is more an architectural issue and not only a naming issue. Requires redesign. Postponed.
[ ] TODO: clazy-overridden-signal Overriding signal with non-signal.
[ ] NOTE: clazy-qcolor-from-literal The QColor ctor taking ints is cheaper than the one taking string literals.
[ ] NOTE: clazy-qfileinfo-exists Use the static QFileInfo::exists() instead. It's documented to be faster.
[ ] TODO: clazy-qproperty-without-notify Q_PROPERTY should have either NOTIFY or CONSTANT.
[ ] NOTE: clazy-qstring-arg Use multi-arg instead.
Analyzing the source code with
clang-tidy
andclazy
gets a large amount of messages:I would like to fix at least those which are potential errors, but also as much as possible from others. My categories are, in descending order of importance:
Here the categorized list of messages together with a short explanation:
clang-analyzer-core.CallAndMessage
Potentialnullptr
dereference.clang-analyzer-core.uninitialized.Branch
Branch condition evaluates to a garbage value.clang-analyzer-core.uninitialized.UndefReturn
Undefined or garbage value returned to caller.clang-analyzer-cplusplus.NewDelete
Use of memory after it is freed.clang-analyzer-cplusplus.NewDeleteLeaks
Potential leak of memory.clang-analyzer-deadcode.DeadStores
Value stored to 'xxx' during its initialization is never read.clang-analyzer-optin.cplusplus.VirtualCall
Call to virtual method during construction bypasses virtual dispatch.clang-analyzer-security.FloatLoopCounter
Variable with floating point type should not be used as a loop counter.clazy-connect-not-normalized
Signature is not normalized.clazy-const-signal-or-slot
getter possibly mismarked as a slot.NOTE:False positivesclazy-container-anti-pattern
allocating an unneeded temporary container.clazy-detaching-temporary
Don't call QList::first() on temporary.NOTE:Not relevantclazy-fully-qualified-moc-types
slot arguments need to be fully-qualified.clazy-incorrect-emit
Emitting inside constructor probably has no effect.NOTE:Not a problem for applications (not libraries)clazy-non-pod-global-static
non-POD static.CHECKThis is more an architectural issue and not only a naming issue. Requires redesign. Postponed.clazy-overloaded-signal
signal is overloaded. Overloaded signals requires annoying casts during connects, which are not very elegant.clazy-overridden-signal
Overriding signal with non-signal.clazy-qcolor-from-literal
The QColor ctor taking ints is cheaper than the one taking string literals.clazy-qfileinfo-exists
Use the static QFileInfo::exists() instead. It's documented to be faster.clazy-qproperty-without-notify
Q_PROPERTY should have either NOTIFY or CONSTANT.clazy-qstring-arg
Use multi-arg instead.clazy-qstring-insensitive-allocation
unneeded allocation.This is not recommended with Qt 6!!!clazy-qstring-ref
Use rightRef() instead.clazy-range-loop-detach
c++11 range-loop might detach Qt container.clazy-range-loop-reference
Missing reference in range-for with non trivial type.clazy-rule-of-two-soft
Using assign operator but class has copy-ctor but no assign operator.clazy-unused-non-trivial-variable
unused non-trivial variable.clazy-writing-to-temporary
Call to temporary is a no-op: QPoint::setX.