Re: Rules conflicts?

22 views
Skip to first unread message

Ryuichi Saito

unread,
Nov 15, 2014, 7:55:55 PM11/15/14
to Samuel Yang, oclin...@googlegroups.com
Hi Samuel,
One place I would like to check is whether your Jenkins machine has OCLint’s custom settings on user level or system level. 

OCLint reads from its installation’s `etc` folder, ~/.oclint, and then project’s .oclint file to override the default settings of the tool.

Thanks,
Ryuichi




On Fri, Nov 14, 2014 at 4:53 PM, Samuel Yang <yangxi...@gmail.com> wrote:


Hi all,

I have a rule which is very simple, but when I integrated it into Jenkins, it caused some warnings are decreased. e.g.  long line rule without my custom rule, it catches 100 warnings, but with mine, it only catches 20. 

I have debugged it and found it was caused by the getNameAsString. However, I have no idea why this function call breaks other rules. 

Have you meet this before or do you guys have any suggestion?


     void applyNSMakeRange(CallExpr* call)

    {

        const FunctionDecl * FD = call->getDirectCallee();//ok

        const FunctionDecl *CD = FD->getCanonicalDecl();

        //string functionName = CD->getNameAsString();//failed

        if(functionName == "xxxx")

        {

           addViolation(call, this, "NSMakeRange range may be missed range");

        }

    }


public:

    virtual const string name() const

    {

        return "Dangerous methods call";

    }


    virtual int priority() const

    {

        return 2;

    }

    

    bool VisitCallExpr(CallExpr* expr)

    {

        applyDecl(expr);

        return true;

    }

 

--
You received this message because you are subscribed to the Google Groups "OCLint Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oclint-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Samuel Yang

unread,
Dec 31, 2014, 2:17:42 AM12/31/14
to oclin...@googlegroups.com, yangxi...@gmail.com
Thanks. Ryuichi. 

I have figured out that it was caused I missed some NULL check, I guess there were NPR kill OCLint. 

在 2014年11月16日星期日UTC+8上午8时55分55秒,Ryuichi Saito写道:
Reply all
Reply to author
Forward
0 new messages