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

Not accounting for switch statements #234

Closed
CamBurris opened this issue Jan 10, 2017 · 2 comments
Closed

Not accounting for switch statements #234

CamBurris opened this issue Jan 10, 2017 · 2 comments

Comments

@CamBurris
Copy link

It seems like the control expression in a switch statement is not being accounted for.

For example, the following code will trigger a false positive UNUSED_METHOD_ARGUMENT error.

<cfscript>
	public struct function onLoad(boolean test = false) output="false" {
		switch (arguments.test) {
		}

		return {};
	}
</cfscript>
@CamBurris
Copy link
Author

It seems like we are also not taking into account the body of the switch statement.

The below will also trigger an UNUSED_METHOD_ARGUMENT.

<cfscript>
	public struct function onLoad(boolean test = false) output="false" {
		switch (true) {
			case true:
				if (arguments.test) {
				}
		}
	}
</cfscript>

ryaneberly added a commit that referenced this issue Jan 15, 2017
@ryaneberly
Copy link
Contributor

Good catch. It is fixed.

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

No branches or pull requests

2 participants