No classes or missing classes in static analysis



Overview

The vFunction Viper process is responsible for the Static Analysis of the Binaries / Assemblies. In the vFunction Server UI, the Analysis tab will show the results of the Static Analysis. Under the Analysis header in the left-hand sidebar, the count of Total Classess is derived from the Viper process creating a Full Graph of the dependency structure of the Application. Under each Domain in the right-hand sidebar, the Static Classes and Dead Code Classes are derived from the Viper process getting the per-Domain dependencies from the Binaries / Assemblies.

Use the workflows below to troubleshoot an issue where any of these fields have missing values.


Resolution

Take the following steps to confirm that the issue is resolve:

  1. Check the Status of the Viper Process / Service
Sudo Installation
### Replace $INSTANCE_NAME with the actual name, such as default-java-viper
sudo service vf-viper-$INSTANCE_NAME status
Sudoless installation
### Replace $BASE_DIR with the location where vFunction was installed
### Replace $INSTANCE_NAME with the actual name, such as default-java-viper
$BASE_DIR/vfunction/opt/vfunction/viper/instances/default/bin/vf-viper-$INSTANCE_NAME status
  1. Check the Viper Configuration

The Archives Path should be the exact location where the binaries exist. If a change needs to be made, modify the installation.yaml and then run the upgrade.sh script.

Sudo Installation
### Replace $INSTANCE_NAME with the actual value, such as default-java
grep -A5 'archives' /etc/sysconfig/vfunction/installation/instances/$INSTANCE_NAME/installation.yaml
Sudoless installation
### Replace $BASE_DIR with the location where vFunction was installed
### Replace $INSTANCE_NAME with the actual value, such as default-java
grep -A5 'archives' $BASE_DIR/vfunction/etc/sysconfig/vfunction/installation/instances/$INSTANCE_NAME/installation.yaml
  1. Confirm the Classes to Include list is accurate in the vFunction Server UI
  1. Login into the vFunction Server UI
  2. Select the Analysis tab in the top, center Menu Bar
  3. Select Configure Parameters from the left-hand side pane under the Actions Header
  4. Confirm the Classes to Include is accurate in the center column. Note that this field is case sensitive
  1. Confirm that the right version of binaries is included in the File Path of the Viper Archives.

In the vFunction Server UI’s Notifications (the Bell Icon in the top, right corner), a message may be displayed that classes found in the dynamic analysis were not found in the static analysis. This may be an indication that Viper is reading a version of the binaries that does not match the version used for Learning by the Dynamic Agent.

Check the path under viper in /etc/sysconfig/vfunction/installation/instances/{instance-name}/installation.yaml and make sure you have the correct version of binaries that match the version deployed for learning.

If needed, place the correct version of the binaries in the Archives Path (or add more entries to the installation.yaml, and run the upgrade.sh script.

  1. Select the correct Viper in the vFunction Server UI

The vFunction Server supports getting static data from a single Viper at a time per app. If multiple Vipers are configured for the app, make sure that the accurate Viper is selected in the vFunction Server UI’s Learning tab. And, make sure that all Archives (or use wildcars) are listed in the installation.yaml’s Archives field.

  1. Use Debug Mode to get detailed logging
  1. In the installation.yaml, add the subkey and value debug_mode: true under the viper key
  2. Run the run the upgrade.sh script
  3. Login into the vFunction Server UI
  4. Select the Analysis tab in the top, center Menu Bar
  5. Select Configure Parameters from the left-hand side pane under the Actions Header
  6. Increment the Maximum Runtime in the left-hand column. For example, change the value from 15% to 16%
  7. Confirm that the Total Classes has changed to reflect a new value or a new error
  8. Confirm that, with a Domain, the Static Classes has changed to reflect a new value or a new error
  9. Run the collect-logs.sh script in the same folder as the upgrade.sh script
  10. Collect the TGZ of the logs from the /tmp directory for analysis