📉Files - NKS0021
Use Checking.Rooted()
Last updated
Use Checking.Rooted()
Last updated
This analyzer provides the following strings:
Context | String |
---|---|
This code analyzer detects the usage of Delete
from the standard Directory
class found in the System.IO
namespace.
Using Path.IsPathRooted()
, it doesn't use any driver to wrap this call, so it calls the built-in IsPathRooted()
directly.
Alternatively, you can use Checking.Rooted()
, which uses the filesystem driver for extensibility.
To get a brief insight about how this analyzer works, compare the two code blocks shown to you below:
You can suppress this suggestion by including it in the appropriate place, whichever is convenient.
For more information about how to suppress any warning issued by the Nitrocid analyzer, visit the below page:
We recommend that every caller which use this function use the recommended abovementioned method.
Error List
Caller uses Path.IsPathRooted
instead of Checking.Rooted()
Suggestion Box
Use Checking.Rooted()
instead of Path.IsPathRooted
Description
Checking.Rooted()
uses the filesystem driver to call Path.IsPathRooted
.