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

@kourawy kourawy commented May 20, 2026

Copy link
Copy Markdown
  • 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
@B3ND3L B3ND3L added the 🗃️ rule rule improvment or rule development or bug label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗃️ rule rule improvment or rule development or bug

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

2 participants