...
- Select Parasoft > Show View> Quality Tasks (if not displayed already).
- Open the Quality Tasks menu and select Configure Contents
- Select Details from the Configuration list and click OK.
- Expand the the Fix Static Analysis Violations folder to review coding standards conventions violations reported for the ATM project.
The initionalization constructor error (INITCODSTA-CPP-0604-1) is a very common defect that occurs when developers forget to initialize a member variable in a constructor, which may result in a program crash.
associated with user-defined conversion functions. - You can rightRight-click the violation and select View Rule Documentation from the shortcut menu . The documentation contains the following information for each rule violation:
- A description of the rule
- Notes on the rule
- Benefits of fixing the code
- Example of the violation
- How to repair the code
- Reference
- Close the rule description help window.for guidance on how to fix the code.
- Double-click the reported violation to view the code . The in the source editor will open and the cursor will be placed at the line with the reported violation.
- Fix the defect by adding the following line:
myCurrentAccount = 0;
to the body of the constructorATM::ATM(Bank* bank, BaseDisplay* display)
explicit
keyword to theAccount
function: - Select File > Save from the main menu or click the save button in the main toolbar to update the code.
- Rerun coding standards analysis (see steps 2 and 3 in Exercise 1). The violation CODSTA-CPP-04-1 violation is no longer reported.
...