Branch Coverage

blib/lib/Net/CalDAVTalk.pm
Criterion Covered Total %
branch 1 788 0.1


line true false branch
33 4 0 unless grep {$_ eq $want;} @properties
513 0 0 unless defined $tzName
514 0 0 if $UTCLinks{$tzName}
515 0 0 unless (exists $Self->{'_tz'}{$tzName})
539 0 0 if ($@)
565 0 0 unless ($calendarId)
580 0 0 if $ColourNames{$color}
581 0 0 unless $color =~ /^\s*(\#[a-f0-9]{3,8})\s*$/
583 0 0 if length $color == 7
586 0 0 if ($color =~ /^#(.)(.)(.).?$/)
591 0 0 if (length $color == 9)
614 0 0 unless $Calendars and @$Calendars
652 0 0 unless $Args{'Properties'}
672 0 0 unless $$Response{"{$NS_D}response"}
673 0 0 unless $$Response{"{$NS_D}href"}{'content'}
681 0 0 unless $$Response{"{$NS_D}propstat"}
682 0 0 unless $$Propstat{"{$NS_D}prop"}{"{$NS_D}resourcetype"}{"{$NS_C}calendar"}
686 0 0 !defined($visData) || $visData ? :
696 0 0 unless $Priv and ref $Priv eq 'ARRAY'
698 0 0 if $$item{"{$NS_CY}admin"}
699 0 0 if $$item{"{$NS_D}write-content"}
700 0 0 if $$item{"{$NS_D}read"}
701 0 0 if $$item{"{$NS_C}read-free-busy"}
706 0 0 unless $Type and ref $Type eq 'ARRAY'
708 0 0 unless $item->{'@content-type'}
709 0 0 if $item->{'@content-type'}{'content'} eq 'application/event+json'
713 0 0 $Privileges{'mayWrite'} ? :
717 0 0 unless $ace and ref $ace eq 'ARRAY'
719 0 0 if $$Acl{"{$NS_D}protected"}
720 0 0 unless $$Acl{"{$NS_D}grant"}
721 0 0 unless $$Acl{"{$NS_D}grant"}{"{$NS_D}privilege"}
722 0 0 unless ref $$Acl{"{$NS_D}grant"}{"{$NS_D}privilege"} eq 'ARRAY'
725 0 0 unless $user =~ m[^/dav/principals/user/([^/]+)]
727 0 0 if $email eq 'admin'
736 0 0 if $$item{"{$NS_CY}admin"}
737 0 0 if $$item{"{$NS_D}write-content"}
738 0 0 if $$item{"{$NS_D}read"}
739 0 0 if $$item{"{$NS_C}read-free-busy"}
753 0 0 @ShareWith ? :
0 0 $CanEvent ? :
786 0 0 unless (ref $Args eq 'HASH')
805 0 0 if (exists $Args->{'isVisible'})
806 0 0 $Args->{'isVisible'} ? :
809 0 0 if (exists $Args->{'color'})
813 0 0 if (exists $Args->{'timeZone'})
817 0 0 if (exists $Args->{'precedence'})
818 0 0 unless (($Args->{'precedence'} // '') =~ /^\d+$/)
848 0 0 unless (ref $Args eq 'HASH')
855 0 0 unless ($calendarId)
861 0 0 if (defined $Calendar{'name'})
865 0 0 if (defined $Calendar{'color'})
869 0 0 if (exists $Args->{'timeZone'})
873 0 0 if (exists $Calendar{'isVisible'})
874 0 0 $Calendar{'isVisible'} ? :
877 0 0 if (exists $Calendar{'precedence'})
878 0 0 unless (($Calendar{'precedence'} || '') =~ /^\d+$/)
885 0 0 unless @Params
917 0 0 unless $Event
919 0 0 unless ref $Event eq 'HASH'
956 0 0 wantarray ? :
982 0 0 unless $calendarId
987 0 0 $key =~ /:/ ? :
992 0 0 if ($Args{'ContentType'})
995 0 0 if ($Args{'Version'})
1020 0 0 unless $$Response{"{$NS_D}response"}
1022 0 0 unless $href
1023 0 0 unless $$Response{"{$NS_D}propstat"}
1028 0 0 unless $Data
1032 0 0 if ($Prop->{'-content-type'} and $Prop->{'-content-type'} =~ m[application/event\+json]) { }
1041 0 0 if ($@)
1045 0 0 unless $Event
1047 0 0 if ($Args{'Full'})
1057 0 0 if ($key =~ /(.*):(.*)/)
1062 0 0 unless $AData
1071 0 0 wantarray ? :
1088 0 0 unless $calendarId
1091 0 0 if ($Args{'AlwaysRange'} or $Args{'after'} or $Args{'before'})
1123 0 0 unless $$Response{"{$NS_D}response"}
1125 0 0 unless $href
1126 0 0 unless $$Response{"{$NS_D}propstat"}
1150 0 0 if @$Errors
1151 0 0 if @$Events > 1
1170 0 0 unless $calendarId
1173 0 0 if ($Args{'AlwaysRange'} or $Args{'after'} or $Args{'before'})
1195 0 0 unless my $Data = eval { do { vcard2hash($Response->{'content'}, 'multival', ['rrule'], 'only_one', 1) } }
1202 0 0 unless $item->{'type'} eq 'vfreebusy'
1207 0 0 if ($End =~ /^[+-]?P/i) { }
1219 0 0 $IsAllDay ? :
1227 0 0 $NewEvent->{'isAllDay'} ? :
1261 0 0 wantarray ? :
1267 0 0 unless $calendarId
1273 0 0 $Args{'syncToken'} ? :
1286 0 0 unless $SyncToken
1289 0 0 unless $$Response{"{$NS_D}response"}
1291 0 0 unless $href
1293 0 0 unless ($$Response{"{$NS_D}propstat"})
1298 0 0 unless $$Response{"{$NS_D}propstat"}
1300 0 0 if ($status =~ / 200 /) { }
1333 0 0 unless $calendarId
1335 0 0 unless ref $Args eq 'HASH'
1340 0 0 unless (exists $Args->{'sequence'})
1344 0 0 if ($Args->{'exceptions'})
1347 0 0 unless $val
1348 0 0 if exists $val->{'sequence'}
1360 0 0 if ($UseEvent) { }
1395 0 0 if ($UseEvent) { }
1421 0 0 unless $OldEvent
1427 0 0 if (exists $Args->{$Property}) { }
0 0 elsif (exists $OldEvent->{$Property}) { }
1428 0 0 if (defined $Args->{$Property})
1438 0 0 unless (exists $Args->{'sequence'})
1442 0 0 if ($NewEvent{'exceptions'})
1445 0 0 unless $val
1446 0 0 if exists $val->{'sequence'}
1450 0 0 if ($old and exists $old->{'sequence'})
1451 0 0 unless $sequence > $old->{'sequence'}
1474 0 0 unless $OldEvent
1480 0 0 $key =~ /:/ ? :
1481 0 0 if (defined $Args->{$key}) { }
1490 0 0 if @Set
1491 0 0 if @Remove
1492 0 0 unless @Params
1514 0 0 unless $OldEvent
1518 0 0 if $href eq $dest
1537 0 0 unless ($Day)
1541 0 0 unless ($WeekDayNames{$Day})
1545 0 0 if ($Count)
1546 0 0 unless ($Count >= -53 and $Count <= 53)
1552 0 0 $Count ? :
1560 0 0 unless (defined $byDay)
1564 0 0 unless (ref $byDay eq 'HASH')
1569 0 0 unless ($Day)
1573 0 0 if $byDay->{'nthOfPeriod'}
1587 0 0 unless $HasTime
1590 0 0 if $TZStr
1591 0 0 if $TargetTz
1605 0 0 wantarray ? :
1619 0 0 if (lc($VItem->{'params'}{'value'}[0] || '') eq 'period')
1637 0 0 if defined $updated
1643 0 0 unless $uid
1644 0 0 if $uid =~ /\s/
1645 0 0 if $uid =~ /[\x7f-\xff]/
1654 0 0 unless $id
1656 0 0 if $id eq ''
1664 0 0 if $VAttendee->{'params'}{'cutype'}
1667 0 0 if ($VAttendee->{'params'}{'partstat'})
1670 0 0 if ($VAttendee->{'params'}{'role'})
1672 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'CHAIR'
1674 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'OPT-PARTICIPANT'
1676 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'NON-PARTICIPANT'
1678 0 0 if ($VAttendee->{'params'}{'rsvp'})
1679 0 0 lc($VAttendee->{'params'}{'rsvp'}[0] // '') eq 'yes' ? :
1681 0 0 if (exists $VAttendee->{'params'}{'x-dtstamp'})
1683 0 0 if $Date
1687 0 0 if (exists $VAttendee->{'params'}{'x-sequence'})
1703 0 0 unless $w or $d or $H or $M or $S
1706 0 0 if $w
1707 0 0 if $d
1708 0 0 if (not $IsAllDay and $H || $M || $S)
1710 0 0 if $H
1711 0 0 if $M
1712 0 0 if $S
1734 0 0 unless $Spec->{$key}
1738 0 0 if ($Spec->{$key}[1] eq 'object') { }
0 0 elsif ($Spec->{$key}[1] eq 'bool') { }
0 0 elsif ($Spec->{$key}[1] eq 'mailto') { }
1740 0 0 unless $Item
1741 0 0 if ($Spec->{$key}[0]) { }
1749 0 0 if !!$Spec->{$key}[3] == !!$Copy{$key}
1752 0 0 if $Copy{$key}
1755 0 0 if _safeeq($Spec->{$key}[3], $Copy{$key})
1781 0 0 unless my $CalendarData = eval { do { vcard2hash($VCalendar, 'multival', ['rrule'], 'only_one', 1) } }
1786 0 0 unless $CalendarData->{'objects'}
1787 0 0 unless lc $Calendar->{'type'} eq 'vcalendar'
1792 0 0 unless $Calendar->{'objects'}
1793 0 0 unless lc $VEvent->{'type'} eq 'vevent'
1806 0 0 unless _saneuid($uid)
1812 0 0 unless defined $Properties{$Property}{'value'}
1819 0 0 if defined $Properties{'description'}{'value'}
1827 0 0 unless defined $Properties{'dtstart'}{'value'}
1831 0 0 if (defined $Properties{'dtend'}{'value'}) { }
0 0 elsif (defined $Properties{'duration'}{'value'}) { }
1832 0 0 if (defined $Properties{'duration'}{'value'})
1848 0 0 if ('DateTime'->compare($Start, $End) > 0)
1854 0 0 if ($IsAllDay and $StartTimeZone)
1866 0 0 if (exists $Properties{'rrule'})
1871 0 0 unless defined $Value
1878 0 0 if (exists $RRULE{'freq'}) { }
1880 0 0 unless (grep {$_ eq $freq;} @Frequencies)
1891 0 0 if (exists $RRULE{'interval'})
1892 0 0 unless ($RRULE{'interval'} =~ /^\d+$/)
1897 0 0 if ($interval == 0)
1902 0 0 if ($interval > 1)
1907 0 0 if (exists $RRULE{'rscale'})
1909 0 0 if $RRULE{'skip'}
1912 0 0 if (exists $RRULE{'wkst'})
1914 0 0 unless ($WeekDayNames{$wkst})
1919 0 0 if ($wkst ne 'mo')
1924 0 0 if (exists $RRULE{'byday'})
1931 0 0 if @byDays
1934 0 0 if (exists $RRULE{'bymonth'})
1936 0 0 unless ($BYMONTH =~ /^\d+L?$/)
1944 0 0 if (exists $RRULE{'count'})
1945 0 0 if (exists $RRULE{'until'})
1951 0 0 unless ($RRULE{'count'} =~ /^\d+$/)
1958 0 0 if (exists $RRULE{'until'})
1970 0 0 if (defined $RRULE{$Property})
1973 0 0 $RecurrenceProperties{$Property}{'signed'} ? :
1976 0 0 unless ($Value =~ /^$Valid$/)
1980 0 0 unless ($Value >= $Min and $Value <= $RecurrenceProperties{$Property}{'max'})
1993 0 0 if (exists $VEvent->{'properties'}{'exdate'})
2001 0 0 if ($VEvent->{'properties'}{'rdate'})
2013 0 0 unless $VEvent->{'objects'}
2014 0 0 unless lc $VAlarm->{'type'} eq 'valarm'
2025 0 0 unless $AlarmAction
2029 0 0 if ($AlarmAction eq 'display') { }
0 0 elsif ($AlarmAction eq 'email') { }
0 0 elsif ($AlarmAction eq 'uri') { }
0 0 elsif ($AlarmAction eq 'audio') { }
0 0 elsif ($AlarmAction eq 'none') { }
2056 0 0 if ($AlarmProperties{'acknowledged'})
2064 0 0 lc($AlarmProperties{'trigger'}{'params'}{'related'}[0] || '') eq 'end' ? :
2069 0 0 if ($Trigger =~ /^[+-]?P/i) { }
2075 0 0 $Related eq 'end' ? :
2078 0 0 if ($Duration->is_negative) { }
2097 0 0 unless $VEvent->{'properties'}{'organizer'}
2100 0 0 unless $VEvent->{'properties'}{'attendee'}
2109 0 0 unless $VEvent->{'properties'}{'attach'}
2110 0 0 unless $Attach->{'value'}
2111 0 0 unless grep {$Attach->{'value'} =~ m[^$_://];} 'http', 'https', 'ftp'
2117 0 0 unless (defined $mime)
2120 0 0 if $MimeTypeObj
2125 0 0 defined $filename ? :
0 0 defined $mime ? :
0 0 defined $size ? :
2133 0 0 unless $VEvent->{'properties'}{'url'}
2135 0 0 unless $uri
2145 0 0 if ($Properties{'created'}{'value'})
2148 0 0 if $Date
2150 0 0 if ($Properties{'dtstamp'}{'value'})
2153 0 0 if $Date
2156 0 0 if $Properties{'sequence'}
2157 0 0 if $method
2160 0 0 if $Properties{'summary'}
2161 0 0 if @description
2163 0 0 if %Links
2165 0 0 if ($Properties{'description'} and $Properties{'description'}{'params'}{'language'})
2168 0 0 if ($Properties{'summary'} and $Properties{'summary'}{'params'}{'language'})
2171 0 0 if $language
2176 0 0 if ($Properties{'location'}{'value'})
2179 0 0 if (not $IsAllDay and $StartTimeZone and $StartTimeZone ne $EndTimeZone)
2184 0 0 $IsAllDay ? :
2185 0 0 if ref $Start
2186 0 0 unless $IsAllDay
2188 0 0 if $duration
2190 0 0 if %Recurrence
2191 0 0 if %Overrides
2194 0 0 if ($Properties{'status'}{'value'})
2195 0 0 if lc $Properties{'status'}{'value'} ne 'confirmed'
2197 0 0 if ($Properties{'transp'}{'value'})
2198 0 0 if lc $Properties{'transp'}{'value'} eq 'transparent'
2201 0 0 if grep {$_ eq 'owner';} @{$Participants{$email}{'roles'};}
2203 0 0 if %Participants
2207 0 0 if %Alerts
2209 0 0 if ($Properties{'lastmodified'}{'value'})
2214 0 0 if ($Properties{'recurrence-id'}{'value'})
2232 0 0 if ($Element->{'value'} =~ /Z$/)
2238 0 0 unless $TZID
2240 0 0 if exists $Self->{'_tznamemap'}{$TZID}
2244 0 0 unless $Calendar->{'objects'}
2245 0 0 unless lc $VTimeZone->{'type'} eq 'vtimezone'
2246 0 0 unless ($VTimeZone->{'properties'}{'tzid'}[0]{'value'} || '') eq $TZID
2248 0 0 unless $VTimeZone->{'objects'}
2249 0 0 unless grep {(lc $Observance->{'type'} || '') eq $_;} 'standard', 'daylight'
2250 0 0 unless defined $Observance->{'properties'}{'tzoffsetto'}[0]{'value'}
2257 0 0 unless exists $TzOffsets{'standard'}
2276 0 0 unless $isoDate =~ /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(Z?)$/i
2277 0 0 if $7
2279 0 0 unless my $Date = 'DateTime'->_new('year', $1, 'month', $2, 'day', $3, 'hour', $4, 'minute', $5, 'second', $6, 'time_zone', $timeZone, 'locale', $LOCALE)
2300 0 0 if ($vDate =~ /^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)(\.\d+)?(Z?)$/i)
2301 0 0 $8 eq 'Z' ? :
0 0 unless my $Date = 'DateTime'->_new('year', $1, 'month', $2, 'day', $3, 'hour', $4, 'minute', $5, 'second', $6, 'time_zone', $8 eq 'Z' ? $UTC : $FLOATING, 'locale', $LOCALE)
2316 0 0 if ($vDate =~ /^(\d\d\d\d)(\d\d)(\d\d)$/)
2318 0 0 unless my $Date = 'DateTime'->_new('year', $1, 'month', $2, 'day', $3, 'time_zone', $FLOATING, 'locale', $LOCALE)
2347 0 0 if ($IsAllDay)
2352 0 0 unless ($tz)
2357 0 0 if ($UTCLinks{$tz})
2379 0 0 if $IsAllDay
2381 0 0 unless ($tz)
2386 0 0 if ($tz =~ /UTC/i)
2410 0 0 $Args->{'showAsFree'} ? :
2413 0 0 if ($recurrenceData)
2421 0 0 if $Prop eq ''
2423 0 0 if exists $Args->{'locale'}
2425 0 0 if $Property eq 'title'
2430 0 0 if $Args->{'created'}
2437 0 0 if ($locations->{$id}{'rel'} and $locations->{'id'}{'rel'} eq 'end')
2440 0 0 if ($locations->{$id}{'name'})
2448 0 0 if ($Args->{'duration'})
2451 0 0 if $Duration
2455 0 0 if ($Args->{'recurrenceRule'})
2467 0 0 if ($Args->{'recurrenceOverrides'})
2470 0 0 if ($val) { }
2471 0 0 if (keys %$val) { }
2485 0 0 if ($Args->{'alerts'})
2493 0 0 $Alert->{'relativeTo'} =~ /before/ ? :
2494 0 0 $Alert->{'relativeTo'} =~ /end/ ? :
2495 0 0 $Alert->{'relativeTo'} =~ /end/ ? :
2500 0 0 if ($Type eq 'display') { }
0 0 elsif ($Type eq 'email' or $Type eq 'uri') { }
2502 0 0 $Sign eq '-' ? :
2511 0 0 if ($Sign eq '-') { }
2533 0 0 if ($Type eq 'uri')
2543 0 0 if $Alert->{'relativeTo'} =~ /end/
2545 0 0 if ($Alert->{'action'}{'acknowledged'})
2554 0 0 if ($Args->{'participants'})
2561 0 0 if ($Attendee->{'name'})
2566 0 0 unless grep {$_ eq 'attendee';} @{$$Attendee{'roles'};}
2568 0 0 if defined $Attendee->{'kind'}
2569 0 0 if defined $Attendee->{'scheduleRSVP'}
2570 0 0 if defined $Attendee->{'x-sequence'}
2571 0 0 if defined $Attendee->{'scheduleUpdated'}
2573 0 0 if $AttendeeProps{$prop} eq ''
2575 0 0 if (grep {$_ eq 'chair';} @{$$Attendee{'roles'};}) { }
0 0 elsif ($Attendee->{'schedulePriority'} and $Attendee->{'schedulePriority'} eq 'optional') { }
0 0 elsif ($Attendee->{'schedulePriority'} and $Attendee->{'schedulePriority'} eq 'non-participant') { }
2586 0 0 if $Attendee->{'scheduleStatus'}
2591 0 0 if ($Args->{'replyTo'})
2592 0 0 if ($Args->{'replyTo'}{'imip'})
2594 0 0 $CN ? :
2598 0 0 if ($Args->{'links'})
2602 0 0 if ($Attach->{'rel'} and $Attach->{'rel'} eq 'enclosure') { }
2608 0 0 if defined $Mime
2609 0 0 if defined $Size
2610 0 0 if defined $FileName
2621 0 0 unless $Args->{'replyTo'} and not $Args->{'participants'}
2641 0 0 ref $Item eq 'ARRAY' ? :
2642 0 0 if (not $havepid and $Args->{'prodId'})
2654 0 0 unless $VTimeZone
2674 0 0 unless (ref $Args eq 'HASH')
2678 0 0 if ($Args->{'frequency'}) { }
2679 0 0 unless (grep {$_ eq $Args->{'frequency'};} @Frequencies)
2689 0 0 if (defined $Args->{'interval'})
2690 0 0 unless ($Args->{'interval'} =~ /^\d+$/)
2694 0 0 if ($Args->{'interval'} == 0)
2698 0 0 if ($Args->{'interval'} > 1)
2703 0 0 if (defined $Args->{'firstDayOfWeek'})
2704 0 0 unless (exists $DaysByIndex{$Args->{'firstDayOfWeek'}})
2708 0 0 unless ($Args->{'firstDayOfWeek'} == 1)
2713 0 0 if ($Args->{'byDay'})
2714 0 0 unless (ref $Args->{'byDay'} eq 'ARRAY')
2718 0 0 unless (@{$Args->{'byDay'};})
2725 0 0 if ($Args->{'byMonth'})
2726 0 0 unless (ref $Args->{'byMonth'} eq 'ARRAY')
2730 0 0 unless (@{$Args->{'byMonth'};})
2737 0 0 unless ($byMonth =~ /^(\d+)L?$/i)
2741 0 0 unless ($monthNum >= 1 and $monthNum <= 13)
2752 0 0 if (defined $Args->{'count'})
2753 0 0 if (defined $Args->{'until'})
2757 0 0 unless ($Args->{'count'} =~ /^\d+$/)
2764 0 0 if ($Args->{'until'})
2767 0 0 if ($IsAllDay) { }
2785 0 0 if ($Args->{$Name})
2786 0 0 unless (ref $Args->{$Name} eq 'ARRAY')
2790 0 0 unless (@{$Args->{$Name};})
2798 0 0 $RecurrenceProperties{$Property}{'signed'} ? :
2801 0 0 unless ($Value =~ /^$Valid$/)
2805 0 0 unless ($Min <= $Value and $Value <= $RecurrenceProperties{$Property}{'max'})
2844 0 0 if $MustBeTopLevel{$Key}
2845 0 0 if ($Key eq 'start')
2847 0 0 if _safeeq($Recurrence->{'start'}, $recurrenceId)
2851 0 0 if _safeeq($Recurrence->{$Key}, $Event->{$Key})
2856 0 0 if $MustBeTopLevel{$Key}
2861 0 0 unless %override
2878 0 0 if ($Event->{'_recurrenceObj'}) { }
0 0 elsif ($map{$uid}) { }
2896 0 0 unless ($map{$uid})
2906 0 0 unless $First->{'isAllDay'}
2908 0 0 if exists $First->{$key}
2913 0 0 if ($SubEvent->{'_recurrenceObj'})
2915 0 0 if $map{$uid}{'timeZone'}
2936 0 0 if (not $AddressSet or $AddressSet ne 'mailto:' . $NewAddressSet or not $DisplayName or $DisplayName ne $NewDisplayName)
2968 0 0 unless $calendarId
2972 0 0 unless $calendarId eq $Cal->{'id'}
2973 0 0 $isFreeBusy ? :
2976 0 0 if @$Errors
3008 0 0 if ($ENV{'JMAP_ALWAYS_FULL'} or ref $New ne 'HASH' or ref $Old or 'HASH')
3018 0 0 if _safeeq($New->{$Key}, $Old->{$Key})
3026 0 0 if (length &encode_json($New) < length &encode_json(\%subover)) { }
3039 0 0 unless $path =~ s[^([^/]+)(/?)][]
3040 0 0 unless ref $hash eq 'HASH'
3044 0 0 if ($slash) { }
0 0 elsif (defined $value) { }
3085 0 0 unless $exception