package com.cflint.plugins.core;

import net.htmlparser.jericho.Element;

import com.cflint.BugList;
import com.cflint.plugins.CFLintScannerAdapter;
import com.cflint.plugins.Context;

public class CFXTagChecker extends CFLintScannerAdapter {

	@Override
	public void element(final Element element, final Context context, final BugList bugs) {
		final String tagName = element.getName();
		final String cfmlTagCheck = getParameter("tagName");
		if (tagName.matches(cfmlTagCheck)) {
			context.addMessage("AVOID_USING_" + tagName.toUpperCase() + "_TAG", tagName);
		}
	}
}

@@ -442,45 +442,173 @@
 ;%0A%09%09
-if (tagName.matches(cfmlTagCheck)) %7B%0A
+final String scope = getParameter(%22scope%22);%0A%0A%09%09if (tagName.matches(cfmlTagCheck)) %7B%0A%09%09%09if (scope == null %7C%7C scope.equals(%22component%22) && context.isInComponent()) %7B%0A%09
 %09%09%09c
@@ -684,16 +684,21 @@
 gName);%0A
+%09%09%09%7D%0A
 %09%09%7D%0A%09%7D%0A%7D

add scope parameter (needed for cfinclude)