Branch Coverage

blib/lib/Net/CalDAVTalk.pm
Criterion Covered Total %
branch 1 794 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 $Report and ref $Report eq 'ARRAY'
709 0 0 if $$item{"{$NS_D}report"}{"{$NS_D}sync-collection"}
714 0 0 unless $Type and ref $Type eq 'ARRAY'
716 0 0 unless $item->{'@content-type'}
717 0 0 if $item->{'@content-type'}{'content'} eq 'application/event+json'
721 0 0 $Privileges{'mayWrite'} ? :
725 0 0 unless $ace and ref $ace eq 'ARRAY'
727 0 0 if $$Acl{"{$NS_D}protected"}
728 0 0 unless $$Acl{"{$NS_D}grant"}
729 0 0 unless $$Acl{"{$NS_D}grant"}{"{$NS_D}privilege"}
730 0 0 unless ref $$Acl{"{$NS_D}grant"}{"{$NS_D}privilege"} eq 'ARRAY'
733 0 0 unless $user =~ m[^/dav/principals/user/([^/]+)]
735 0 0 if $email eq 'admin'
744 0 0 if $$item{"{$NS_CY}admin"}
745 0 0 if $$item{"{$NS_D}write-content"}
746 0 0 if $$item{"{$NS_D}read"}
747 0 0 if $$item{"{$NS_C}read-free-busy"}
761 0 0 @ShareWith ? :
0 0 $CanSync ? :
0 0 $CanEvent ? :
795 0 0 unless (ref $Args eq 'HASH')
814 0 0 if (exists $Args->{'isVisible'})
815 0 0 $Args->{'isVisible'} ? :
818 0 0 if (exists $Args->{'color'})
822 0 0 if (exists $Args->{'timeZone'})
826 0 0 if (exists $Args->{'precedence'})
827 0 0 unless (($Args->{'precedence'} // '') =~ /^\d+$/)
857 0 0 unless (ref $Args eq 'HASH')
864 0 0 unless ($calendarId)
870 0 0 if (defined $Calendar{'name'})
874 0 0 if (defined $Calendar{'color'})
878 0 0 if (exists $Args->{'timeZone'})
882 0 0 if (exists $Calendar{'isVisible'})
883 0 0 $Calendar{'isVisible'} ? :
886 0 0 if (exists $Calendar{'precedence'})
887 0 0 unless (($Calendar{'precedence'} || '') =~ /^\d+$/)
894 0 0 unless @Params
926 0 0 unless $Event
928 0 0 unless ref $Event eq 'HASH'
965 0 0 wantarray ? :
991 0 0 unless $calendarId
996 0 0 $key =~ /:/ ? :
1001 0 0 if ($Args{'ContentType'})
1004 0 0 if ($Args{'Version'})
1029 0 0 unless $$Response{"{$NS_D}response"}
1031 0 0 unless $href
1032 0 0 unless $$Response{"{$NS_D}propstat"}
1037 0 0 unless $Data
1041 0 0 if ($Prop->{'-content-type'} and $Prop->{'-content-type'} =~ m[application/event\+json]) { }
1050 0 0 if ($@)
1054 0 0 unless $Event
1056 0 0 if ($Args{'Full'})
1066 0 0 if ($key =~ /(.*):(.*)/)
1071 0 0 unless $AData
1080 0 0 wantarray ? :
1097 0 0 unless $calendarId
1100 0 0 if ($Args{'AlwaysRange'} or $Args{'after'} or $Args{'before'})
1132 0 0 unless $$Response{"{$NS_D}response"}
1134 0 0 unless $href
1135 0 0 unless $$Response{"{$NS_D}propstat"}
1159 0 0 if @$Errors
1160 0 0 if @$Events > 1
1179 0 0 unless $calendarId
1182 0 0 if ($Args{'AlwaysRange'} or $Args{'after'} or $Args{'before'})
1204 0 0 unless my $Data = eval { do { vcard2hash($Response->{'content'}, 'multival', ['rrule'], 'only_one', 1) } }
1211 0 0 unless $item->{'type'} eq 'vfreebusy'
1216 0 0 if ($End =~ /^[+-]?P/i) { }
1228 0 0 $IsAllDay ? :
1236 0 0 $NewEvent->{'isAllDay'} ? :
1269 0 0 wantarray ? :
1296 0 0 unless $calendarId
1302 0 0 $Args{'syncToken'} ? :
1315 0 0 unless $SyncToken
1318 0 0 unless $$Response{"{$NS_D}response"}
1320 0 0 unless $href
1322 0 0 unless ($$Response{"{$NS_D}propstat"})
1327 0 0 unless $$Response{"{$NS_D}propstat"}
1329 0 0 if ($status =~ / 200 /) { }
1362 0 0 unless $calendarId
1364 0 0 unless ref $Args eq 'HASH'
1369 0 0 unless (exists $Args->{'sequence'})
1373 0 0 if ($Args->{'exceptions'})
1376 0 0 unless $val
1377 0 0 if exists $val->{'sequence'}
1389 0 0 if ($UseEvent) { }
1424 0 0 if ($UseEvent) { }
1450 0 0 unless $OldEvent
1456 0 0 if (exists $Args->{$Property}) { }
0 0 elsif (exists $OldEvent->{$Property}) { }
1457 0 0 if (defined $Args->{$Property})
1467 0 0 unless (exists $Args->{'sequence'})
1471 0 0 if ($NewEvent{'exceptions'})
1474 0 0 unless $val
1475 0 0 if exists $val->{'sequence'}
1479 0 0 if ($old and exists $old->{'sequence'})
1480 0 0 unless $sequence > $old->{'sequence'}
1503 0 0 unless $OldEvent
1509 0 0 $key =~ /:/ ? :
1510 0 0 if (defined $Args->{$key}) { }
1519 0 0 if @Set
1520 0 0 if @Remove
1521 0 0 unless @Params
1543 0 0 unless $OldEvent
1547 0 0 if $href eq $dest
1566 0 0 unless ($Day)
1570 0 0 unless ($WeekDayNames{$Day})
1574 0 0 if ($Count)
1575 0 0 unless ($Count >= -53 and $Count <= 53)
1581 0 0 $Count ? :
1589 0 0 unless (defined $byDay)
1593 0 0 unless (ref $byDay eq 'HASH')
1598 0 0 unless ($Day)
1602 0 0 if $byDay->{'nthOfPeriod'}
1616 0 0 unless $HasTime
1619 0 0 if $TZStr
1620 0 0 if $TargetTz
1634 0 0 wantarray ? :
1648 0 0 if (lc($VItem->{'params'}{'value'}[0] || '') eq 'period')
1666 0 0 if defined $updated
1672 0 0 unless $uid
1673 0 0 if $uid =~ /\s/
1674 0 0 if $uid =~ /[\x7f-\xff]/
1683 0 0 unless $id
1685 0 0 if $id eq ''
1693 0 0 if $VAttendee->{'params'}{'cutype'}
1696 0 0 if ($VAttendee->{'params'}{'partstat'})
1699 0 0 if ($VAttendee->{'params'}{'role'})
1701 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'CHAIR'
1703 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'OPT-PARTICIPANT'
1705 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'NON-PARTICIPANT'
1707 0 0 if ($VAttendee->{'params'}{'rsvp'})
1708 0 0 lc($VAttendee->{'params'}{'rsvp'}[0] // '') eq 'yes' ? :
1710 0 0 if (exists $VAttendee->{'params'}{'x-dtstamp'})
1712 0 0 if $Date
1716 0 0 if (exists $VAttendee->{'params'}{'x-sequence'})
1732 0 0 unless $w or $d or $H or $M or $S
1735 0 0 if $w
1736 0 0 if $d
1737 0 0 if (not $IsAllDay and $H || $M || $S)
1739 0 0 if $H
1740 0 0 if $M
1741 0 0 if $S
1763 0 0 unless $Spec->{$key}
1767 0 0 if ($Spec->{$key}[1] eq 'object') { }
0 0 elsif ($Spec->{$key}[1] eq 'bool') { }
0 0 elsif ($Spec->{$key}[1] eq 'mailto') { }
1769 0 0 unless $Item
1770 0 0 if ($Spec->{$key}[0]) { }
1778 0 0 if !!$Spec->{$key}[3] == !!$Copy{$key}
1781 0 0 if $Copy{$key}
1784 0 0 if _safeeq($Spec->{$key}[3], $Copy{$key})
1810 0 0 unless my $CalendarData = eval { do { vcard2hash($VCalendar, 'multival', ['rrule'], 'only_one', 1) } }
1815 0 0 unless $CalendarData->{'objects'}
1816 0 0 unless lc $Calendar->{'type'} eq 'vcalendar'
1821 0 0 unless $Calendar->{'objects'}
1822 0 0 unless lc $VEvent->{'type'} eq 'vevent'
1835 0 0 unless _saneuid($uid)
1841 0 0 unless defined $Properties{$Property}{'value'}
1848 0 0 if defined $Properties{'description'}{'value'}
1856 0 0 unless defined $Properties{'dtstart'}{'value'}
1860 0 0 if (defined $Properties{'dtend'}{'value'}) { }
0 0 elsif (defined $Properties{'duration'}{'value'}) { }
1861 0 0 if (defined $Properties{'duration'}{'value'})
1877 0 0 if ('DateTime'->compare($Start, $End) > 0)
1883 0 0 if ($IsAllDay and $StartTimeZone)
1895 0 0 if (exists $Properties{'rrule'})
1900 0 0 unless defined $Value
1907 0 0 if (exists $RRULE{'freq'}) { }
1909 0 0 unless (grep {$_ eq $freq;} @Frequencies)
1919 0 0 if (exists $RRULE{'interval'})
1920 0 0 unless ($RRULE{'interval'} =~ /^\d+$/)
1925 0 0 if ($interval == 0)
1930 0 0 if ($interval > 1)
1935 0 0 if (exists $RRULE{'rscale'})
1937 0 0 if $RRULE{'skip'}
1940 0 0 if (exists $RRULE{'wkst'})
1942 0 0 unless ($WeekDayNames{$wkst})
1947 0 0 if ($wkst ne 'mo')
1952 0 0 if (exists $RRULE{'byday'})
1959 0 0 if @byDays
1962 0 0 if (exists $RRULE{'bymonth'})
1964 0 0 unless ($BYMONTH =~ /^\d+L?$/)
1972 0 0 if (exists $RRULE{'count'})
1973 0 0 if (exists $RRULE{'until'})
1979 0 0 unless ($RRULE{'count'} =~ /^\d+$/)
1986 0 0 if (exists $RRULE{'until'})
1998 0 0 if (defined $RRULE{$Property})
2001 0 0 $RecurrenceProperties{$Property}{'signed'} ? :
2004 0 0 unless ($Value =~ /^$Valid$/)
2008 0 0 unless ($Value >= $Min and $Value <= $RecurrenceProperties{$Property}{'max'})
2021 0 0 if (exists $VEvent->{'properties'}{'exdate'})
2029 0 0 if ($VEvent->{'properties'}{'rdate'})
2041 0 0 unless $VEvent->{'objects'}
2042 0 0 unless lc $VAlarm->{'type'} eq 'valarm'
2053 0 0 unless $AlarmAction
2057 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') { }
2084 0 0 if ($AlarmProperties{'acknowledged'})
2092 0 0 lc($AlarmProperties{'trigger'}{'params'}{'related'}[0] || '') eq 'end' ? :
2097 0 0 if ($Trigger =~ /^[+-]?P/i) { }
2103 0 0 $Related eq 'end' ? :
2106 0 0 if ($Duration->is_negative) { }
2125 0 0 unless $VEvent->{'properties'}{'organizer'}
2128 0 0 unless $VEvent->{'properties'}{'attendee'}
2137 0 0 unless $VEvent->{'properties'}{'attach'}
2138 0 0 unless $Attach->{'value'}
2139 0 0 unless grep {$Attach->{'value'} =~ m[^$_://];} 'http', 'https', 'ftp'
2145 0 0 unless (defined $mime)
2148 0 0 if $MimeTypeObj
2153 0 0 defined $filename ? :
0 0 defined $mime ? :
0 0 defined $size ? :
2161 0 0 unless $VEvent->{'properties'}{'url'}
2163 0 0 unless $uri
2173 0 0 if ($Properties{'created'}{'value'})
2176 0 0 if $Date
2178 0 0 if ($Properties{'dtstamp'}{'value'})
2181 0 0 if $Date
2184 0 0 if $Properties{'sequence'}
2185 0 0 if $method
2188 0 0 if $Properties{'summary'}
2189 0 0 if @description
2191 0 0 if %Links
2193 0 0 if ($Properties{'description'} and $Properties{'description'}{'params'}{'language'})
2196 0 0 if ($Properties{'summary'} and $Properties{'summary'}{'params'}{'language'})
2199 0 0 if $language
2204 0 0 if ($Properties{'location'}{'value'})
2207 0 0 if (not $IsAllDay and $StartTimeZone and $StartTimeZone ne $EndTimeZone)
2212 0 0 $IsAllDay ? :
2213 0 0 if ref $Start
2214 0 0 unless $IsAllDay
2216 0 0 if $duration
2218 0 0 if %Recurrence
2219 0 0 if %Overrides
2222 0 0 if ($Properties{'status'}{'value'})
2223 0 0 if lc $Properties{'status'}{'value'} ne 'confirmed'
2225 0 0 if ($Properties{'transp'}{'value'})
2226 0 0 if lc $Properties{'transp'}{'value'} eq 'transparent'
2229 0 0 if grep {$_ eq 'owner';} @{$Participants{$email}{'roles'};}
2231 0 0 if %Participants
2235 0 0 if %Alerts
2237 0 0 if ($Properties{'lastmodified'}{'value'})
2242 0 0 if ($Properties{'recurrence-id'}{'value'})
2260 0 0 if ($Element->{'value'} =~ /Z$/)
2266 0 0 unless $TZID
2268 0 0 if exists $Self->{'_tznamemap'}{$TZID}
2272 0 0 unless $Calendar->{'objects'}
2273 0 0 unless lc $VTimeZone->{'type'} eq 'vtimezone'
2274 0 0 unless ($VTimeZone->{'properties'}{'tzid'}[0]{'value'} || '') eq $TZID
2276 0 0 unless $VTimeZone->{'objects'}
2277 0 0 unless grep {(lc $Observance->{'type'} || '') eq $_;} 'standard', 'daylight'
2278 0 0 unless defined $Observance->{'properties'}{'tzoffsetto'}[0]{'value'}
2285 0 0 unless exists $TzOffsets{'standard'}
2304 0 0 unless $isoDate =~ /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(Z?)$/i
2305 0 0 if $7
2307 0 0 unless my $Date = 'DateTime'->_new('year', $1, 'month', $2, 'day', $3, 'hour', $4, 'minute', $5, 'second', $6, 'time_zone', $timeZone, 'locale', $LOCALE)
2328 0 0 if ($vDate =~ /^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)(\.\d+)?(Z?)$/i)
2329 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)
2344 0 0 if ($vDate =~ /^(\d\d\d\d)(\d\d)(\d\d)$/)
2346 0 0 unless my $Date = 'DateTime'->_new('year', $1, 'month', $2, 'day', $3, 'time_zone', $FLOATING, 'locale', $LOCALE)
2375 0 0 if ($IsAllDay)
2380 0 0 unless ($tz)
2385 0 0 if ($UTCLinks{$tz})
2407 0 0 if $IsAllDay
2409 0 0 unless ($tz)
2414 0 0 if ($tz =~ /UTC/i)
2438 0 0 $Args->{'showAsFree'} ? :
2441 0 0 if ($recurrenceData)
2449 0 0 if $Prop eq ''
2451 0 0 if exists $Args->{'locale'}
2453 0 0 if $Property eq 'title'
2458 0 0 if $Args->{'created'}
2465 0 0 if ($locations->{$id}{'rel'} and $locations->{'id'}{'rel'} eq 'end')
2468 0 0 if ($locations->{$id}{'name'})
2476 0 0 if ($Args->{'duration'})
2479 0 0 if $Duration
2483 0 0 if ($Args->{'recurrenceRule'})
2495 0 0 if ($Args->{'recurrenceOverrides'})
2498 0 0 if ($val) { }
2499 0 0 if (keys %$val) { }
2513 0 0 if ($Args->{'alerts'})
2521 0 0 $Alert->{'relativeTo'} =~ /before/ ? :
2522 0 0 $Alert->{'relativeTo'} =~ /end/ ? :
2523 0 0 $Alert->{'relativeTo'} =~ /end/ ? :
2528 0 0 if ($Type eq 'display') { }
0 0 elsif ($Type eq 'email' or $Type eq 'uri') { }
2530 0 0 $Sign eq '-' ? :
2539 0 0 if ($Sign eq '-') { }
2561 0 0 if ($Type eq 'uri')
2571 0 0 if $Alert->{'relativeTo'} =~ /end/
2573 0 0 if ($Alert->{'action'}{'acknowledged'})
2582 0 0 if ($Args->{'participants'})
2589 0 0 if ($Attendee->{'name'})
2594 0 0 unless grep {$_ eq 'attendee';} @{$$Attendee{'roles'};}
2596 0 0 if defined $Attendee->{'kind'}
2597 0 0 if defined $Attendee->{'scheduleRSVP'}
2598 0 0 if defined $Attendee->{'x-sequence'}
2599 0 0 if defined $Attendee->{'scheduleUpdated'}
2601 0 0 if $AttendeeProps{$prop} eq ''
2603 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') { }
2614 0 0 if $Attendee->{'scheduleStatus'}
2619 0 0 if ($Args->{'replyTo'})
2620 0 0 if ($Args->{'replyTo'}{'imip'})
2622 0 0 $CN ? :
2626 0 0 if ($Args->{'links'})
2630 0 0 if ($Attach->{'rel'} and $Attach->{'rel'} eq 'enclosure') { }
2636 0 0 if defined $Mime
2637 0 0 if defined $Size
2638 0 0 if defined $FileName
2649 0 0 unless $Args->{'replyTo'} and not $Args->{'participants'}
2669 0 0 ref $Item eq 'ARRAY' ? :
2670 0 0 if (not $havepid and $Args->{'prodId'})
2682 0 0 unless $VTimeZone
2702 0 0 unless (ref $Args eq 'HASH')
2706 0 0 if ($Args->{'frequency'}) { }
2707 0 0 unless (grep {$_ eq $Args->{'frequency'};} @Frequencies)
2717 0 0 if (defined $Args->{'interval'})
2718 0 0 unless ($Args->{'interval'} =~ /^\d+$/)
2722 0 0 if ($Args->{'interval'} == 0)
2726 0 0 if ($Args->{'interval'} > 1)
2731 0 0 if (defined $Args->{'firstDayOfWeek'})
2732 0 0 unless (exists $DaysByIndex{$Args->{'firstDayOfWeek'}})
2736 0 0 unless ($Args->{'firstDayOfWeek'} == 1)
2741 0 0 if ($Args->{'byDay'})
2742 0 0 unless (ref $Args->{'byDay'} eq 'ARRAY')
2746 0 0 unless (@{$Args->{'byDay'};})
2753 0 0 if ($Args->{'byMonth'})
2754 0 0 unless (ref $Args->{'byMonth'} eq 'ARRAY')
2758 0 0 unless (@{$Args->{'byMonth'};})
2765 0 0 unless ($byMonth =~ /^(\d+)L?$/i)
2769 0 0 unless ($monthNum >= 1 and $monthNum <= 13)
2780 0 0 if (defined $Args->{'count'})
2781 0 0 if (defined $Args->{'until'})
2785 0 0 unless ($Args->{'count'} =~ /^\d+$/)
2792 0 0 if ($Args->{'until'})
2795 0 0 if ($IsAllDay) { }
2813 0 0 if ($Args->{$Name})
2814 0 0 unless (ref $Args->{$Name} eq 'ARRAY')
2818 0 0 unless (@{$Args->{$Name};})
2826 0 0 $RecurrenceProperties{$Property}{'signed'} ? :
2829 0 0 unless ($Value =~ /^$Valid$/)
2833 0 0 unless ($Min <= $Value and $Value <= $RecurrenceProperties{$Property}{'max'})
2872 0 0 if $MustBeTopLevel{$Key}
2873 0 0 if ($Key eq 'start')
2875 0 0 if _safeeq($Recurrence->{'start'}, $recurrenceId)
2879 0 0 if _safeeq($Recurrence->{$Key}, $Event->{$Key})
2884 0 0 if $MustBeTopLevel{$Key}
2889 0 0 unless %override
2906 0 0 if ($Event->{'_recurrenceObj'}) { }
0 0 elsif ($map{$uid}) { }
2924 0 0 unless ($map{$uid})
2934 0 0 unless $First->{'isAllDay'}
2936 0 0 if exists $First->{$key}
2941 0 0 if ($SubEvent->{'_recurrenceObj'})
2943 0 0 if $map{$uid}{'timeZone'}
2964 0 0 if (not $AddressSet or $AddressSet ne 'mailto:' . $NewAddressSet or not $DisplayName or $DisplayName ne $NewDisplayName)
2996 0 0 unless $calendarId
3000 0 0 unless $calendarId eq $Cal->{'id'}
3001 0 0 $isFreeBusy ? :
3004 0 0 if @$Errors
3036 0 0 if ($ENV{'JMAP_ALWAYS_FULL'} or ref $New ne 'HASH' or ref $Old or 'HASH')
3046 0 0 if _safeeq($New->{$Key}, $Old->{$Key})
3054 0 0 if (length &encode_json($New) < length &encode_json(\%subover)) { }
3067 0 0 unless $path =~ s[^([^/]+)(/?)][]
3068 0 0 unless ref $hash eq 'HASH'
3072 0 0 if ($slash) { }
0 0 elsif (defined $value) { }
3113 0 0 unless $exception