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

Warnings for non-existing errors and non-lint errors before output. #105

Closed
sdurette opened this issue Oct 15, 2015 · 7 comments
Closed

Comments

@sdurette
Copy link

When linting an extremely simple cfc errors stating: "Message code: is not configured correctly." come up.
It then proceeds to mark valid lines of code as warnings with no message, id, or abbrev.

CFLint Version: 0.5.1-SNAPSHOT
master branch.

Note: the error messages do not output to files, only to the command line. Therefore I'm attaching a picture of the screen output as well as files generated by cflint and the code of the CFC.

tick.cfc:

component output=false
    initmethod="init"
    hint="I manage the tick/timer data" {

    property name="start" type="numeric" default=0;
    property name="end" type="numeric" default=0;
    property name="diff" type="numeric" default=0;

    public tick function init()
        output=false
        hint=""
    {
        setStart();

        return this;
    }

    public void function setStart(
        numeric startTick = getTickCount()
    )
        output=false
        hint="I set the start of the tick/timer."
    {
        Variables.start = ARGUMENTS.startTick;

        return;
    }

    public void function setEnd(
        numeric endTick = getTickCount()
    )
        output=false
        hint="I set the end of the tick/timer and run the processing."
    {
        Variables.end = ARGUMENTS.endTick;

        Variables.diff = Variables.end - Variables.start;

        return;
    }

    public string function getDiff()
        output=false
        hint="I return the difference."
    {
        var myRet = Variables.diff & " miliseconds";

        return myRet;
    }
}

cflint

Text version:

Issue
Severity:WARNING
Message code:
    File:C:\developer\websites\www\com\reports\rptUtil\tick.cfc
    Column:3
    Line:13
        Message:
        Variable:'null' in function: init
        Expression:null

Severity:WARNING
Message code:
    File:C:\developer\websites\www\com\reports\rptUtil\tick.cfc
    Column:19
    Line:24
        Message:
        Variable:'null' in function: setStart
        Expression:null

Severity:WARNING
Message code:
    File:C:\developer\websites\wwww\com\reports\rptUtil\tick.cfc
    Column:17
    Line:35
        Message:
        Variable:'null' in function: setEnd
        Expression:null

Severity:WARNING
Message code:
    File:C:\developer\websites\www\com\reports\rptUtil\tick.cfc
    Column:18
    Line:37
        Message:
        Variable:'null' in function: setEnd
        Expression:null

Severity:WARNING
Message code:
    File:C:\developer\websites\www\com\reports\rptUtil\tick.cfc
    Column:3
    Line:46
        Message:
        Variable:'null' in function: getDiff
        Expression:null

Total issues:5
Total warnings:5

Strange thing is that it doesn't happen with every file, just some of them and I haven't been able to figure out why.

ryaneberly added a commit that referenced this issue Oct 15, 2015
@ryaneberly
Copy link
Contributor

fixed in master

@justinmclean
Copy link
Contributor

In the fix you want to return 1 not 0 if element doesn't exist, otherwise the line number can be off by one.

@ryaneberly
Copy link
Contributor

Thanks for thinking about that Justin. I did double check and it's getting
the line number correct with a 0. Do you have an example?

On Fri, Oct 16, 2015 at 3:04 AM, Justin Mclean [email protected]
wrote:

In the fix you want to return 1 not 0 if element doesn't exist, otherwise
the line number can be off by one.


Reply to this email directly or view it on GitHub
#105 (comment).

@ryaneberly
Copy link
Contributor

Well, returning 1 reports the correct line number in my case as well.
There's some logic to calculate the actual linenumber considering the
element line number and the line number within the element. I'm good with
making it return 1.

On Fri, Oct 16, 2015 at 6:25 AM, Ryan Eberly [email protected] wrote:

Thanks for thinking about that Justin. I did double check and it's
getting the line number correct with a 0. Do you have an example?

On Fri, Oct 16, 2015 at 3:04 AM, Justin Mclean [email protected]
wrote:

In the fix you want to return 1 not 0 if element doesn't exist, otherwise
the line number can be off by one.


Reply to this email directly or view it on GitHub
#105 (comment).

@justinmclean
Copy link
Contributor

For example see the new name rule stuff I've checked in,all nine of the script tests will fail if the method returns zero. It also makes sense that the first line in a file is 1 not 0 - well to me anyway. :-)

@ryaneberly
Copy link
Contributor

Sounds good to me. thanks,

On Fri, Oct 16, 2015 at 7:03 AM, Justin Mclean [email protected]
wrote:

For example see the new name rule stuff I checked in,all nine of the
script tests will fail i the method returns zero. It also makes sense that
the first line in a file is 1 not 0 - well to me anyway. :-)


Reply to this email directly or view it on GitHub
#105 (comment).

@sdurette
Copy link
Author

It's working now. Thanks a lot!

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