Skip to content

Commit a301e4b

Browse files
committed
fix: rename variables in F1 Analyzer to resolve CodeQL alert
1 parent c8a9a82 commit a301e4b

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

utilities/F1-Performance-Analyzer/F1-Performance-Analyzer.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
print(f"\n🏆 {'Pos':<4} | {'Driver':<20} | {'Constructor':<20} | {'Points':<6}")
3737
print("-" * 60)
3838
for item in standings[:10]: # Top 10 Drivers
39-
pos = item['position']
40-
driver = f"{item['Driver']['givenName']} {item['Driver']['familyName']}"
41-
team = item['Constructors'][0]['name']
42-
points = item['points']
43-
print(f"{pos:<4} | {driver:<20} | {team:<20} | {points:<6}")
39+
rank_val = item['position']
40+
driver_name = f"{item['Driver']['givenName']} {item['Driver']['familyName']}"
41+
team_name = item['Constructors'][0]['name']
42+
score_points = item['points']
43+
print(f"{rank_val:<4} | {driver_name:<20} | {team_name:<20} | {score_points:<6}")
4444
else:
4545
print(f"❌ Error fetching data: Status code {response.status}")
4646
except Exception as e:
@@ -60,11 +60,11 @@
6060
print(f"\n🏆 {'Pos':<4} | {'Constructor':<25} | {'Nationality':<15} | {'Points':<6}")
6161
print("-" * 60)
6262
for item in standings:
63-
pos = item['position']
64-
team = item['Constructor']['name']
65-
nat = item['Constructor']['nationality']
66-
points = item['points']
67-
print(f"{pos:<4} | {team:<25} | {nat:<15} | {points:<6}")
63+
rank_val = item['position']
64+
team_name = item['Constructor']['name']
65+
team_country = item['Constructor']['nationality']
66+
score_points = item['points']
67+
print(f"{rank_val:<4} | {team_name:<25} | {team_country:<15} | {score_points:<6}")
6868
else:
6969
print(f"❌ Error fetching data: Status code {response.status}")
7070
except Exception as e:

0 commit comments

Comments
 (0)