You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rule EC69 is irrelevant for Python. The rule seems to imply that calling a function in a for statement results in calling this function multiple times, which is not true.
See the SonarQube screenshot below :
The two following syntaxes are strictly equivalent regarding the number of calls to the range builtin function :
This prints 2 since the function is called only twice.
Therefore, I think the rule should be dropped since it's confusing and doesn't make much sense from an eco-design perspective, at least for Python, but it should be investigated for other languages too.
The text was updated successfully, but these errors were encountered:
Rule EC69 is irrelevant for Python. The rule seems to imply that calling a function in a for statement results in calling this function multiple times, which is not true.
See the SonarQube screenshot below :
The two following syntaxes are strictly equivalent regarding the number of calls to the
range
builtin function :A simple way to prove see this is using a counter :
This prints
2
since the function is called only twice.Therefore, I think the rule should be dropped since it's confusing and doesn't make much sense from an eco-design perspective, at least for Python, but it should be investigated for other languages too.
The text was updated successfully, but these errors were encountered: