Skip to content

Commit

Permalink
S1144: Add FP/FN Repro for #8532 (#8534)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Pohlmann committed Jan 17, 2024
1 parent 6d42fec commit 1a169a8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,11 @@ class Repro_8342
[Private3] protected void AProtectedMethod() { }
[Private4] private void APrivateMethodCalledByAPublicMethod() { }
}

// https://github.com/SonarSource/sonar-dotnet/issues/8532
[Serializable]
public class Repro_8532
{
[NonSerialized]
private string value; // FN
}
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,11 @@ class Repro_8342
[Private3] protected void AProtectedMethod() { }
[Private4] private void APrivateMethodCalledByAPublicMethod() { }
}

// https://github.com/SonarSource/sonar-dotnet/issues/8532
[Serializable]
public class Repro_8532
{
[NonSerialized]
private string value; // FN
}
Original file line number Diff line number Diff line change
Expand Up @@ -434,3 +434,13 @@ private class Private2Attribute : Attribute { } // Noncompliant: FP: attribute u
private class Private3Attribute : Attribute { } // Noncompliant: FP: attribute used on a protected method
private class Private4Attribute : Attribute { } // Noncompliant: FP: attribute used on a private method used by a public method
}

// https://github.com/SonarSource/sonar-dotnet/issues/8532
[Serializable]
public class Repro_8532
{
private string type; // Noncompliant FP
private string key { get; set; } // Noncompliant FP
[NonSerialized]
private string value; // FN
}

0 comments on commit 1a169a8

Please sign in to comment.