Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CPPTDESKDEV and version 10.4.2

...

  1. Select Parasoft > Show View> Quality Tasks (if not displayed already).
  2. Open the Quality Tasks menu and select Configure Contents



  3. Select Details from the Configuration list and click OK.



  4. Expand the the Fix Static Analysis Violations folder to review coding standards conventions violations reported for the ATM project.
    Image Removed
    Image Added

    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.

  5. 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
  6. Close the rule description help window.for guidance on how to fix the code. 
  7. 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.
  8. Fix the defect by adding the following line:
    myCurrentAccount = 0;
    to the body of the constructor
    ATM::ATM(Bank* bank, BaseDisplay* display)
    Image Removed explicit keyword to the Account function:

    Image Added

  9. Select File > Save from the main menu or click the save button in the main toolbar to update the code.
  10. Rerun coding standards analysis (see steps 2 and 3 in Exercise 1). The violation CODSTA-CPP-04-1 violation is no longer reported.

...