SonarPython 4.21.0.16473
Release notes - SonarPython - 4.21
Bug
SONARPY-2019 Fix NPE for workDir in IPynbSensorTest
SONARPY-2025 PythonScanner parses the wrong file when given a GeneratedFile
SONARPY-2027 IPynbParser should create new lines when parsing multiline strings code cells
SONARPY-2045 Fix incorrect count of escaped chars
SONARPY-2046 Fix missing enrichment of tokens
SONARPY-2049 Remove extra line break when the last line of a source array ends with \n
SONARPY-2051 Single quotes should not count as escaped characters in TokenEnricher or IPynbNotebookParser
SONARPY-2057 Markdown content should not leak in the generated file
SONARPY-2058 Fix offset computation on single line JSON files
SONARPY-2061 Fix bug when no code is present in the notebook
SONARPY-2063 Multiline strings should have a correct end position
SONARPY-2066 IPython help command should be parsed correctly
SONARPY-2067 First line of the first cell of notebooks should end at the correct location
SONARPY-2076 Fix highlighting of single line Jupyter Notebook
False-Positive
SONARPY-2053 Investigate FP on S6999
SONARPY-2056 IPython line magics starting with numbers or special characters should be parsed correctly
New Feature
SONARPY-1983 Implement IPythonNotebook parser
SONARPY-1986 The IPythonSensor should register to .ipynb files
SONARPY-2018 Only analyze notebooks with a Python kernel
Task
SONARPY-1987 IPynbSensor should not crash when an error occurs during the parsing of notebooks
SONARPY-1991 Adapt metrics computation for IPython files
SONARPY-1992 Add Jupyter notebooks to our Ruling tests
SONARPY-1993 Add plugin tests for the analysis of notebooks
SONARPY-1994 Add projects with notebooks to Peach
SONARPY-2002 Implement basic notebook parser with support for array code cells
SONARPY-2003 Implement basic notebook parser with support for multiline string code cells
SONARPY-2004 Track escaped characters correctly in notebook parser
SONARPY-2006 Verify the parsing of notebooks works with the whole json on a single line.
SONARPY-2012 IPynbParser should return a GeneratedIPythonFile
SONARPY-2032 Adapt (executable) lines of code metric for Jupyter Notebooks
SONARPY-2033 Adapt Highlighter for Jupyter Notebooks
SONARPY-2035 Update TokenLocation to make use of the correct location for reporting
SONARPY-2040 Add the sonar.ipynb.file.suffixes property
SONARPY-2041 Implement orchestrator cache
SONARPY-2042 Feed IPythonTreeMaker with GeneratedIPythonFile data
SONARPY-2043 Deactivate CPD for Notebooks
SONARPY-2059 PythonScanner should log the parsing exception on the correct line for notebooks
Improvement
SONARPY-1988 Create an interface to wrap InputFile
SONARPY-1989 Extend Token to hold original and virtual locations
SONARPY-1990 Map JSON locations to python locations in IPythonTreeMaker
SONARPY-2001 Create GeneratedIPythonFile to hold offset data
SONARPY-2036 Enrich EOF tokens
SONARPY-2047 Enrich trivia tokens