|Amazon Releases Jupyter Code Analysis Extension|
|Written by Kay Ewbank|
|Monday, 07 August 2023|
Amazon has released a new CodeGuru extension that can be used to identify common problems such as code cell execution order, incorrect API calls, and security.
CodeGuru is a developer tool that uses machine learning to identify potential security vulnerabilities, ways code quality could be improved, and which areas of code are the most expensive in terms of system resources.
Jupyter is an interactive, web-based programming interface that lets users describe the computations they're performing, including diagrams, and embed code into a notebook. The notebook backend will execute the code, integrating the results into the notebook layout. By September 2018, there were more than 2.5 million public Jupyter notebooks on GitHub, and the number continues to rise.
Amazon's new CodeGuru extension for JupyterLab and SageMaker Studio integrates with JupyterLab and SageMaker Studio and provides users with feedback and suggestions for improving their code quality and security.
Until now, Jupyter notebooks have lacked a static analysis tool that could identify and prevent bugs and enforce coding standards. The Amazon CodeGuru team, which has developed a portfolio of code analysis tools for Amazon Web Services customers, adapted an existing tool for notebooks extended with new rules. When the tool was originally tested on 10,000 experimentation notebooks it found approximately one finding per seven notebooks.
The difficulty of using static analysis on notebooks is that code is embedded in computational notebooks in code cells, which can be executed in an arbitrary order and edited on the fly, with cells being added, deleted, or changed after other cells have been executed.
The CodeGuru team developed a hybrid approach that combines dynamic information capture and static analysis. The tool collects dynamic information during the execution of notebooks, then converts notebook files with Python code cells into a novel Python representation that models the execution order as well as the code cells as such. Based on this model, the tool then uses CodeGuru's static-analysis engine for Python and design new static-analysis rules to catch issues in notebooks.
The CodeGuru tool for Jupyter notebooks is available now .
or email your comment to: firstname.lastname@example.org