Conversation
|
|
||
| max_items = 30 | ||
| count = 0 | ||
| for citation in client.paginate_citations( |
Check notice
Code scanning / CodeQL
Unused global variable Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 days ago
In general, when a loop or global variable is intentionally unused, it should be given a conventional “unused” name (such as _ or a name containing unused) so that both humans and static analysis tools recognize it as deliberate. Otherwise, the unused variable should be removed.
Here, the loop on lines 114–116 iterates over client.paginate_citations(...) but never uses citation. The best fix without changing functionality is to rename the loop variable from citation to _, which signals it is intentionally unused while leaving the logic (incrementing count, enforcing max_items, and breaking) unchanged. No imports or additional definitions are needed, and no other parts of the file reference this particular loop variable, so the change is localized to the for statement in examples/enriched_citations_example.py.
| @@ -111,7 +111,7 @@ | ||
|
|
||
| max_items = 30 | ||
| count = 0 | ||
| for citation in client.paginate_citations( | ||
| for _ in client.paginate_citations( | ||
| tech_center_q="2800", rows=10 | ||
| ): | ||
| count += 1 |
Summary
Details
New models:
EnrichedCitation,EnrichedCitationResponse,EnrichedCitationFieldsResponse.