Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues
Report generation date: 2024-07-27

Project overview: parso

High level conclusions

Reachability and coverage overview

Functions statically reachable by fuzzers
10.0%
46 / 440
Cyclomatic complexity statically reachable by fuzzers
11.0%
170 / 1598
Runtime code coverage of functions
69.0%
305 / 440

Warning: The number of runtime covered functions are larger than the number of reachable functions. This means that Fuzz Introspector found there are more functions covered at runtime than what is considered reachable based on the static analysis. This is a limitation in the analysis as anything covered at runtime is by definition reachable by the fuzzers.
This is likely due to a limitation in the static analysis. In this case, the count of functions covered at runtime is the true value, which means this is what should be considered "achieved" by the fuzzer.

Use the project functions table below to query all functions that were not covered at runtime.

Fuzzer details

Fuzzer: parso_pep8_fuzz

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 0 0.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 26 100.%
All colors 26 100

Runtime coverage analysis

Covered functions
330
Functions that are reachable but not covered
18
Reachable functions
23
Percentage of reachable functions covered
21.74%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...parso_pep8_fuzz 5
parso 3
parso.grammar 8
parso.utils 6

Fuzzer: parso_diff_fuzz

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 103 54.7%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 85 45.2%
All colors 188 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
38 88 parso.python.diff.DiffParser._parse call site: 00088 parso.python.diff._NodesTree._copy_nodes
24 162 parso.python.diff._get_previous_leaf_if_indentation call site: 00162 parso.python.diff._assert_valid_graph
14 50 parso.python.diff.DiffParser._diff_tokenize call site: 00050 parso.python.diff._suite_or_file_input_is_valid
4 134 parso.utils.split_lines call site: 00134 parso.python.diff.DiffParser._parse
4 144 parso.python.diff._get_next_leaf_if_indentation call site: 00144 parso.python.diff._update_positions
3 36 parso.python.diff.DiffParser.update call site: 00036 parso.python.diff.DiffParser._copy_from_old_parser
3 44 parso.python.diff._ends_with_newline call site: 00044 parso.python.diff.DiffParser._parse
3 80 parso.python.diff._NodesTree.add_parsed_nodes call site: 00080 parso.python.diff._NodesTreeNode.add_tree_nodes
3 158 parso.python.diff._NodesTree.close call site: 00158 parso.python.diff._assert_valid_graph
2 40 parso.python.diff._ends_with_newline call site: 00040 leaf.get_previous_leaf
2 154 parso.python.diff._NodesTree.close call site: 00154 .len
1 84 parso.python.diff._NodesTreeNode.add_tree_nodes call site: 00084 parso.python.diff._NodesTree._update_parsed_node_tos

Runtime coverage analysis

Covered functions
331
Functions that are reachable but not covered
74
Reachable functions
108
Percentage of reachable functions covered
31.48%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...parso_diff_fuzz 6
parso 3
parso.grammar 8
parso.utils 13
parso.python.diff 77
parso.python.parser 3

Fuzzer: parso_extended_fuzz

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 4 10.5%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 34 89.4%
All colors 38 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
2 31 ...parso_extended_fuzz.fuzz_errors call site: 00031 ...parso_extended_fuzz.fuzz_errors
1 25 ...parso_extended_fuzz.fuzz_dump call site: 00025 ...parso_extended_fuzz.fuzz_errors
1 36 ...parso_extended_fuzz.TestOneInput call site: 00036 ...parso_extended_fuzz.fuzz_errors

Runtime coverage analysis

Covered functions
331
Functions that are reachable but not covered
20
Reachable functions
26
Percentage of reachable functions covered
23.08%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...parso_extended_fuzz 9
parso 3
parso.grammar 8
parso.utils 6

Fuzzer: parso_fuzz

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 0 0.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 24 100.%
All colors 24 100

Runtime coverage analysis

Covered functions
330
Functions that are reachable but not covered
16
Reachable functions
21
Percentage of reachable functions covered
23.81%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...parso_fuzz 3
parso 3
parso.grammar 8
parso.utils 6

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
parso.pgen2.generator.generate_grammar parso.pgen2.generator 2 ['N/A', 'N/A'] 6 0 3 2 4 120 1 400 336
parso.grammar.Grammar.parse parso.grammar 9 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 4 0 3 14 9 67 0 220 160
parso.python.pep8.PEP8Normalizer.visit_leaf parso.python.pep8 2 ['N/A', 'N/A'] 4 0 5 5 5 33 1 148 121
parso.python.errors._NamedExprRule.is_issue parso.python.errors 2 ['N/A', 'N/A'] 9 0 4 4 5 16 0 81 69
parso.python.parser.Parser.error_recovery parso.python.parser 2 ['N/A', 'N/A'] 6 0 4 8 6 24 3 83 65
parso.python.pep8.PEP8Normalizer._visit_node parso.python.pep8 2 ['N/A', 'N/A'] 2 0 7 27 14 19 8 73 44
parso.python.errors._get_rhs_name parso.python.errors 2 ['N/A', 'N/A'] 2 0 0 33 16 5 2 46 35

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
34.0%
149 / 440
Cyclomatic complexity statically reachable by fuzzers
39.0%
628 / 1598

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
[] []
parso.python.errors [] []
parso.file_io [] []
parso.parser [] []
...parso_extended_fuzz ['parso_extended_fuzz'] []
platform [] []
parso ['parso_pep8_fuzz', 'parso_diff_fuzz', 'parso_extended_fuzz', 'parso_fuzz'] []
hashlib [] []
[] []
parso.python.tree [] []
parso.python.token [] []
parso.python.pep8 [] []
...parso_fuzz ['parso_fuzz'] []
itertools [] []
...parso_pep8_fuzz ['parso_pep8_fuzz'] []
parso.python.parser ['parso_diff_fuzz'] []
parso.utils ['parso_pep8_fuzz', 'parso_diff_fuzz', 'parso_extended_fuzz', 'parso_fuzz'] []
parso.tree [] []
os [] []
logging [] []
gc [] []
collections [] []
parso._compatibility [] []
parso.cache [] []
parso.grammar ['parso_pep8_fuzz', 'parso_diff_fuzz', 'parso_extended_fuzz', 'parso_fuzz'] []
pickle [] []
time [] []
typing [] []
shutil [] []
...parso_diff_fuzz ['parso_diff_fuzz'] []
ast [] []
parso.python.diff ['parso_diff_fuzz'] []
difflib [] []
parso.python.tokenize [] []
parso.python.prefix [] []
re [] []
parso.python [] []
pathlib [] []
parso.pgen2.generator [] []
warnings [] []
codecs [] []
parso.pgen2.grammar_parser [] []
parso.pgen2 [] []
atheris [] []
parso.normalizer [] []

Directories in report

Directory