There is some way to check which variables are not used within the scope > of a class?
As in the example below, the variables test1 and test4 have no utility within the application, how could it find such variables?
using System;
using System.Web.UI;
namespace bDBContext
{
public partial class _Default : Page
{
string teste1 = ""; // não usada
bool ok = true; // usada
string teste2 = ""; // usada
protected void Page_Load(object sender, EventArgs e)
{
string teste3 = teste2; // usada
if (ok)
{
string teste4 = ""; // não usada
}
}
public void Salvar()
{
string teste5 = ""; // usada
if (string.IsNullOrEmpty(teste4))
{
}
}
}
}
Something does not have to use third-party paid tools like Resharper .