PyFlow Logo

PyFlow Analysis Report

File: .\testing\demo2_parser.log
Generated on 2025-06-08 15:00:28 | 36 blocks analyzed | 5 functions found

Analysis Overview

36
Total Blocks
5
Functions
67
Total Complexity
1.9
Avg Complexity
14
Variables
20
Call Graph Nodes

Block Type Distribution

import 3 (8.3%)
assign 17 (47.2%)
df_op 4 (11.1%)
func_def 5 (13.9%)
control 3 (8.3%)
func_call 4 (11.1%)

Complexity Analysis

Total Complexity: 67

Average Complexity: 1.86

Max Complexity: 5

Min Complexity: 1

✓ No high complexity blocks detected.

Function Analysis

Function Name Parameters Line Count Complexity Calls Made Variables Used Async
age_category 1
2
5
add_age_category 1
1
0
filter_and_select 1
1
0
aggregate_stats 1
1
0
repartition_and_cache 1
1
0

Block Analysis

Block ID Type Description Lines Complexity Dependencies Variables
12345_IMPORT001_L3 import Import: (unknown, from_import, quality: 100.0) 3-3
1
0 R:0 W:0
12345_IMPORT002_L8 import Import: (unknown, from_import, 2 items, quality: 100.0) 8-8
2
0 R:0 W:0
12345_IMPORT003_L14 import Import: (unknown, from_import, 2 items, quality: 100.0) 14-14
2
0 R:0 W:0
ASSIGN_...L22 assign Assignment: spark = ... (quality: 96.0) 22-22
3
0 R:7 W:1
ASSIGN_...L102 assign Assignment: data1 = ... (quality: 100.0) 102-102
2
0 R:3 W:1
ASSIGN_...L190 assign Assignment: columns = ... (quality: 100.0) 190-190
1
0 R:2 W:1
...L240 df_op Assignment: df1 = ... (quality: 100.0) 240-240
1
3 R:3 W:1
ASSIGN_...L294 assign Assignment: data2 = ... (quality: 100.0) 294-294
2
0 R:2 W:1
...L360 df_op Assignment: df2 = ... (quality: 92.0) 360-360
1
3 R:9 W:1
FUNC_...L429 func_def Function: age_category (complexity: 2, quality: 100.0) 429-430
2
0 R:5 W:0
...L446 control Control flow: if_statement (conditional, complexity: 3, quality: 100.0) 446-448
3
0 R:1 W:0
...L446 control Control flow: if_statement (conditional, complexity: 3, quality: 100.0) 446-448
3
0 R:1 W:0
ASSIGN_...L519 assign Assignment: age_category_udf = ... (quality: 96.0) 519-519
2
0 R:7 W:1
FUNC_...L598 func_def Function: add_age_category (complexity: 1, quality: 100.0) 598-599
1
0 R:0 W:0
FUNC_...L748 func_def Function: filter_and_select (complexity: 1, quality: 100.0) 748-749
1
0 R:0 W:0
FUNC_...L1015 func_def Function: aggregate_stats (complexity: 1, quality: 100.0) 1015-1016
1
0 R:0 W:0
FUNC_...L1267 func_def Function: repartition_and_cache (complexity: 1, quality: 100.0) 1267-1268
1
0 R:0 W:0
...L1311 control Control flow: if_statement (conditional, complexity: 2, quality: 99.0) 1311-1323
2
3 R:43 W:7
ASSIGN_...L1354 assign Assignment: df1_cat = ... (quality: 100.0) 1354-1354
1
1 R:1 W:1
ASSIGN_...L1354 assign Assignment: df1_cat = ... (quality: 100.0) 1354-1354
1
1 R:1 W:1
ASSIGN_...L1399 assign Assignment: df2_cat = ... (quality: 96.0) 1399-1399
1
1 R:7 W:1
ASSIGN_...L1399 assign Assignment: df2_cat = ... (quality: 96.0) 1399-1399
1
1 R:7 W:1
ASSIGN_...L1458 assign Assignment: df_union = ... (quality: 99.2) 1458-1458
4
2 R:3 W:1
ASSIGN_...L1458 assign Assignment: df_union = ... (quality: 99.2) 1458-1458
4
2 R:3 W:1
ASSIGN_...L1600 assign Assignment: df_filtered = ... (quality: 90.0) 1600-1600
1
1 R:10 W:1
ASSIGN_...L1600 assign Assignment: df_filtered = ... (quality: 90.0) 1600-1600
1
1 R:10 W:1
ASSIGN_...L1676 assign Assignment: df_stats = ... (quality: 98.0) 1676-1676
1
1 R:6 W:1
ASSIGN_...L1676 assign Assignment: df_stats = ... (quality: 98.0) 1676-1676
1
1 R:6 W:1
ASSIGN_...L1734 assign Assignment: df_stats_cached = ... (quality: 94.0) 1734-1734
1
1 R:8 W:1
ASSIGN_...L1734 assign Assignment: df_stats_cached = ... (quality: 94.0) 1734-1734
1
1 R:8 W:1
...L1811 df_op Assignment: df_joined = ... (quality: 84.2) 1811-1811
5
2 R:7 W:1
...L1811 df_op Assignment: df_joined = ... (quality: 84.2) 1811-1811
5
2 R:7 W:1
FUNC_...L2021 func_call Expression: show(...) (quality: 90.0) 2021-2021
2
1 R:5 W:0
FUNC_...L2021 func_call Expression: show(...) (quality: 90.0) 2021-2021
2
1 R:5 W:0
FUNC_...L2077 func_call Expression: stop(...) (quality: 90.0) 2077-2077
2
1 R:1 W:0
FUNC_...L2077 func_call Expression: stop(...) (quality: 90.0) 2077-2077
2
1 R:1 W:0

