Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EC89] Avoid using function cache without limit #26

Closed
Flow35650 opened this issue May 30, 2024 · 1 comment · Fixed by #27
Closed

[EC89] Avoid using function cache without limit #26

Flow35650 opened this issue May 30, 2024 · 1 comment · Fixed by #27
Assignees
Labels
🗃️ rule rule improvment or rule development or bug

Comments

@Flow35650
Copy link

Description:
If a function has decorators without max size cache, the program will store unlimited datas

Solution:
To warn the developer about this cache bad habit, we have to add a new rule on the following decorators:

  • @cache
  • @lru_cache(maxsize=None)

Additional context:
Problem discussed with @dedece35 during ecoCode Challenge 24. Initially based on the issue CRPYT204 in kanban board

@dedece35
Copy link
Member

dedece35 commented Jun 2, 2024

Hi @B3ND3L, @Flow35650

please see my review feedback in PR green-code-initiative/creedengo-rules-specifications#327

@dedece35 dedece35 assigned Flow35650 and dedece35 and unassigned dedece35 Jun 2, 2024
B3ND3L added a commit to B3ND3L/ecoCode-python that referenced this issue Jun 3, 2024
B3ND3L added a commit to B3ND3L/ecoCode-python that referenced this issue Jun 3, 2024
@dedece35 dedece35 changed the title [EC1337] Avoid using function cache without limit [EC89] Avoid using function cache without limit Jun 3, 2024
@dedece35 dedece35 linked a pull request Jun 3, 2024 that will close this issue
B3ND3L added a commit to B3ND3L/ecoCode-python that referenced this issue Jun 5, 2024
dedece35 added a commit that referenced this issue Jun 5, 2024
[Issue #26][EC89] Avoid unlimited cache
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants