Merge pull request #5421 from tamasvajk/feature/codequalityfixes

C#: Fix code quality issues reported by code scanning
This commit is contained in:
Tamás Vajk
2021-03-19 12:09:18 +01:00
committed by GitHub
3 changed files with 5 additions and 8 deletions

View File

@@ -151,13 +151,10 @@ namespace Semmle.Extraction.CSharp.Entities
if (handleProp is null)
{
var underlyingSymbolProp = GetPropertyInfo(Symbol, "UnderlyingSymbol");
if (underlyingSymbolProp is not null)
if (underlyingSymbolProp?.GetValue(Symbol) is object underlying)
{
if (underlyingSymbolProp.GetValue(Symbol) is object underlying)
{
handleProp = GetPropertyInfo(underlying, "Handle");
handleObj = underlying;
}
handleProp = GetPropertyInfo(underlying, "Handle");
handleObj = underlying;
}
}

View File

@@ -3,7 +3,7 @@ using Semmle.Extraction.Kinds;
namespace Semmle.Extraction.CSharp.Entities.Expressions
{
internal class ImplicitCast : Expression
internal sealed class ImplicitCast : Expression
{
public Expression Expr
{

View File

@@ -4,7 +4,7 @@ using Semmle.Extraction.Kinds;
namespace Semmle.Extraction.CSharp.Entities.Expressions
{
internal class MemberAccess : Expression
internal sealed class MemberAccess : Expression
{
private MemberAccess(ExpressionNodeInfo info, ExpressionSyntax qualifier, ISymbol? target) : base(info)
{