@utils.check_messages("<STR_LIT>")<EOL><INDENT>def visit_for(self, node):<DEDENT>
<EOL>if not isinstance(node.iter, astroid.Call):<EOL><INDENT>return<EOL><DEDENT>if not self._is_builtin(node.iter.func, "<STR_LIT>"):<EOL><INDENT>return<EOL><DEDENT>if len(node.iter.args) == <NUM_LIT:2> and not _is_constant_zero(node.iter.args[<NUM_LIT:0>]):<EOL><INDENT>return<EOL><DEDENT>if len(node.iter.args) > <NUM_LIT:2>:<EOL><INDENT>return<EOL><DEDENT>if not isinstance(node.iter.args[-<NUM_LIT:1>], astroid.Call):<EOL><INDENT>return<EOL><DEDENT>second_func = node.iter.args[-<NUM_LIT:1>].func<EOL>if not self._is_builtin(second_func, "<STR_LIT>"):<EOL><INDENT>return<EOL><DEDENT>len_args = node.iter.args[-<NUM_LIT:1>].args<EOL>if not len_args or len(len_args) != <NUM_LIT:1>:<EOL><INDENT>return<EOL><DEDENT>iterating_object = len_args[<NUM_LIT:0>]<EOL>if not isinstance(iterating_object, astroid.Name):<EOL><INDENT>return<EOL><DEDENT>scope = node.scope()<EOL>if iterating_object.name == "<STR_LIT>" and scope.name == "<STR_LIT>":<EOL><INDENT>return<EOL><DEDENT>for child in node.body:<EOL><INDENT>for subscript in child.nodes_of_class(astroid.Subscript):<EOL><INDENT>if not isinstance(subscript.value, astroid.Name):<EOL><INDENT>continue<EOL><DEDENT>if not isinstance(subscript.slice, astroid.Index):<EOL><INDENT>continue<EOL><DEDENT>if not isinstance(subscript.slice.value, astroid.Name):<EOL><INDENT>continue<EOL><DEDENT>if subscript.slice.value.name != node.target.name:<EOL><INDENT>continue<EOL><DEDENT>if iterating_object.name != subscript.value.name:<EOL><INDENT>continue<EOL><DEDENT>if subscript.value.scope() != node.scope():<EOL><INDENT>continue<EOL><DEDENT>self.add_message("<STR_LIT>", node=node)<EOL>return<EOL><DEDENT><DEDENT>
Emit a convention whenever range and len are used for indexing.