'Checks for concat using \'+\' and interpolation using \'%\' with strings
containing HTML.'

def visit_BinOp(self, node):

    rule = None
    if isinstance(node.op, ast.Mod):
        rule = Rules.python_interpolate_html
    elif isinstance(node.op, ast.Add):
        rule = Rules.python_concat_html
    if (rule is not None):
        visitor = HtmlStringVisitor(self.file_contents, self.results)
        visitor.visit(node.left)
        has_illegal_html_string = (len(visitor.unsafe_html_string_nodes) > 0)
        visitor = HtmlStringVisitor(self.file_contents, self.results)
        visitor.visit(node.right)
        has_illegal_html_string = (has_illegal_html_string or (len(visitor.unsafe_html_string_nodes) > 0))
        if has_illegal_html_string:
            self.results.violations.append(ExpressionRuleViolation(rule, self.node_to_expression(node)))
    self.generic_visit(node)
