Example:Security Weaknesses Overview#
This notebook demonstrates how to use the Python Code Audit APIs to generate a visual overview of all detected weaknesses in a file or package.
The identified security weaknesses are displayed using an Altair radial chart.
from codeaudit.api_interfaces import filescan
from codeaudit.altairplots import weaknesses_radial_overview
demo_file = 'demofile.py' #Instead of using a single file, you can also use a directory. The file or directory gets scanned on security weaknesses.
result = filescan(demo_file) #The `get_constructs_counts` API call, scans the file or directory and returns a Python dict.
chart = weaknesses_radial_overview(result)
chart