Program Flow Visualization

💡 Shows the sequential flow of program execution and block relationships

Program Flow Graph

100%
cluster_legend Graph Legend 12345_IMPORT001_L3 Import:  (unknown, from_imp... (IMPORT) [12345_IMPORT001_L3] 12345_IMPORT002_L8 Import:  (unknown, from_imp... (IMPORT) C:2 [12345_IMPORT002_L8] 12345_IMPORT003_L14 Import:  (unknown, from_imp... (IMPORT) C:2 [12345_IMPORT003_L14] 12345_ASSIGN001_spark_L22 spark = ... (ASSIGN) C:3 [ASSIGN_...L22] 12345_DF_OP001_df1_L240 df1 = ... (DF_OP) [...L240] 12345_ASSIGN001_spark_L22->12345_DF_OP001_df1_L240 12345_ASSIGN001_spark_L22->12345_DF_OP001_df1_L240 spark 12345_DF_OP002_df2_L360 df2 = ... (DF_OP) [...L360] 12345_ASSIGN001_spark_L22->12345_DF_OP002_df2_L360 12345_ASSIGN001_spark_L22->12345_DF_OP002_df2_L360 spark 12345_CONTROL003_if_statement_L1311 Control flow: if_statement ... (CONTROL) C:2 [...L1311] 12345_ASSIGN001_spark_L22->12345_CONTROL003_if_statement_L1311 12345_ASSIGN001_spark_L22->12345_CONTROL003_if_statement_L1311 spark 12345_FUNC_CALL003_stop_L2077 Expression: stop(...) (FUNC_CALL) C:2 [FUNC_...L2077] 12345_ASSIGN001_spark_L22->12345_FUNC_CALL003_stop_L2077 12345_FUNC_CALL004_stop_L2077 Expression: stop(...) (FUNC_CALL) C:2 [FUNC_...L2077] 12345_ASSIGN001_spark_L22->12345_FUNC_CALL004_stop_L2077 12345_ASSIGN002_data1_L102 data1 = ... (ASSIGN) C:2 [ASSIGN_...L102] 12345_ASSIGN002_data1_L102->12345_DF_OP001_df1_L240 12345_ASSIGN002_data1_L102->12345_DF_OP001_df1_L240 data1 12345_ASSIGN003_columns_L190 columns = ... (ASSIGN) [ASSIGN_...L190] 12345_ASSIGN003_columns_L190->12345_DF_OP001_df1_L240 12345_ASSIGN003_columns_L190->12345_DF_OP001_df1_L240 columns 12345_ASSIGN003_columns_L190->12345_DF_OP002_df2_L360 12345_ASSIGN003_columns_L190->12345_DF_OP002_df2_L360 columns 12345_DF_OP001_df1_L240->12345_CONTROL003_if_statement_L1311 12345_DF_OP001_df1_L240->12345_CONTROL003_if_statement_L1311 df1 12345_ASSIGN006_df1_cat_L1354 df1_cat = ... (ASSIGN) [ASSIGN_...L1354] 12345_DF_OP001_df1_L240->12345_ASSIGN006_df1_cat_L1354 12345_DF_OP001_df1_L240->12345_ASSIGN006_df1_cat_L1354 df1 12345_ASSIGN007_df1_cat_L1354 df1_cat = ... (ASSIGN) [ASSIGN_...L1354] 12345_DF_OP001_df1_L240->12345_ASSIGN007_df1_cat_L1354 12345_DF_OP001_df1_L240->12345_ASSIGN007_df1_cat_L1354 df1 12345_ASSIGN004_data2_L294 data2 = ... (ASSIGN) C:2 [ASSIGN_...L294] 12345_ASSIGN004_data2_L294->12345_DF_OP002_df2_L360 12345_ASSIGN004_data2_L294->12345_DF_OP002_df2_L360 data2 12345_DF_OP002_df2_L360->12345_CONTROL003_if_statement_L1311 12345_DF_OP002_df2_L360->12345_CONTROL003_if_statement_L1311 df2 12345_ASSIGN008_df2_cat_L1399 df2_cat = ... (ASSIGN) [ASSIGN_...L1399] 12345_DF_OP002_df2_L360->12345_ASSIGN008_df2_cat_L1399 12345_DF_OP002_df2_L360->12345_ASSIGN008_df2_cat_L1399 df2 12345_ASSIGN009_df2_cat_L1399 df2_cat = ... (ASSIGN) [ASSIGN_...L1399] 12345_DF_OP002_df2_L360->12345_ASSIGN009_df2_cat_L1399 12345_DF_OP002_df2_L360->12345_ASSIGN009_df2_cat_L1399 df2 12345_FUNC_DEF001_age_category_L429 def age_category(...): (FUNC_DEF) C:2 [FUNC_...L429] 12345_CONTROL001_if_statement_L446 Control flow: if_statement ... (CONTROL) C:3 [...L446] 12345_CONTROL002_if_statement_L446 Control flow: if_statement ... (CONTROL) C:3 [...L446] 12345_ASSIGN005_age_category_udf_L519 age_category_udf = ... (ASSIGN) C:2 [ASSIGN_...L519] 12345_FUNC_DEF002_add_age_category_L598 def add_age_category(...): (FUNC_DEF) [FUNC_...L598] 12345_FUNC_DEF002_add_age_category_L598->12345_CONTROL003_if_statement_L1311 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN006_df1_cat_L1354 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN007_df1_cat_L1354 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN008_df2_cat_L1399 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN009_df2_cat_L1399 add_age_category() 12345_FUNC_DEF003_filter_and_select_L748 def filter_and_select(...): (FUNC_DEF) [FUNC_...L748] 12345_FUNC_DEF003_filter_and_select_L748->12345_CONTROL003_if_statement_L1311 filter_and_select() 12345_ASSIGN012_df_filtered_L1600 df_filtered = ... (ASSIGN) [ASSIGN_...L1600] 12345_FUNC_DEF003_filter_and_select_L748->12345_ASSIGN012_df_filtered_L1600 filter_and_select() 12345_ASSIGN013_df_filtered_L1600 df_filtered = ... (ASSIGN) [ASSIGN_...L1600] 12345_FUNC_DEF003_filter_and_select_L748->12345_ASSIGN013_df_filtered_L1600 filter_and_select() 12345_FUNC_DEF004_aggregate_stats_L1015 def aggregate_stats(...): (FUNC_DEF) [FUNC_...L1015] 12345_FUNC_DEF004_aggregate_stats_L1015->12345_CONTROL003_if_statement_L1311 aggregate_stats() 12345_ASSIGN014_df_stats_L1676 df_stats = ... (ASSIGN) [ASSIGN_...L1676] 12345_FUNC_DEF004_aggregate_stats_L1015->12345_ASSIGN014_df_stats_L1676 aggregate_stats() 12345_ASSIGN015_df_stats_L1676 df_stats = ... (ASSIGN) [ASSIGN_...L1676] 12345_FUNC_DEF004_aggregate_stats_L1015->12345_ASSIGN015_df_stats_L1676 aggregate_stats() 12345_FUNC_DEF005_repartition_and_cache_L1267 def repartition_and_cache(...): (FUNC_DEF) [FUNC_...L1267] 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_CONTROL003_if_statement_L1311 repartition_and_cache() 12345_ASSIGN016_df_stats_cached_L1734 df_stats_cached = ... (ASSIGN) [ASSIGN_...L1734] 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_ASSIGN016_df_stats_cached_L1734 repartition_and_cache() 12345_ASSIGN017_df_stats_cached_L1734 df_stats_cached = ... (ASSIGN) [ASSIGN_...L1734] 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_ASSIGN017_df_stats_cached_L1734 repartition_and_cache() 12345_ASSIGN010_df_union_L1458 df_union = ... (ASSIGN) C:4 [ASSIGN_...L1458] 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN010_df_union_L1458 df1_cat 12345_ASSIGN011_df_union_L1458 df_union = ... (ASSIGN) C:4 [ASSIGN_...L1458] 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN011_df_union_L1458 df1_cat 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN014_df_stats_L1676 df1_cat 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN010_df_union_L1458 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN011_df_union_L1458 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN014_df_stats_L1676 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN015_df_stats_L1676 12345_ASSIGN008_df2_cat_L1399->12345_ASSIGN010_df_union_L1458 df2_cat 12345_ASSIGN008_df2_cat_L1399->12345_ASSIGN011_df_union_L1458 df2_cat 12345_ASSIGN009_df2_cat_L1399->12345_ASSIGN010_df_union_L1458 12345_ASSIGN009_df2_cat_L1399->12345_ASSIGN011_df_union_L1458 12345_ASSIGN010_df_union_L1458->12345_ASSIGN012_df_filtered_L1600 df_union 12345_ASSIGN010_df_union_L1458->12345_ASSIGN013_df_filtered_L1600 df_union 12345_ASSIGN011_df_union_L1458->12345_ASSIGN012_df_filtered_L1600 12345_ASSIGN011_df_union_L1458->12345_ASSIGN013_df_filtered_L1600 12345_DF_OP003_df_joined_L1811 df_joined = ... (DF_OP) C:5 [...L1811] 12345_ASSIGN012_df_filtered_L1600->12345_DF_OP003_df_joined_L1811 df_filtered 12345_DF_OP004_df_joined_L1811 df_joined = ... (DF_OP) C:5 [...L1811] 12345_ASSIGN012_df_filtered_L1600->12345_DF_OP004_df_joined_L1811 df_filtered 12345_ASSIGN013_df_filtered_L1600->12345_DF_OP003_df_joined_L1811 12345_ASSIGN013_df_filtered_L1600->12345_DF_OP004_df_joined_L1811 12345_ASSIGN014_df_stats_L1676->12345_ASSIGN016_df_stats_cached_L1734 df_stats 12345_ASSIGN014_df_stats_L1676->12345_ASSIGN017_df_stats_cached_L1734 df_stats 12345_ASSIGN015_df_stats_L1676->12345_ASSIGN016_df_stats_cached_L1734 12345_ASSIGN015_df_stats_L1676->12345_ASSIGN017_df_stats_cached_L1734 12345_ASSIGN016_df_stats_cached_L1734->12345_DF_OP003_df_joined_L1811 df_stats_cached 12345_ASSIGN016_df_stats_cached_L1734->12345_DF_OP004_df_joined_L1811 df_stats_cached 12345_ASSIGN017_df_stats_cached_L1734->12345_DF_OP003_df_joined_L1811 12345_ASSIGN017_df_stats_cached_L1734->12345_DF_OP004_df_joined_L1811 12345_FUNC_CALL001_show_L2021 Expression: show(...) (FUNC_CALL) C:2 [FUNC_...L2021] 12345_DF_OP003_df_joined_L1811->12345_FUNC_CALL001_show_L2021 df_joined 12345_FUNC_CALL002_show_L2021 Expression: show(...) (FUNC_CALL) C:2 [FUNC_...L2021] 12345_DF_OP003_df_joined_L1811->12345_FUNC_CALL002_show_L2021 df_joined 12345_DF_OP004_df_joined_L1811->12345_FUNC_CALL001_show_L2021 12345_DF_OP004_df_joined_L1811->12345_FUNC_CALL002_show_L2021 legend_title Edge Types: legend_dep Dependencies (Green, Solid) legend_func Function Calls (Purple, Bold) legend_var Variable Flow (Red, Dotted) legend_control Control Flow (Gray, Bold)
💡 Interactive Controls: Shows the sequential flow of program execution • Mouse wheel + Ctrl to zoom • Drag to pan • R to reset • F to fit • + - for zoom

Function Call Relationships

🔗 Visualizes function relationships and call patterns throughout your code

Function Call Graph

100%
cluster_legend Graph Legend 12345_ASSIGN009_df2_cat_L1399 df2_cat = ... (ASSIGN) R:7 W:1 [ASSIGN_...L1399] 12345_ASSIGN001_spark_L22 spark = ... (ASSIGN) C:3 R:7 W:1 [ASSIGN_...L22] 12345_CONTROL003_if_statement_L1311 Control flow: if_statement ... (CONTROL) C:2 R:43 W:7 [...L1311] 12345_ASSIGN001_spark_L22->12345_CONTROL003_if_statement_L1311 spark 12345_DF_OP001_df1_L240 df1 = ... (DF_OP) R:3 W:1 [...L240] 12345_ASSIGN001_spark_L22->12345_DF_OP001_df1_L240 spark 12345_DF_OP002_df2_L360 df2 = ... (DF_OP) R:9 W:1 [...L360] 12345_ASSIGN001_spark_L22->12345_DF_OP002_df2_L360 spark 12345_ASSIGN016_df_stats_cached_L1734 df_stats_cached = ... (ASSIGN) R:8 W:1 [ASSIGN_...L1734] 12345_DF_OP003_df_joined_L1811 df_joined = ... (DF_OP) C:5 R:7 W:1 [...L1811] 12345_ASSIGN016_df_stats_cached_L1734->12345_DF_OP003_df_joined_L1811 df_stats_cached 12345_DF_OP004_df_joined_L1811 df_joined = ... (DF_OP) C:5 R:7 W:1 [...L1811] 12345_ASSIGN016_df_stats_cached_L1734->12345_DF_OP004_df_joined_L1811 df_stats_cached 12345_ASSIGN014_df_stats_L1676 df_stats = ... (ASSIGN) R:6 W:1 [ASSIGN_...L1676] 12345_ASSIGN014_df_stats_L1676->12345_ASSIGN016_df_stats_cached_L1734 df_stats 12345_ASSIGN017_df_stats_cached_L1734 df_stats_cached = ... (ASSIGN) R:8 W:1 [ASSIGN_...L1734] 12345_ASSIGN014_df_stats_L1676->12345_ASSIGN017_df_stats_cached_L1734 df_stats 12345_FUNC_CALL003_stop_L2077 Expression: stop(...) (FUNC_CALL) C:2 R:1 [FUNC_...L2077] 12345_FUNC_CALL001_show_L2021 Expression: show(...) (FUNC_CALL) C:2 R:5 [FUNC_...L2021] 12345_ASSIGN002_data1_L102 data1 = ... (ASSIGN) C:2 R:3 W:1 [ASSIGN_...L102] 12345_ASSIGN002_data1_L102->12345_DF_OP001_df1_L240 data1 12345_FUNC_DEF005_repartition_and_cache_L1267 def repartition_and_cache(...): (FUNC_DEF) [FUNC_...L1267] 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_ASSIGN016_df_stats_cached_L1734 repartition_and_cache() 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_CONTROL003_if_statement_L1311 repartition_and_cache() 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_ASSIGN017_df_stats_cached_L1734 repartition_and_cache() 12345_FUNC_DEF002_add_age_category_L598 def add_age_category(...): (FUNC_DEF) [FUNC_...L598] 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN009_df2_cat_L1399 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_CONTROL003_if_statement_L1311 add_age_category() 12345_ASSIGN006_df1_cat_L1354 df1_cat = ... (ASSIGN) R:1 W:1 [ASSIGN_...L1354] 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN006_df1_cat_L1354 add_age_category() 12345_ASSIGN007_df1_cat_L1354 df1_cat = ... (ASSIGN) R:1 W:1 [ASSIGN_...L1354] 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN007_df1_cat_L1354 add_age_category() 12345_ASSIGN008_df2_cat_L1399 df2_cat = ... (ASSIGN) R:7 W:1 [ASSIGN_...L1399] 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN008_df2_cat_L1399 add_age_category() 12345_DF_OP001_df1_L240->12345_CONTROL003_if_statement_L1311 df1 12345_DF_OP001_df1_L240->12345_ASSIGN006_df1_cat_L1354 df1 12345_DF_OP001_df1_L240->12345_ASSIGN007_df1_cat_L1354 df1 12345_FUNC_DEF001_age_category_L429 def age_category(...): (FUNC_DEF) C:2 R:5 [FUNC_...L429] 12345_ASSIGN004_data2_L294 data2 = ... (ASSIGN) C:2 R:2 W:1 [ASSIGN_...L294] 12345_ASSIGN004_data2_L294->12345_DF_OP002_df2_L360 data2 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN014_df_stats_L1676 df1_cat 12345_ASSIGN011_df_union_L1458 df_union = ... (ASSIGN) C:4 R:3 W:1 [ASSIGN_...L1458] 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN011_df_union_L1458 df1_cat 12345_ASSIGN010_df_union_L1458 df_union = ... (ASSIGN) C:4 R:3 W:1 [ASSIGN_...L1458] 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN010_df_union_L1458 df1_cat 12345_ASSIGN012_df_filtered_L1600 df_filtered = ... (ASSIGN) R:10 W:1 [ASSIGN_...L1600] 12345_ASSIGN012_df_filtered_L1600->12345_DF_OP003_df_joined_L1811 df_filtered 12345_ASSIGN012_df_filtered_L1600->12345_DF_OP004_df_joined_L1811 df_filtered 12345_FUNC_CALL002_show_L2021 Expression: show(...) (FUNC_CALL) C:2 R:5 [FUNC_...L2021] 12345_ASSIGN003_columns_L190 columns = ... (ASSIGN) R:2 W:1 [ASSIGN_...L190] 12345_ASSIGN003_columns_L190->12345_DF_OP001_df1_L240 columns 12345_ASSIGN003_columns_L190->12345_DF_OP002_df2_L360 columns 12345_ASSIGN008_df2_cat_L1399->12345_ASSIGN011_df_union_L1458 df2_cat 12345_ASSIGN008_df2_cat_L1399->12345_ASSIGN010_df_union_L1458 df2_cat 12345_DF_OP003_df_joined_L1811->12345_FUNC_CALL001_show_L2021 df_joined 12345_DF_OP003_df_joined_L1811->12345_FUNC_CALL002_show_L2021 df_joined 12345_FUNC_DEF003_filter_and_select_L748 def filter_and_select(...): (FUNC_DEF) [FUNC_...L748] 12345_FUNC_DEF003_filter_and_select_L748->12345_CONTROL003_if_statement_L1311 filter_and_select() 12345_FUNC_DEF003_filter_and_select_L748->12345_ASSIGN012_df_filtered_L1600 filter_and_select() 12345_ASSIGN013_df_filtered_L1600 df_filtered = ... (ASSIGN) R:10 W:1 [ASSIGN_...L1600] 12345_FUNC_DEF003_filter_and_select_L748->12345_ASSIGN013_df_filtered_L1600 filter_and_select() 12345_DF_OP002_df2_L360->12345_ASSIGN009_df2_cat_L1399 df2 12345_DF_OP002_df2_L360->12345_CONTROL003_if_statement_L1311 df2 12345_DF_OP002_df2_L360->12345_ASSIGN008_df2_cat_L1399 df2 12345_ASSIGN015_df_stats_L1676 df_stats = ... (ASSIGN) R:6 W:1 [ASSIGN_...L1676] 12345_FUNC_DEF004_aggregate_stats_L1015 def aggregate_stats(...): (FUNC_DEF) [FUNC_...L1015] 12345_FUNC_DEF004_aggregate_stats_L1015->12345_ASSIGN014_df_stats_L1676 aggregate_stats() 12345_FUNC_DEF004_aggregate_stats_L1015->12345_CONTROL003_if_statement_L1311 aggregate_stats() 12345_FUNC_DEF004_aggregate_stats_L1015->12345_ASSIGN015_df_stats_L1676 aggregate_stats() 12345_ASSIGN010_df_union_L1458->12345_ASSIGN012_df_filtered_L1600 df_union 12345_ASSIGN010_df_union_L1458->12345_ASSIGN013_df_filtered_L1600 df_union 12345_FUNC_CALL004_stop_L2077 Expression: stop(...) (FUNC_CALL) C:2 R:1 [FUNC_...L2077] legend_nodes_title Node Types: legend_func_def Function Definition (Green, Component) legend_func_call Function Call (Yellow, Ellipse) legend_assign Assignment (Blue, Box) legend_edges_title Edge Types: legend_func_edge Function Call (Purple, Bold) legend_var_edge Variable Flow (Red, Dotted)
💡 Interactive Controls: Visualizes function relationships and call patterns • Mouse wheel + Ctrl to zoom • Drag to pan • R to reset • F to fit • + - for zoom

Block Dependencies

🔀 Displays how code blocks depend on each other and data flow

Block Dependencies Graph

100%
cluster_legend Graph Legend 12345_IMPORT001_L3 Import:  (unknown, from_imp... (ROOT) [12345_IMPORT001_L3] 12345_IMPORT002_L8 Import:  (unknown, from_imp... (ROOT) [12345_IMPORT002_L8] 12345_IMPORT003_L14 Import:  (unknown, from_imp... (ROOT) [12345_IMPORT003_L14] 12345_ASSIGN001_spark_L22 spark = ... (ROOT) R:7 W:1 [ASSIGN_...L22] 12345_DF_OP001_df1_L240 df1 = ... (TRANSFORM) Deps: 3 R:3 W:1 [...L240] 12345_ASSIGN001_spark_L22->12345_DF_OP001_df1_L240 12345_ASSIGN001_spark_L22->12345_DF_OP001_df1_L240 spark 12345_DF_OP002_df2_L360 df2 = ... (TRANSFORM) Deps: 3 R:9 W:1 [...L360] 12345_ASSIGN001_spark_L22->12345_DF_OP002_df2_L360 12345_ASSIGN001_spark_L22->12345_DF_OP002_df2_L360 spark 12345_CONTROL003_if_statement_L1311 Control flow: if_statement ... (TRANSFORM) Deps: 3 R:43 W:7 [...L1311] 12345_ASSIGN001_spark_L22->12345_CONTROL003_if_statement_L1311 12345_ASSIGN001_spark_L22->12345_CONTROL003_if_statement_L1311 spark 12345_FUNC_CALL003_stop_L2077 Expression: stop(...) (CONSUMER) Deps: 1 R:1 [FUNC_...L2077] 12345_ASSIGN001_spark_L22->12345_FUNC_CALL003_stop_L2077 12345_FUNC_CALL004_stop_L2077 Expression: stop(...) (CONSUMER) Deps: 1 R:1 [FUNC_...L2077] 12345_ASSIGN001_spark_L22->12345_FUNC_CALL004_stop_L2077 12345_ASSIGN002_data1_L102 data1 = ... (ROOT) R:3 W:1 [ASSIGN_...L102] 12345_ASSIGN002_data1_L102->12345_DF_OP001_df1_L240 12345_ASSIGN002_data1_L102->12345_DF_OP001_df1_L240 data1 12345_ASSIGN003_columns_L190 columns = ... (ROOT) R:2 W:1 [ASSIGN_...L190] 12345_ASSIGN003_columns_L190->12345_DF_OP001_df1_L240 12345_ASSIGN003_columns_L190->12345_DF_OP001_df1_L240 columns 12345_ASSIGN003_columns_L190->12345_DF_OP002_df2_L360 12345_ASSIGN003_columns_L190->12345_DF_OP002_df2_L360 columns 12345_DF_OP001_df1_L240->12345_CONTROL003_if_statement_L1311 12345_DF_OP001_df1_L240->12345_CONTROL003_if_statement_L1311 df1 12345_ASSIGN006_df1_cat_L1354 df1_cat = ... (TRANSFORM) Deps: 1 R:1 W:1 [ASSIGN_...L1354] 12345_DF_OP001_df1_L240->12345_ASSIGN006_df1_cat_L1354 12345_DF_OP001_df1_L240->12345_ASSIGN006_df1_cat_L1354 df1 12345_ASSIGN007_df1_cat_L1354 df1_cat = ... (TRANSFORM) Deps: 1 R:1 W:1 [ASSIGN_...L1354] 12345_DF_OP001_df1_L240->12345_ASSIGN007_df1_cat_L1354 12345_DF_OP001_df1_L240->12345_ASSIGN007_df1_cat_L1354 df1 12345_ASSIGN004_data2_L294 data2 = ... (ROOT) R:2 W:1 [ASSIGN_...L294] 12345_ASSIGN004_data2_L294->12345_DF_OP002_df2_L360 12345_ASSIGN004_data2_L294->12345_DF_OP002_df2_L360 data2 12345_DF_OP002_df2_L360->12345_CONTROL003_if_statement_L1311 12345_DF_OP002_df2_L360->12345_CONTROL003_if_statement_L1311 df2 12345_ASSIGN008_df2_cat_L1399 df2_cat = ... (TRANSFORM) Deps: 1 R:7 W:1 [ASSIGN_...L1399] 12345_DF_OP002_df2_L360->12345_ASSIGN008_df2_cat_L1399 12345_DF_OP002_df2_L360->12345_ASSIGN008_df2_cat_L1399 df2 12345_ASSIGN009_df2_cat_L1399 df2_cat = ... (TRANSFORM) Deps: 1 R:7 W:1 [ASSIGN_...L1399] 12345_DF_OP002_df2_L360->12345_ASSIGN009_df2_cat_L1399 12345_DF_OP002_df2_L360->12345_ASSIGN009_df2_cat_L1399 df2 12345_FUNC_DEF001_age_category_L429 def age_category(...): (ROOT) R:5 [FUNC_...L429] 12345_CONTROL001_if_statement_L446 Control flow: if_statement ... (ROOT) R:1 [...L446] 12345_CONTROL002_if_statement_L446 Control flow: if_statement ... (ROOT) R:1 [...L446] 12345_ASSIGN005_age_category_udf_L519 age_category_udf = ... (ROOT) R:7 W:1 [ASSIGN_...L519] 12345_FUNC_DEF002_add_age_category_L598 def add_age_category(...): (ROOT) [FUNC_...L598] 12345_FUNC_DEF002_add_age_category_L598->12345_CONTROL003_if_statement_L1311 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN006_df1_cat_L1354 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN007_df1_cat_L1354 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN008_df2_cat_L1399 add_age_category() 12345_FUNC_DEF002_add_age_category_L598->12345_ASSIGN009_df2_cat_L1399 add_age_category() 12345_FUNC_DEF003_filter_and_select_L748 def filter_and_select(...): (ROOT) [FUNC_...L748] 12345_FUNC_DEF003_filter_and_select_L748->12345_CONTROL003_if_statement_L1311 filter_and_select() 12345_ASSIGN012_df_filtered_L1600 df_filtered = ... (TRANSFORM) Deps: 1 R:10 W:1 [ASSIGN_...L1600] 12345_FUNC_DEF003_filter_and_select_L748->12345_ASSIGN012_df_filtered_L1600 filter_and_select() 12345_ASSIGN013_df_filtered_L1600 df_filtered = ... (TRANSFORM) Deps: 1 R:10 W:1 [ASSIGN_...L1600] 12345_FUNC_DEF003_filter_and_select_L748->12345_ASSIGN013_df_filtered_L1600 filter_and_select() 12345_FUNC_DEF004_aggregate_stats_L1015 def aggregate_stats(...): (ROOT) [FUNC_...L1015] 12345_FUNC_DEF004_aggregate_stats_L1015->12345_CONTROL003_if_statement_L1311 aggregate_stats() 12345_ASSIGN014_df_stats_L1676 df_stats = ... (TRANSFORM) Deps: 1 R:6 W:1 [ASSIGN_...L1676] 12345_FUNC_DEF004_aggregate_stats_L1015->12345_ASSIGN014_df_stats_L1676 aggregate_stats() 12345_ASSIGN015_df_stats_L1676 df_stats = ... (TRANSFORM) Deps: 1 R:6 W:1 [ASSIGN_...L1676] 12345_FUNC_DEF004_aggregate_stats_L1015->12345_ASSIGN015_df_stats_L1676 aggregate_stats() 12345_FUNC_DEF005_repartition_and_cache_L1267 def repartition_and_cache(...): (ROOT) [FUNC_...L1267] 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_CONTROL003_if_statement_L1311 repartition_and_cache() 12345_ASSIGN016_df_stats_cached_L1734 df_stats_cached = ... (TRANSFORM) Deps: 1 R:8 W:1 [ASSIGN_...L1734] 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_ASSIGN016_df_stats_cached_L1734 repartition_and_cache() 12345_ASSIGN017_df_stats_cached_L1734 df_stats_cached = ... (TRANSFORM) Deps: 1 R:8 W:1 [ASSIGN_...L1734] 12345_FUNC_DEF005_repartition_and_cache_L1267->12345_ASSIGN017_df_stats_cached_L1734 repartition_and_cache() 12345_ASSIGN010_df_union_L1458 df_union = ... (TRANSFORM) Deps: 2 R:3 W:1 [ASSIGN_...L1458] 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN010_df_union_L1458 df1_cat 12345_ASSIGN011_df_union_L1458 df_union = ... (TRANSFORM) Deps: 2 R:3 W:1 [ASSIGN_...L1458] 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN011_df_union_L1458 df1_cat 12345_ASSIGN006_df1_cat_L1354->12345_ASSIGN014_df_stats_L1676 df1_cat 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN010_df_union_L1458 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN011_df_union_L1458 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN014_df_stats_L1676 12345_ASSIGN007_df1_cat_L1354->12345_ASSIGN015_df_stats_L1676 12345_ASSIGN008_df2_cat_L1399->12345_ASSIGN010_df_union_L1458 df2_cat 12345_ASSIGN008_df2_cat_L1399->12345_ASSIGN011_df_union_L1458 df2_cat 12345_ASSIGN009_df2_cat_L1399->12345_ASSIGN010_df_union_L1458 12345_ASSIGN009_df2_cat_L1399->12345_ASSIGN011_df_union_L1458 12345_ASSIGN010_df_union_L1458->12345_ASSIGN012_df_filtered_L1600 df_union 12345_ASSIGN010_df_union_L1458->12345_ASSIGN013_df_filtered_L1600 df_union 12345_ASSIGN011_df_union_L1458->12345_ASSIGN012_df_filtered_L1600 12345_ASSIGN011_df_union_L1458->12345_ASSIGN013_df_filtered_L1600 12345_DF_OP003_df_joined_L1811 df_joined = ... (TRANSFORM) Deps: 2 R:7 W:1 [...L1811] 12345_ASSIGN012_df_filtered_L1600->12345_DF_OP003_df_joined_L1811 df_filtered 12345_DF_OP004_df_joined_L1811 df_joined = ... (TRANSFORM) Deps: 2 R:7 W:1 [...L1811] 12345_ASSIGN012_df_filtered_L1600->12345_DF_OP004_df_joined_L1811 df_filtered 12345_ASSIGN013_df_filtered_L1600->12345_DF_OP003_df_joined_L1811 12345_ASSIGN013_df_filtered_L1600->12345_DF_OP004_df_joined_L1811 12345_ASSIGN014_df_stats_L1676->12345_ASSIGN016_df_stats_cached_L1734 df_stats 12345_ASSIGN014_df_stats_L1676->12345_ASSIGN017_df_stats_cached_L1734 df_stats 12345_ASSIGN015_df_stats_L1676->12345_ASSIGN016_df_stats_cached_L1734 12345_ASSIGN015_df_stats_L1676->12345_ASSIGN017_df_stats_cached_L1734 12345_ASSIGN016_df_stats_cached_L1734->12345_DF_OP003_df_joined_L1811 df_stats_cached 12345_ASSIGN016_df_stats_cached_L1734->12345_DF_OP004_df_joined_L1811 df_stats_cached 12345_ASSIGN017_df_stats_cached_L1734->12345_DF_OP003_df_joined_L1811 12345_ASSIGN017_df_stats_cached_L1734->12345_DF_OP004_df_joined_L1811 12345_FUNC_CALL001_show_L2021 Expression: show(...) (CONSUMER) Deps: 1 R:5 [FUNC_...L2021] 12345_DF_OP003_df_joined_L1811->12345_FUNC_CALL001_show_L2021 df_joined 12345_FUNC_CALL002_show_L2021 Expression: show(...) (CONSUMER) Deps: 1 R:5 [FUNC_...L2021] 12345_DF_OP003_df_joined_L1811->12345_FUNC_CALL002_show_L2021 df_joined 12345_DF_OP004_df_joined_L1811->12345_FUNC_CALL001_show_L2021 12345_DF_OP004_df_joined_L1811->12345_FUNC_CALL002_show_L2021 legend_nodes Node Types: legend_root ROOT (No deps) legend_producer PRODUCER (Writes) legend_consumer CONSUMER (Reads) legend_transform TRANSFORM (R+W) legend_edges Edge Types: legend_deps Dependencies (Green) legend_funcs Function Calls (Purple, Bold) legend_vars Variable Flow (Red, Dotted) legend_data Data Flow (Blue, Bold)
💡 Interactive Controls: Displays how blocks depend on each other • Mouse wheel + Ctrl to zoom • Drag to pan • R to reset • F to fit • + - for zoom

Interactive Enhanced Code

💡 Click on any graph node to highlight and popup the corresponding code block below
12345_IMPORT001_L3 Import: (unknown, from_import, quality: 100.0)
from pyspark.sql import SparkSession
12345_IMPORT002_L8 Import: (unknown, from_import, 2 items, quality: 100.0)
from pyspark.sql.functions import col,

lit, when, udf
12345_IMPORT003_L14 Import: (unknown, from_import, 2 items, quality: 100.0)
from pyspark.sql.types import IntegerType, StringType
ASSIGN_...L22 Assignment: spark = ... (quality: 96.0)
spark = SparkSession.builder().appName("LineageTest").getOrCreate()
ASSIGN_...L102 Assignment: data1 = ... (quality: 100.0)
data1 = [("Alice", 34), ("Bob", 45), ("Charlie", 23)]
ASSIGN_...L190 Assignment: columns = ... (quality: 100.0)
columns = ["name", "age"]
...L240 Assignment: df1 = ... (quality: 100.0)
df1 = spark.createDataFrame(data1, columns)
ASSIGN_...L294 Assignment: data2 = ... (quality: 100.0)
data2 = [("Dave", 29), ("Eve", 52)]
...L360 Assignment: df2 = ... (quality: 92.0)
df2 = spark.createDataFrame(data2, columns)
FUNC_...L429 Function: age_category (complexity: 2, quality: 100.0)
def age_category(age):
...L446 Control flow: if_statement (conditional, complexity: 3, quality: 100.0)
if age < 30:
        return "Young"
    else:
        return "Old"
ASSIGN_...L519 Assignment: age_category_udf = ... (quality: 96.0)
age_category_udf = udf(age_category, StringType())
FUNC_...L598 Function: add_age_category (complexity: 1, quality: 100.0)
def add_age_category(input_df):
    return (
            input_df
            .withColumn("age_category", age_category_udf(col("age")))
        )
FUNC_...L748 Function: filter_and_select (complexity: 1, quality: 100.0)
def filter_and_select(input_df, min_age):
    return (
            input_df
            .filter(col("age") > min_age)
            .select(
                col("name"),
                col("age_category"),
                (col("age") * lit(2)).alias("double_age")
            )
        )
FUNC_...L1015 Function: aggregate_stats (complexity: 1, quality: 100.0)
def aggregate_stats(input_df):
    return (
            input_df
            .groupBy("age_category")
            .agg(
                {"age": "avg", "*": "count"}
            )
            .withColumnRenamed("avg(age)", "avg_age")
            .withColumnRenamed("count(1)", "count")
        )
FUNC_...L1267 Function: repartition_and_cache (complexity: 1, quality: 100.0)
def repartition_and_cache(input_df, num_partitions):
    return input_df.repartition(num_partitions).cache()
...L1311 Control flow: if_statement (conditional, complexity: 2, quality: 99.0)
if __name__ == "__main__":
ASSIGN_...L1354 Assignment: df1_cat = ... (quality: 100.0)
df1_cat = add_age_category(df1)
ASSIGN_...L1399 Assignment: df2_cat = ... (quality: 96.0)
df2_cat = add_age_category(df2)
ASSIGN_...L1458 Assignment: df_union = ... (quality: 99.2)
df_union = (
            df1_cat.union(df2_cat)
            .dropDuplicates(["name"])
            .orderBy("name")
        )
ASSIGN_...L1600 Assignment: df_filtered = ... (quality: 90.0)
df_filtered = filter_and_select(df_union, min_age=30)
ASSIGN_...L1676 Assignment: df_stats = ... (quality: 98.0)
df_stats = aggregate_stats(df1_cat)
ASSIGN_...L1734 Assignment: df_stats_cached = ... (quality: 94.0)
df_stats_cached = repartition_and_cache(df_stats, num_partitions=2)
...L1811 Assignment: df_joined = ... (quality: 84.2)
df_joined = (
            df_filtered
            .join(df_stats_cached, on="age_category", how="left")
            .orderBy(col("count").desc())
            .limit(10)
        )
FUNC_...L2021 Expression: show(...) (quality: 90.0)
df_joined.show(truncate=False)
FUNC_...L2077 Expression: stop(...) (quality: 90.0)
spark.stop()

Detailed Metrics & Statistics

Block Statistics

Total Blocks: 36

Functions: 5

Variables: 14

Block Type Distribution

assign 17 (47.2%)
func_def 5 (13.9%)
df_op 4 (11.1%)
func_call 4 (11.1%)
import 3 (8.3%)
control 3 (8.3%)

Function Statistics

Total Functions: 5

Async Functions: 0

Avg Parameters: 0.0

Total Parameters: 0

Function Complexity Chart

age_category 2
add_age_category 1
filter_and_select 1
aggregate_stats 1
repartition_and_cache 1

Complexity Analysis

Complexity 1: 18 blocks

Complexity 2: 11 blocks

Complexity 3: 3 blocks

Complexity 4: 2 blocks

Complexity 5: 2 blocks

Complexity Distribution Chart

0
0
1
18
2
11
3
3
4
2
5
2
6
0
7
0
8
0
9
0
10
0
Complexity Score → Count

Quality Metrics

No quality scores available.

Quality Score Distribution

No quality scores available.

Dependency Analysis

Total Dependencies: 31

Blocks with Dependencies: 21

Max Dependencies per Block: 3

Average Dependencies: 0.9

Dependencies per Block

0
15
1
14
2
4
3
3
4
0
5+
0
Dependencies per Block
Total: 36 blocks, 21 with dependencies

Variable Usage

Total Variable Reads: 179

Total Variable Writes: 28

Blocks Reading Variables: 29

Blocks Writing Variables: 22

Read/Write Ratio: 6.39 if total_writes > 0 else "∞"

Variable Read/Write Ratio

📖 Variable Reads 179 (86.5%)
✏️ Variable Writes 28 (13.5%)