Is there a tool that can check for unnecessary reference exceptions?

Is there a tool available that can scan the code and check for possible exceptions for the null reference, i.e. where there is no code to check for null before calling the method / access to the property?

+3
source share
5 answers

ReSharper can do this.

+9
source

Resharper will offer suggestions if you could access a member of the object, which may be empty.

In 4.0, “code contracts” support this at compile time - for example, it will stop you by passing a possible null to a method that claims to not want this.

+5
source

resharper

+1

RedGate has a commercial tool Exception Hunter , which can analyze your (compiled) code and show which exceptions can be selected from a given function, you can also find all the methods that cause a specific exception.

+1
source

Perhaps you are interested in new contracts in .NET 4.0?

0
source

Source: https://habr.com/ru/post/1712672/


All Articles