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

Unused false positives when used in script tag attribute value #593

Closed
KamasamaK opened this issue Oct 5, 2018 · 3 comments
Closed

Unused false positives when used in script tag attribute value #593

KamasamaK opened this issue Oct 5, 2018 · 3 comments

Comments

@KamasamaK
Copy link
Collaborator

KamasamaK commented Oct 5, 2018

This code is incorrectly triggering UNUSED_METHOD_ARGUMENT and UNUSED_LOCAL_VARIABLE even though they are being used in cfhttpparam script tags. I have verified that this works fine for the standard tag equivalent.

/**
 * Some function hint
 * @call The value of call
 */
public void function foo(
	required string call
)
{
	var bar = "";
	cfhttp(url="#variables.host#", port="22", method="GET", timeout="30", result="local.httpResponse") {
		cfhttpparam(type="url", name="call", value="#arguments.call#");
		cfhttpparam(type="url", name="bar", value="#local.bar#");
	}
}
  • Argument call is not used in function. Consider removing it. (UNUSED_METHOD_ARGUMENT)
  • Local variable bar is not used in function foo. Consider removing it. (UNUSED_LOCAL_VARIABLE)

Related: #574

@KamasamaK KamasamaK added the bug label Oct 5, 2018
@KamasamaK KamasamaK changed the title UNUSED_METHOD_ARGUMENT false positive when used in script tag attribute value Unused false positives when used in script tag attribute value Oct 5, 2018
@ryaneberly
Copy link
Contributor

ryaneberly commented Oct 8, 2018

cfparser does not include the body of cfhttp in the parsed tree. Good catch, we'll have to enhance CFParser

@ryaneberly
Copy link
Contributor

fixed in dev branch

@ryaneberly
Copy link
Contributor

fixed in dev branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants