Skip to content
This repository was archived by the owner on May 27, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Cake.Parallel/ParallelCakeEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@
}
}

private bool ShouldExecuteTask(ICakeContext context, CakeTask task, bool isTarget)

Check warning on line 207 in src/Cake.Parallel/ParallelCakeEngine.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make 'ShouldExecuteTask' a static method.

See more on https://sonarcloud.io/project/issues?id=AmiliaApp_Cake.Parallel&issues=AZ5PyJ2LPj2OR35kYQ_M&open=AZ5PyJ2LPj2OR35kYQ_M&pullRequest=1
{
foreach (var criteria in task.Criterias)

Check warning on line 209 in src/Cake.Parallel/ParallelCakeEngine.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Loops should be simplified using the "Where" LINQ method

See more on https://sonarcloud.io/project/issues?id=AmiliaApp_Cake.Parallel&issues=AZ5PyJ2LPj2OR35kYQ_L&open=AZ5PyJ2LPj2OR35kYQ_L&pullRequest=1
{
if (!criteria(context))
{
Expand Down Expand Up @@ -253,7 +253,7 @@
}
else
{
cts.Cancel();

Check warning on line 256 in src/Cake.Parallel/ParallelCakeEngine.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Await CancelAsync instead.

See more on https://sonarcloud.io/project/issues?id=AmiliaApp_Cake.Parallel&issues=AZ5PyJ2LPj2OR35kYQ_P&open=AZ5PyJ2LPj2OR35kYQ_P&pullRequest=1
throw;
}
}
Expand Down Expand Up @@ -283,20 +283,23 @@
report.AddSkipped(task.Name);
}

private bool isDelegatedTask(CakeTask task)

Check warning on line 286 in src/Cake.Parallel/ParallelCakeEngine.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make 'isDelegatedTask' a static method.

See more on https://sonarcloud.io/project/issues?id=AmiliaApp_Cake.Parallel&issues=AZ5PyJ2LPj2OR35kYQ_N&open=AZ5PyJ2LPj2OR35kYQ_N&pullRequest=1
{
var actionTask = task as ActionTask;

return actionTask != null && !actionTask.Actions.Any();
}

private void ReportErrors(IExecutionStrategy strategy, Action<Exception> errorReporter, Exception taskException)

Check warning on line 293 in src/Cake.Parallel/ParallelCakeEngine.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make 'ReportErrors' a static method.

See more on https://sonarcloud.io/project/issues?id=AmiliaApp_Cake.Parallel&issues=AZ5PyJ2LPj2OR35kYQ_O&open=AZ5PyJ2LPj2OR35kYQ_O&pullRequest=1
{
try
{
strategy.ReportErrors(errorReporter, taskException);
}
catch { }
catch
{
// Intentionally suppressed: if error reporting itself fails, there is nothing more we can do.
}
}

private void HandleErrors(IExecutionStrategy strategy, Action<Exception> errorHandler, Exception exception)
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Parallel/ParallelGraphBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Cake.Parallel.Module
{
public class ParallelGraphBuilder
public static class ParallelGraphBuilder
{
public static CakeGraph Build(List<CakeTask> tasks)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Parallel/ParallelGraphExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static async Task Traverse(
}

// The below line does work correctly, but does not bubble up the TaskCanceledException
// await executeTask(nodeName, cancellationTokenSource).ConfigureAwait(false);

await Task.Run(() => executeTask(nodeName, cancellationTokenSource), token).ConfigureAwait(false);
}

Expand Down