Hi,
We use SonarQube 9.9 LTS in developer edition. SonarQube is deployed with a Docker container.
My problem is that the rule S2107 “Member variables should be initialized” does not detect simple introduced bug in a C++ class.
class MyClass
{
public:
MyClass() : m_myFirstMember(false) {}
bool myMethod() { if(m_mySecondMember) return true; }
private:
bool m_myFirstMember;
bool m_mySecondMember;
}
In this example it detects the code smell “Do not use the constructor’s initializer list for data member m_myFirstMember. Use the in-class initializer instead.” but does not detect the member variable m_mySecondMember which is not initialized and is a very critical issue. Is there any reason ? Something is missing in my configuration ? Rule S2107 seems to be activated in the quality profile “Sonar way”
Thanks for your help