Skip to content

Commit

Permalink
Merge pull request #503 from StefanMaron/development
Browse files Browse the repository at this point in the history
Resolve possible mistake in Rule0012 on removing Try/Catch
  • Loading branch information
Arthurvdv authored Jan 11, 2024
2 parents 9a3c59a + c60ec96 commit 5c586dd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Design/Rule0012DoNotUseObjectIdInSystemFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ private void CheckForObjectIdsInFunctionInvocations(OperationAnalysisContext con
IInvocationExpression operation = (IInvocationExpression)context.Operation;

RelevantFuntion CurrentFunction = FunctionCallsWithIDParamaters.RelevantFunctions.FirstOrDefault(o => (o.ObjectType.ToString().ToUpper() == operation.TargetMethod.ContainingSymbol.Name.ToUpper() && o.FunctionName == operation.TargetMethod.Name));
if (CurrentFunction == null) return;

SyntaxKind[] AllowedParameterKinds = { SyntaxKind.MemberAccessExpression, SyntaxKind.IdentifierName, SyntaxKind.InvocationExpression, SyntaxKind.QualifiedName };
if (operation.TargetMethod.Parameters.Length != 0 && !AllowedParameterKinds.Contains(operation.Arguments[0].Syntax.Kind) && (operation.Arguments[0].Syntax.ToString() != "0" || !CurrentFunction.ZeroIDAllowed))
Expand Down

0 comments on commit 5c586dd

Please sign in to comment.