Objective

Understand how to explore and correct violations identified during coding standard analysis that may result in construction defects.

  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 conventions violations reported for the ATM project.



    The constructor error (CODSTA-CPP-04-1) is a very common defect associated with user-defined conversion functions.

  5. You can right-click the violation and select View Rule Documentation from the shortcut menu for guidance on how to fix the code. 
  6. Double-click the reported violation to view the code in the source editor will open and the cursor will be placed at the line with the reported violation.
  7. Fix the defect by adding the explicit keyword to the Account function:



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