Description

This page provides the solution to a known problem of wrong violation which is flagged for the Quality Rule "Avoid using the  scanf() function family" because the documentation of the Quality Rule is having incorrect remediation.

Below is a screenshot of the issue which shows the violation on the dashboard:

Observed in CAST AIP
Release
Yes/No
8.3.x(tick)
Observed on RDBMS
RDBMS
Yes/No
CSS(tick)
Step by Step Scenario

Below is the step-by-step scenario leading to the problem:

  1. Run analysis + snapshot of the application.
  2. Open the dashboard and login.
  3. Check and observe the violation for "Avoid using the  scanf() function family".
Impact of the Problem

The impact of the problem on the dashboard is: The dashboard will show wrong violation for this Quality Rule on the dashboard and will impact the grade.

Action Plan

To fix the problem, proceed as follows:

  1. Check the source code of the object and see if it is similar to the following :

    fscanf(TempFp,"%20lu",&ReferenceNo);
  2. If it exists, then replace the above code with the following code :

    char buffer[20]; // Or adapt the value as per your requirement
    fgets(buffer, 20, TempFp);
    ReferenceNo = strtoul(buffer, 0, 0);
  3. After applying the solution mentioned above and running the analysis + snapshot again, the violation will not come up for the object on which the solution is applied. Following is the screenshot of the dashboard after the solution:


Impact of the solution on the dashboard

Impact of the solution on the dashboard is: No wrong violations will come up on the dashboard.


Notes/comments
 Ticket # 5133
Related Pages