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

Should recognize variables used with differing case #242

Closed
mpaluchowski opened this issue Feb 21, 2017 · 1 comment
Closed

Should recognize variables used with differing case #242

mpaluchowski opened this issue Feb 21, 2017 · 1 comment

Comments

@mpaluchowski
Copy link
Contributor

The following code:

function foo() {
  var bar = 1;
  return Bar;
}

will produce 2 issues:

  1. Local variable bar is not used in function foo, consider removing it, on line var bar = 1;
  2. Variable Bar is not a valid name. Please use CamelCase or underscores, on line return Bar;

Issue 1 is a false positive, because the variable is used, albeit with a different case. Issue 2 is valid, but doesn't really point out the real problem, that the same variable is used with inconsistent case.

I suggest CFLint becomes a bit smarter about this and instead of these two issues reports one, something a long the lines of: "Variable Bar is used with inconsistent case. Please use the same case in all references as in the declaration."

ryaneberly added a commit that referenced this issue Feb 22, 2017
@ryaneberly
Copy link
Contributor

@mpaluchowski , UnusedLocalVarChecker is now case insensitive. Thanks!

(The 2nd message about camel case is a valid checker, disable it if you don't want it)

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