Skip to content

Conversation

@axunonb
Copy link
Collaborator

@axunonb axunonb commented Apr 8, 2025

No description provided.

@codecov
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

Attention: Patch coverage is 26.00000% with 37 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
Ical.Net/CalendarComponents/VTimeZone.cs 47% 4 Missing and 5 partials ⚠️
Ical.Net/CalendarComponents/FreeBusy.cs 14% 3 Missing and 3 partials ⚠️
Ical.Net/CalendarComponents/UniqueComponent.cs 0% 6 Missing ⚠️
Ical.Net/CalendarComponents/CalendarEvent.cs 17% 2 Missing and 3 partials ⚠️
Ical.Net/Evaluation/TodoEvaluator.cs 29% 2 Missing and 3 partials ⚠️
Ical.Net/CalendarComponents/Journal.cs 0% 1 Missing and 2 partials ⚠️
Ical.Net/CalendarComponents/Alarm.cs 0% 1 Missing ⚠️
Ical.Net/CalendarComponents/CalendarComponent.cs 0% 0 Missing and 1 partial ⚠️
Ical.Net/VTimeZoneInfo.cs 0% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (26%) is below the target coverage (80%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (67%) is below the target coverage (80%). You can increase the head coverage or adjust the target coverage.

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #764   +/-   ##
===================================
- Coverage    67%    67%   -0%     
===================================
  Files       104    104           
  Lines      4496   4492    -4     
  Branches   1108   1111    +3     
===================================
- Hits       2998   2994    -4     
+ Misses     1071   1068    -3     
- Partials    427    430    +3     
Files with missing lines Coverage Δ
Ical.Net/CalendarComponents/RecurringComponent.cs 65% <ø> (ø)
Ical.Net/CalendarComponents/Todo.cs 66% <100%> (ø)
Ical.Net/CalendarComponents/Alarm.cs 16% <0%> (ø)
Ical.Net/CalendarComponents/CalendarComponent.cs 79% <0%> (-1%) ⬇️
Ical.Net/VTimeZoneInfo.cs 41% <0%> (+3%) ⬆️
Ical.Net/CalendarComponents/Journal.cs 53% <0%> (-7%) ⬇️
Ical.Net/CalendarComponents/CalendarEvent.cs 72% <17%> (-3%) ⬇️
Ical.Net/Evaluation/TodoEvaluator.cs 60% <29%> (-2%) ⬇️
Ical.Net/CalendarComponents/FreeBusy.cs 48% <14%> (-1%) ⬇️
Ical.Net/CalendarComponents/UniqueComponent.cs 57% <0%> (+2%) ⬆️
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@axunonb axunonb marked this pull request as ready for review April 8, 2025 07:49
@axunonb axunonb requested a review from minichma April 8, 2025 07:49
minichma
minichma previously approved these changes Apr 9, 2025
// Standard
var standardIntervals = intervals.Where(x => x.Savings.ToTimeSpan() == new TimeSpan(0)).ToList();
var latestStandardInterval = standardIntervals.OrderByDescending(x => x.Start).FirstOrDefault();
var latestStandardInterval = standardIntervals.OrderByDescending(x => x.Start).First();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

standardIntervals is not guaranteed to be non-empty here, so .First() might throw.

Copy link
Collaborator Author

@axunonb axunonb Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, then we could just return early with the current vTimeZone


private DateTimeZone _nodaZone;
private string _tzId;
private DateTimeZone _nodaZone = DateTimeZone.Utc; // must initialize
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a future (v6) version, the Noda tz should not be part of this model object at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agree. The initialization is a NRT thing, and shouldn't have side effects.

private void DetermineStartingRecurrence(RecurrencePattern recur, ref CalDateTime referenceDateTime)
{
if (recur.Count.HasValue)
if (recur.Count.HasValue && Todo.Start != null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole EvaluateToPreviousOccurrence that this method belongs to, is pretty weird. Not sure, what the right behavior in this case is. Probably just return if Todo.Start is null. Going into the else branch if its null probably isn't correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, returning directly is better then.

@axunonb axunonb merged commit b1907e5 into main Apr 11, 2025
3 checks passed
@axunonb axunonb deleted the axunonb/wip/pr/nrt-calendar-components branch April 11, 2025 11:52
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants