MLH-Fellowship / sapp

Post Processor for Facebook Static Analysis Tools.
MIT License
1 stars 0 forks source link

Add a tooltip for the `Code` field in issues to display the description corresponding to an warning code #7

Closed 0xedward closed 3 years ago

0xedward commented 3 years ago

Description:

We want a tooltip to display the description corresponding to the warning code when the user hovers over the warning code of an issue

image

To implement this feature you will likely need to:

  1. Query the warning_messages table to find the corresponding warning code. You can use the get_warning_message_range function in queries.py as a reference on how to write your own query with SQLAlchemy.
  2. Replace the following line in Issue.js with HumanReadable and pass in the description we queried for in step 1
  3. Make sure you handle the case where the warning_messages table is empty or we don't find a description for the warning code

Steps to Reproduce:

  1. Download test-pysa-run.zip
  2. Extract the zip file and run the following command to ingest the Pysa test run results into SAPP
    python3 -m sapp.cli analyze taint-output.json
  3. Ingest Pysa's warning codes into SAPP:
    python3 -m sapp.cli update warning-codes taint-metadata.json
  4. Run the web server
    python3 -m sapp.cli server --debug
  5. Visit http://localhost:3000

Submitting a PR

We use the following linters internally, so to save everyone's time, please make sure you run the following linters locally and fix errors related to the files you modified before submitting a PR:

black && usort format . && flake8

To install the linters, you can run the following command:

pip install flake8 usort black==21.4b2