Skip to content

Commit a4e0d0f

Browse files
committed
removing duplicate code
1 parent 8d9680b commit a4e0d0f

1 file changed

Lines changed: 0 additions & 54 deletions

File tree

src/Microsoft.PowerApps.TestEngine/Modules/TestEngineExtensionChecker.cs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -426,60 +426,6 @@ public bool VerifyContainsValidNamespacePowerFxFunctions(TestSettingExtensions s
426426
return false;
427427
}
428428
}
429-
430-
if (type.BaseType != null && type.BaseType.Name == "ReflectionAction")
431-
{
432-
var constructors = type.GetConstructors();
433-
if (constructors.Count() == 0)
434-
{
435-
Logger.LogInformation($"No constructor defined for {type.Name}.");
436-
return false;
437-
}
438-
var constructor = constructors.FirstOrDefault(c => c.HasBody);
439-
if (constructor == null || !constructor.HasBody)
440-
{
441-
Logger.LogInformation($"No constructor with body for {type.Name}.");
442-
return false;
443-
}
444-
var baseCall = constructor.Body.Instructions?.FirstOrDefault(i => i.OpCode == OpCodes.Call && i.Operand is MethodReference mr && mr.Name == ".ctor");
445-
if (baseCall == null)
446-
{
447-
Logger.LogInformation($"No base constructor call for {type.Name}.");
448-
return false;
449-
}
450-
var baseCtor = (MethodReference)baseCall.Operand;
451-
if (baseCtor.Parameters?.Count() < 2 || baseCtor.Parameters[0].ParameterType.FullName != "Microsoft.PowerFx.Core.Utils.DPath")
452-
{
453-
Logger.LogInformation($"Invalid constructor signature for {type.Name}.");
454-
return false;
455-
}
456-
var fxNamespace = GetPowerFxNamespace(type.Name, code);
457-
if (string.IsNullOrEmpty(fxNamespace))
458-
{
459-
Logger.LogInformation($"No Power FX Namespace found for {type.Name}.");
460-
return false;
461-
}
462-
var allowList = settings.AllowPowerFxNamespaces.ToList();
463-
if (assemblyHasProvider && !allowList.Contains(NAMESPACE_PREVIEW))
464-
{
465-
allowList.Add(NAMESPACE_PREVIEW);
466-
}
467-
if (settings.DenyPowerFxNamespaces.Contains(fxNamespace))
468-
{
469-
Logger.LogInformation($"Deny Power FX Namespace {fxNamespace} for {type.Name}.");
470-
return false;
471-
}
472-
if (settings.DenyPowerFxNamespaces.Contains("*") && !allowList.Contains(fxNamespace) && fxNamespace != NAMESPACE_TEST_ENGINE)
473-
{
474-
Logger.LogInformation($"Wildcard deny blocks {fxNamespace} for {type.Name}.");
475-
return false;
476-
}
477-
if (!allowList.Contains(fxNamespace) && fxNamespace != NAMESPACE_TEST_ENGINE)
478-
{
479-
Logger.LogInformation($"Namespace {fxNamespace} not allowed for {type.Name}.");
480-
return false;
481-
}
482-
}
483429
}
484430
}
485431
return isValid;

0 commit comments

Comments
 (0)