This is a migrated thread and some comments may be shown as answers.

JustCode Custom Rule Definition

1 Answer 24 Views
Code Analysis
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pratham
Top achievements
Rank 1
Pratham asked on 07 Jul 2015, 06:07 PM

Hi All,

I need to have a JustCode Null Check Rule which will give JustCode error if anyone try to use or access an object without having Not Nothing condition in VB.NET. So, it means it will be mandatory to check if Object IsNot Nothing then only one can access or use an object in code with this rule like below:

If myObject IsNot Nothing Then 

Console.WriteLine(myObject.Tostring());

EndIf

So, how can I generate or enforce such rule with JustCode? Please help in achieving solution for this problem asap.  

Thanks,

Pratham

 

 

1 Answer, 1 is accepted

Sort by
0
Svetlozar
Telerik team
answered on 10 Jul 2015, 12:59 PM
Hello,

Thank you for your feedback!

You could create your own JustCode extension that could provide a warning and q quick fix for your specific case. We have a sample solution you could start with - justcode-extensions

Regards,
Svetlozar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Code Analysis
Asked by
Pratham
Top achievements
Rank 1
Answers by
Svetlozar
Telerik team
Share this question
or