Skip to content

Commit 3dbb8ad

Browse files
committed
fix sonar issue with number of parameters
1 parent d2e762b commit 3dbb8ad

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

libraries/tests/e2e/InfraShared/IdempotencyStack.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,41 @@ public IdempotencyStack(Construct scope, string id, IdempotencyStackProps props)
3131
{
3232
var baseAotPath = $"../functions/{utility}/AOT-Function/src/AOT-Function";
3333
var distAotPath = $"../functions/{utility}/AOT-Function/dist";
34+
var path = new Path(baseAotPath, distAotPath);
3435

3536
var architecture = props.ArchitectureString == "arm64" ? Architecture.ARM_64 : Architecture.X86_64;
3637
var arch = architecture == Architecture.X86_64 ? "X64" : "ARM";
3738
CreateFunctionConstruct(this, $"{utility}_{arch}_aot_net8", Runtime.DOTNET_8, architecture,
38-
$"E2ETestLambda_{arch}_AOT_NET8_{utility}", baseAotPath, distAotPath, props);
39+
$"E2ETestLambda_{arch}_AOT_NET8_{utility}", path, props);
3940
}
4041
else
4142
{
4243
var basePath = $"../functions/{utility}/Function/src/Function";
4344
var distPath = $"../functions/{utility}/Function/dist";
45+
var path = new Path(basePath, distPath);
4446

4547
CreateFunctionConstruct(this, $"{utility}_X64_net8", Runtime.DOTNET_8, Architecture.X86_64,
46-
$"E2ETestLambda_X64_NET8_{utility}", basePath, distPath, props);
48+
$"E2ETestLambda_X64_NET8_{utility}", path, props);
4749
CreateFunctionConstruct(this, $"{utility}_arm_net8", Runtime.DOTNET_8, Architecture.ARM_64,
48-
$"E2ETestLambda_ARM_NET8_{utility}", basePath, distPath, props);
50+
$"E2ETestLambda_ARM_NET8_{utility}", path, props);
4951
CreateFunctionConstruct(this, $"{utility}_X64_net6", Runtime.DOTNET_6, Architecture.X86_64,
50-
$"E2ETestLambda_X64_NET6_{utility}", basePath, distPath, props);
52+
$"E2ETestLambda_X64_NET6_{utility}", path, props);
5153
CreateFunctionConstruct(this, $"{utility}_arm_net6", Runtime.DOTNET_6, Architecture.ARM_64,
52-
$"E2ETestLambda_ARM_NET6_{utility}", basePath, distPath, props);
54+
$"E2ETestLambda_ARM_NET6_{utility}", path, props);
5355
}
5456
}
5557

5658
private void CreateFunctionConstruct(Construct scope, string id, Runtime runtime, Architecture architecture,
57-
string name, string sourcePath, string distPath, PowertoolsDefaultStackProps props)
59+
string name,Path path, PowertoolsDefaultStackProps props)
5860
{
5961
var lambdaFunction = new FunctionConstruct(scope, id, new FunctionConstructProps
6062
{
6163
Runtime = runtime,
6264
Architecture = architecture,
6365
Name = name,
6466
Handler = props.IsAot ? "AOT-Function" : "Function::Function.Function::FunctionHandler",
65-
SourcePath = sourcePath,
66-
DistPath = distPath,
67+
SourcePath = path.SourcePath,
68+
DistPath = path.DistPath,
6769
Environment = new Dictionary<string, string>
6870
{
6971
{ "IDEMPOTENCY_TABLE_NAME", Table.TableName }
@@ -75,3 +77,5 @@ private void CreateFunctionConstruct(Construct scope, string id, Runtime runtime
7577
Table.GrantReadWriteData(lambdaFunction.Function);
7678
}
7779
}
80+
81+
public record Path(string SourcePath, string DistPath);

0 commit comments

Comments
 (0)