6
Is there any way to verify which variables are not used within the scope one-class?
As in the example below, the variables teste1 and teste4 has no utility within the application, as could locate 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 doesn’t have to use paid third-party tools like Resharper.
Give more details. Serve anything in VS? Any edition/version? Can other tools be free? Can it be something written by you? Are you talking about class fields? Not method variables? Have an example?
– Maniero
@bigown, I edited the question.
– Marco Souza
I will see all the options below before choosing the one that doesn’t suit.
– Marco Souza