Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Dec 17, 2024
1 parent 6e7cec2 commit 3643875
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ public AttacherRuntimeTask(IProcessTask task, RuntimeArgumentCollection args)
throw new ArgumentException(
$"Path is blank for ProcessTask '{task}' - it should be a class name of type {nameof(IAttacher)}");

Attacher = MEF.CreateA<IAttacher>(ProcessTask.Path, new object[] { ProcessTask.Path == typeof(RemoteTableWithoutDBCreationAttacher).ToString() ? false : true });
if (ProcessTask.Path == typeof(RemoteTableWithoutDBCreationAttacher).ToString())
{
Attacher = MEF.CreateA<IAttacher>(ProcessTask.Path);
}
else
{
Attacher = MEF.CreateA<IAttacher>(ProcessTask.Path, [true]);
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
SetPropertiesForClass(RuntimeArguments, Attacher);
Attacher.Initialize(args.StageSpecificArguments.RootDir, RuntimeArguments.StageSpecificArguments.DbInfo);
}
Expand Down

0 comments on commit 3643875

Please sign in to comment.