Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/Turnierplan.Core/Tournament/Tournament.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@

public void ShiftToTimezone(TimeZoneInfo timeZone)
{
foreach (var match in _matches)

Check warning on line 270 in src/Turnierplan.Core/Tournament/Tournament.cs

View workflow job for this annotation

GitHub Actions / Validate

Loops should be simplified using the "Where" LINQ method (https://rules.sonarsource.com/csharp/RSPEC-3267)
{
if (match.Kickoff is not null)
{
Expand Down Expand Up @@ -433,7 +433,7 @@
}
}

public List<RefereeCard> GenerateRefereeCards()

Check warning on line 436 in src/Turnierplan.Core/Tournament/Tournament.cs

View workflow job for this annotation

GitHub Actions / Validate

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
var cards = new List<RefereeCard>();
var groupRefereeMap = new Dictionary<Group, Group>();
Expand All @@ -445,6 +445,14 @@
groupRefereeMap[_groups[0]] = _groups[0];
break;
}
case 4:
{
groupRefereeMap[_groups[0]] = _groups[2];
groupRefereeMap[_groups[1]] = _groups[3];
groupRefereeMap[_groups[2]] = _groups[0];
groupRefereeMap[_groups[3]] = _groups[1];
break;
}
default:
{
for (var i = 0; i < _groups.Count; i++)
Expand Down Expand Up @@ -521,7 +529,7 @@
}
}

private void ComputeGroupPhaseResults()

Check warning on line 532 in src/Turnierplan.Core/Tournament/Tournament.cs

View workflow job for this annotation

GitHub Actions / Validate

Refactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
foreach (var group in _groups)
{
Expand Down Expand Up @@ -552,7 +560,7 @@
}
}

private void ComputeRanking()

Check warning on line 563 in src/Turnierplan.Core/Tournament/Tournament.cs

View workflow job for this annotation

GitHub Actions / Validate

Refactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
var matchesWithRankingInfluence = new HashSet<Match>();
var undefinedRankings = Enumerable.Range(1, _teams.Count).ToList();
Expand Down Expand Up @@ -743,7 +751,7 @@
}
}

private void GenerateFinalsMatches(FinalsRoundConfig? config, int matchIndexOffset)

Check warning on line 754 in src/Turnierplan.Core/Tournament/Tournament.cs

View workflow job for this annotation

GitHub Actions / Validate

Refactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
if (config is null)
{
Expand Down Expand Up @@ -886,7 +894,7 @@
}
}

private void GenerateSchedule(ScheduleConfig? config)

Check warning on line 897 in src/Turnierplan.Core/Tournament/Tournament.cs

View workflow job for this annotation

GitHub Actions / Validate

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
if (config is null)
{
Expand Down
Loading