Skip to content

feat(GCI116): add rule to avoid range(len()) pattern#161

Open
kourawy wants to merge 1 commit into
green-code-initiative:mainfrom
kourawy:GCI116-Python
Open

feat(GCI116): add rule to avoid range(len()) pattern#161
kourawy wants to merge 1 commit into
green-code-initiative:mainfrom
kourawy:GCI116-Python

Conversation

@kourawy
Copy link
Copy Markdown

@kourawy kourawy commented May 20, 2026

  • Detect range(len()) in for loops, comprehensions, and generators
  • Recommend direct iteration or enumerate() based on index need
  • Empirical benchmark with CodeCarbon: 17-40% CPU gain with direct iteration
  • Unit tests (compliant + non-compliant) and integration tests
  • Complementary to GCI404/GCI106/GCI107/GCI108

- Detect range(len()) in for loops, comprehensions, and generators
- Recommend direct iteration or enumerate() based on index need
- Empirical benchmark with CodeCarbon: 17-40% CPU gain with direct iteration
- Unit tests (compliant + non-compliant) and integration tests
- Complementary to GCI404/GCI106/GCI107/GCI108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

1 participant