chore: refactor for sonarqube issues
SonarQube Analysis / sonarqube (pull_request) Successful in 6m3s
SonarQube Analysis / sonarqube (pull_request) Successful in 6m3s
This commit is contained in:
@@ -102,30 +102,6 @@ public class LocalVisitor : IVisitor<string>
|
||||
// just converting it to an AND expression for now
|
||||
var and = new And(With.Left, With.Right);
|
||||
return and.Accept(this);
|
||||
//throw new NotImplementedException("not sure what to do with 'WITH' expressions yet");
|
||||
}
|
||||
|
||||
private bool TryGetCollectionItemProperty(Expression Expression, out Property? property)
|
||||
{
|
||||
property = null;
|
||||
|
||||
if (Expression is not IBinary binary)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (binary.Left is not Property Property)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Property.Expression is not CollectionProperty collection)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
property = Property;
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual string VisitParameter(Parameter parameter) => $"{parameter.ParameterName}";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System.Dynamic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using RulesEngine.Interfaces;
|
||||
using RulesEngine.Models;
|
||||
@@ -58,23 +57,6 @@ internal class RuleSetEngine
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts an object to an ExpandoObject by copying all public properties.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to convert.</param>
|
||||
/// <returns>An ExpandoObject containing all properties from the source object.</returns>
|
||||
private static ExpandoObject ConvertObjectToExpando(object obj)
|
||||
{
|
||||
var expando = new ExpandoObject();
|
||||
var dictionary = expando as IDictionary<string, object?>;
|
||||
foreach (var property in obj.GetType().GetProperties())
|
||||
{
|
||||
dictionary.Add(property.Name, property.GetValue(obj));
|
||||
}
|
||||
|
||||
return expando;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user