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

difference between output styles -text and -json #146

Closed
bardware opened this issue Feb 13, 2016 · 9 comments
Closed

difference between output styles -text and -json #146

bardware opened this issue Feb 13, 2016 · 9 comments
Assignees

Comments

@bardware
Copy link

When I have CFLint output it's results in text format I get more information than when I get JSON results.

Example

<cffunction name="varNotDeclared" returntype="numeric" hint="VAR_NOT_DECLARED" output="false">

    <cfset undeclaredVar = "Hello World">

    <cfreturn 1>
</cffunction>

I run java -jar CFLint-0.6.1-all.jar -includeRule MISSING_VAR -text and receive: Variable:'undeclaredVar' in function: varNotDeclared
I run: java -jar CFLint-0.6.1-all.jar -includeRule MISSING_VAR -json and receive:
"message" : "Variable undeclaredVar is not declared with a var statement.", "variable" : "undeclaredVar", "expression" : "undeclaredVar"

Can you please change the JSON output to also include the name of the function where the variable is not declared?

@justinmclean justinmclean self-assigned this Feb 13, 2016
@justinmclean
Copy link
Contributor

Fixed in dev branch. Also added to XML output.

@bardware
Copy link
Author

I see a function member in the JSON output and it's filled correctly in MISSING_VAR and AVOID_USING_CFINCLUDE_TAG.
It might also be set in UNUSED_METHOD_ARGUMENT and VAR_ALLCAPS_NAME

@justinmclean
Copy link
Contributor

Fixed and added function name to a few other rules that it might be helpful in.

@bardware
Copy link
Author

FUNCTION_TOO_COMPLEX and ARG_HINT_MISSING might set the function member also.

@justinmclean
Copy link
Contributor

Fixed along with a couple of others.

@bardware
Copy link
Author

looks good

@bardware
Copy link
Author

This change has not made it into the 0.7.0 release

@bardware bardware reopened this Apr 29, 2016
@ryaneberly
Copy link
Contributor

Oh. I see that now. Thanks for pointing that out.

@ryaneberly
Copy link
Contributor

it's in 0.7.1

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

3 participants