Skip to content

Commit 20f0b33

Browse files
committed
C#: Fix code quality issues reported by code scanning
1 parent fbbec5d commit 20f0b33

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/CachedSymbol.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,10 @@ public Handle? MetadataHandle
151151
if (handleProp is null)
152152
{
153153
var underlyingSymbolProp = GetPropertyInfo(Symbol, "UnderlyingSymbol");
154-
if (underlyingSymbolProp is not null)
154+
if (underlyingSymbolProp?.GetValue(Symbol) is object underlying)
155155
{
156-
if (underlyingSymbolProp.GetValue(Symbol) is object underlying)
157-
{
158-
handleProp = GetPropertyInfo(underlying, "Handle");
159-
handleObj = underlying;
160-
}
156+
handleProp = GetPropertyInfo(underlying, "Handle");
157+
handleObj = underlying;
161158
}
162159
}
163160

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/ImplicitCast.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Semmle.Extraction.CSharp.Entities.Expressions
55
{
6-
internal class ImplicitCast : Expression
6+
internal sealed class ImplicitCast : Expression
77
{
88
public Expression Expr
99
{

csharp/extractor/Semmle.Extraction.CSharp/Entities/Expressions/MemberAccess.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Semmle.Extraction.CSharp.Entities.Expressions
66
{
7-
internal class MemberAccess : Expression
7+
internal sealed class MemberAccess : Expression
88
{
99
private MemberAccess(ExpressionNodeInfo info, ExpressionSyntax qualifier, ISymbol? target) : base(info)
1010
{

0 commit comments

Comments
 (0)