Skip to content

Commit

Permalink
code issue detected by SonarCloud fixed created after issue #23
Browse files Browse the repository at this point in the history
  • Loading branch information
gcramarossa committed Dec 26, 2023
1 parent 862f886 commit 5c72473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/InterAppConnector/Argument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ protected static bool IsArgumentWithPrefix(string argument, string argumentPrefi
bool isArgumentWithPrefix = false;
string[] argumentPrefixList = argumentPrefixes.Split(",");
foreach (var _ in from string argumentPrefix in argumentPrefixList
where argument.ToLower().StartsWith(argumentPrefix.ToLower())
where argument.StartsWith(argumentPrefix, StringComparison.OrdinalIgnoreCase)
select new { })
{
isArgumentWithPrefix = true;
Expand Down
8 changes: 2 additions & 6 deletions src/InterAppConnector/EnumHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal void LoadEnumerationValues<EnumType>() where EnumType : Enum
where rule.IsRuleEnabledInArgumentDefinition(item)
select rule)
{
try
if (RuleManager.IsSpecializedRule(rule))
{
Type argumentType = rule.GetType().GetInterface(typeof(IArgumentDefinitionRule<>).FullName!)!.GetGenericArguments()[0];

Expand All @@ -47,12 +47,8 @@ where attributeItem.GetType() == argumentType
descriptor = rule.DefineArgumentIfTypeDoesNotExist(argumentBaseType, item, descriptor);
}
}
catch
else
{
/*
* A default rule does not have an interface with an argument type,
* so you have to consider also this case
*/
descriptor = rule.DefineArgumentIfTypeExists(argumentBaseType, item, descriptor);
}
}
Expand Down

0 comments on commit 5c72473

Please sign in to comment.