org.sonar.plugins.csharp.S2292.html Maven / Gradle / Ivy
Why is this an issue?
Trivial properties, which include no logic but setting and getting a backing field should be converted to auto-implemented properties, yielding
cleaner and more readable code.
Noncompliant code example
public class Car
{
private string _make;
public string Make // Noncompliant
{
get { return _make; }
set { _make = value; }
}
}
Compliant solution
public class Car
{
public string Make { get; set; }
}