Branch Coverage

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


line true false branch
31 4 0 unless grep {$_ eq $want;} @properties
511 0 0 unless defined $tzName
512 0 0 if $UTCLinks{$tzName}
513 0 0 unless (exists $Self->{'_tz'}{$tzName})
537 0 0 if ($@)
563 0 0 unless ($calendarId)
578 0 0 if $ColourNames{$color}
579 0 0 unless $color =~ /^\s*(\#[a-f0-9]{3,8})\s*$/
581 0 0 if length $color == 7
584 0 0 if ($color =~ /^#(.)(.)(.).?$/)
589 0 0 if (length $color == 9)
612 0 0 unless $Calendars and @$Calendars
650 0 0 unless $Args{'Properties'}
670 0 0 unless $$Response{"{$NS_D}response"}
671 0 0 unless $$Response{"{$NS_D}href"}{'content'}
679 0 0 unless $$Response{"{$NS_D}propstat"}
680 0 0 unless $$Propstat{"{$NS_D}prop"}{"{$NS_D}resourcetype"}{"{$NS_C}calendar"}
684 0 0 !defined($visData) || $visData ? :
694 0 0 unless $Priv and ref $Priv eq 'ARRAY'
696 0 0 if $$item{"{$NS_CY}admin"}
697 0 0 if $$item{"{$NS_D}write-content"}
698 0 0 if $$item{"{$NS_D}read"}
699 0 0 if $$item{"{$NS_C}read-free-busy"}
704 0 0 unless $Type and ref $Type eq 'ARRAY'
706 0 0 unless $item->{'@content-type'}
707 0 0 if $item->{'@content-type'}{'content'} eq 'application/event+json'
711 0 0 $Privileges{'mayWrite'} ? :
715 0 0 unless $ace and ref $ace eq 'ARRAY'
717 0 0 if $$Acl{"{$NS_D}protected"}
718 0 0 unless $$Acl{"{$NS_D}grant"}
719 0 0 unless $$Acl{"{$NS_D}grant"}{"{$NS_D}privilege"}
720 0 0 unless ref $$Acl{"{$NS_D}grant"}{"{$NS_D}privilege"} eq 'ARRAY'
723 0 0 unless $user =~ m[^/dav/principals/user/([^/]+)]
725 0 0 if $email eq 'admin'
734 0 0 if $$item{"{$NS_CY}admin"}
735 0 0 if $$item{"{$NS_D}write-content"}
736 0 0 if $$item{"{$NS_D}read"}
737 0 0 if $$item{"{$NS_C}read-free-busy"}
751 0 0 @ShareWith ? :
0 0 $CanEvent ? :
784 0 0 unless (ref $Args eq 'HASH')
803 0 0 if (exists $Args->{'isVisible'})
804 0 0 $Args->{'isVisible'} ? :
807 0 0 if (exists $Args->{'color'})
811 0 0 if (exists $Args->{'timeZone'})
815 0 0 if (exists $Args->{'precedence'})
816 0 0 unless (($Args->{'precedence'} // '') =~ /^\d+$/)
846 0 0 unless (ref $Args eq 'HASH')
853 0 0 unless ($calendarId)
859 0 0 if (defined $Calendar{'name'})
863 0 0 if (defined $Calendar{'color'})
867 0 0 if (exists $Args->{'timeZone'})
871 0 0 if (exists $Calendar{'isVisible'})
872 0 0 $Calendar{'isVisible'} ? :
875 0 0 if (exists $Calendar{'precedence'})
876 0 0 unless (($Calendar{'precedence'} || '') =~ /^\d+$/)
883 0 0 unless @Params
915 0 0 unless $Event
917 0 0 unless ref $Event eq 'HASH'
950 0 0 unless $calendarId
955 0 0 if ($Args{'href'}) { }
0 0 elsif ($Args{'AlwaysRange'} or $Args{'after'} or $Args{'before'}) { }
985 0 0 $key =~ /:/ ? :
992 0 0 if ($Args{'ContentType'})
995 0 0 if ($Args{'Version'})
1012 0 0 if $Args{'Raw'}
1019 0 0 unless $$Response{"{$NS_D}response"}
1021 0 0 unless $href
1022 0 0 unless $$Response{"{$NS_D}propstat"}
1025 0 0 unless $Data
1029 0 0 if ($Prop->{'-content-type'} and $Prop->{'-content-type'} =~ m[application/event\+json]) { }
1038 0 0 if ($@)
1042 0 0 unless $Event
1044 0 0 if ($Args{'Full'})
1054 0 0 if ($key =~ /(.*):(.*)/)
1059 0 0 unless $AData
1067 0 0 wantarray ? :
1085 0 0 if @$Errors
1086 0 0 if @$Events > 1
1105 0 0 unless $calendarId
1108 0 0 if ($Args{'AlwaysRange'} or $Args{'after'} or $Args{'before'})
1130 0 0 unless my $Data = eval { do { vcard2hash($Response->{'content'}, 'multival', ['rrule'], 'only_one', 1) } }
1137 0 0 unless $item->{'type'} eq 'vfreebusy'
1142 0 0 if ($End =~ /^[+-]?P/i) { }
1154 0 0 $IsAllDay ? :
1162 0 0 $NewEvent->{'isAllDay'} ? :
1189 0 0 unless $calendarId
1194 0 0 $key =~ /:/ ? :
1199 0 0 if ($Args{'ContentType'})
1202 0 0 if ($Args{'Version'})
1210 0 0 $Args{'syncToken'} ? :
1225 0 0 unless $$Response{"{$NS_D}response"}
1227 0 0 unless $href
1229 0 0 unless ($$Response{"{$NS_D}propstat"})
1234 0 0 unless $$Response{"{$NS_D}propstat"}
1236 0 0 if ($status =~ / 200 /) { }
1239 0 0 unless $Data
1243 0 0 if ($Prop->{'-content-type'} and $Prop->{'-content-type'} =~ m[application/event\+json]) { }
1252 0 0 if ($@)
1256 0 0 unless $Event
1258 0 0 if ($Args{'Full'})
1268 0 0 if ($key =~ /(.*):(.*)/)
1273 0 0 unless $AData
1285 0 0 wantarray ? :
1308 0 0 unless $calendarId
1310 0 0 unless ref $Args eq 'HASH'
1315 0 0 unless (exists $Args->{'sequence'})
1319 0 0 if ($Args->{'exceptions'})
1322 0 0 unless $val
1323 0 0 if exists $val->{'sequence'}
1335 0 0 if ($UseEvent) { }
1370 0 0 if ($UseEvent) { }
1396 0 0 unless $OldEvent
1402 0 0 if (exists $Args->{$Property}) { }
0 0 elsif (exists $OldEvent->{$Property}) { }
1403 0 0 if (defined $Args->{$Property})
1413 0 0 unless (exists $Args->{'sequence'})
1417 0 0 if ($NewEvent{'exceptions'})
1420 0 0 unless $val
1421 0 0 if exists $val->{'sequence'}
1425 0 0 if ($old and exists $old->{'sequence'})
1426 0 0 unless $sequence > $old->{'sequence'}
1449 0 0 unless $OldEvent
1455 0 0 $key =~ /:/ ? :
1456 0 0 if (defined $Args->{$key}) { }
1465 0 0 if @Set
1466 0 0 if @Remove
1467 0 0 unless @Params
1489 0 0 unless $OldEvent
1493 0 0 if $href eq $dest
1512 0 0 unless ($Day)
1516 0 0 unless ($WeekDayNames{$Day})
1520 0 0 if ($Count)
1521 0 0 unless ($Count >= -53 and $Count <= 53)
1527 0 0 $Count ? :
1535 0 0 unless (defined $byDay)
1539 0 0 unless (ref $byDay eq 'HASH')
1544 0 0 unless ($Day)
1548 0 0 if $byDay->{'nthOfPeriod'}
1562 0 0 unless $HasTime
1565 0 0 if $TZStr
1566 0 0 if $TargetTz
1580 0 0 wantarray ? :
1594 0 0 if (lc($VItem->{'params'}{'value'}[0] || '') eq 'period')
1612 0 0 if defined $updated
1618 0 0 unless $uid
1619 0 0 if $uid =~ /\s/
1620 0 0 if $uid =~ /[\x7f-\xff]/
1629 0 0 unless $id
1631 0 0 if $id eq ''
1639 0 0 if $VAttendee->{'params'}{'cutype'}
1642 0 0 if ($VAttendee->{'params'}{'partstat'})
1645 0 0 if ($VAttendee->{'params'}{'role'})
1647 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'CHAIR'
1649 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'OPT-PARTICIPANT'
1651 0 0 if uc $VAttendee->{'params'}{'role'}[0] eq 'NON-PARTICIPANT'
1653 0 0 if ($VAttendee->{'params'}{'rsvp'})
1654 0 0 lc($VAttendee->{'params'}{'rsvp'}[0] // '') eq 'yes' ? :
1656 0 0 if (exists $VAttendee->{'params'}{'x-dtstamp'})
1658 0 0 if $Date
1662 0 0 if (exists $VAttendee->{'params'}{'x-sequence'})
1678 0 0 unless $w or $d or $H or $M or $S
1681 0 0 if $w
1682 0 0 if $d
1683 0 0 if (not $IsAllDay and $H || $M || $S)
1685 0 0 if $H
1686 0 0 if $M
1687 0 0 if $S
1709 0 0 unless $Spec->{$key}
1713 0 0 if ($Spec->{$key}[1] eq 'object') { }
0 0 elsif ($Spec->{$key}[1] eq 'bool') { }
0 0 elsif ($Spec->{$key}[1] eq 'mailto') { }
1715 0 0 unless $Item
1716 0 0 if ($Spec->{$key}[0]) { }
1724 0 0 if !!$Spec->{$key}[3] == !!$Copy{$key}
1727 0 0 if $Copy{$key}
1730 0 0 if _safeeq($Spec->{$key}[3], $Copy{$key})
1756 0 0 unless my $CalendarData = eval { do { vcard2hash($VCalendar, 'multival', ['rrule'], 'only_one', 1) } }
1761 0 0 unless $CalendarData->{'objects'}
1762 0 0 unless lc $Calendar->{'type'} eq 'vcalendar'
1767 0 0 unless $Calendar->{'objects'}
1768 0 0 unless lc $VEvent->{'type'} eq 'vevent'
1781 0 0 unless _saneuid($uid)
1787 0 0 unless defined $Properties{$Property}{'value'}
1794 0 0 if defined $Properties{'description'}{'value'}
1802 0 0 unless defined $Properties{'dtstart'}{'value'}
1806 0 0 if (defined $Properties{'dtend'}{'value'}) { }
0 0 elsif (defined $Properties{'duration'}{'value'}) { }
1807 0 0 if (defined $Properties{'duration'}{'value'})
1823 0 0 if ('DateTime'->compare($Start, $End) > 0)
1829 0 0 if ($IsAllDay and $StartTimeZone)
1841 0 0 if (exists $Properties{'rrule'})
1846 0 0 unless defined $Value
1853 0 0 if (exists $RRULE{'freq'}) { }
1855 0 0 unless (grep {$_ eq $freq;} @Frequencies)
1866 0 0 if (exists $RRULE{'interval'})
1867 0 0 unless ($RRULE{'interval'} =~ /^\d+$/)
1872 0 0 if ($interval == 0)
1877 0 0 if ($interval > 1)
1882 0 0 if (exists $RRULE{'rscale'})
1884 0 0 if $RRULE{'skip'}
1887 0 0 if (exists $RRULE{'wkst'})
1889 0 0 unless ($WeekDayNames{$wkst})
1894 0 0 if ($wkst ne 'mo')
1899 0 0 if (exists $RRULE{'byday'})
1906 0 0 if @byDays
1909 0 0 if (exists $RRULE{'bymonth'})
1911 0 0 unless ($BYMONTH =~ /^\d+L?$/)
1919 0 0 if (exists $RRULE{'count'})
1920 0 0 if (exists $RRULE{'until'})
1926 0 0 unless ($RRULE{'count'} =~ /^\d+$/)
1933 0 0 if (exists $RRULE{'until'})
1945 0 0 if (defined $RRULE{$Property})
1948 0 0 $RecurrenceProperties{$Property}{'signed'} ? :
1951 0 0 unless ($Value =~ /^$Valid$/)
1955 0 0 unless ($Value >= $Min and $Value <= $RecurrenceProperties{$Property}{'max'})
1968 0 0 if (exists $VEvent->{'properties'}{'exdate'})
1976 0 0 if ($VEvent->{'properties'}{'rdate'})
1988 0 0 unless $VEvent->{'objects'}
1989 0 0 unless lc $VAlarm->{'type'} eq 'valarm'
2000 0 0 unless $AlarmAction
2004 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') { }
2031 0 0 if ($AlarmProperties{'acknowledged'})
2039 0 0 lc($AlarmProperties{'trigger'}{'params'}{'related'}[0] || '') eq 'end' ? :
2044 0 0 if ($Trigger =~ /^[+-]?P/i) { }
2050 0 0 $Related eq 'end' ? :
2053 0 0 if ($Duration->is_negative) { }
2072 0 0 unless $VEvent->{'properties'}{'organizer'}
2075 0 0 unless $VEvent->{'properties'}{'attendee'}
2084 0 0 unless $VEvent->{'properties'}{'attach'}
2085 0 0 unless $Attach->{'value'}
2086 0 0 unless grep {$Attach->{'value'} =~ m[^$_://];} 'http', 'https', 'ftp'
2092 0 0 unless (defined $mime)
2095 0 0 if $MimeTypeObj
2100 0 0 defined $filename ? :
0 0 defined $mime ? :
0 0 defined $size ? :
2108 0 0 unless $VEvent->{'properties'}{'url'}
2110 0 0 unless $uri
2120 0 0 if ($Properties{'created'}{'value'})
2123 0 0 if $Date
2125 0 0 if ($Properties{'dtstamp'}{'value'})
2128 0 0 if $Date
2131 0 0 if $Properties{'sequence'}
2132 0 0 if $method
2135 0 0 if $Properties{'summary'}
2136 0 0 if @description
2138 0 0 if %Links
2140 0 0 if ($Properties{'description'} and $Properties{'description'}{'params'}{'language'})
2143 0 0 if ($Properties{'summary'} and $Properties{'summary'}{'params'}{'language'})
2146 0 0 if $language
2151 0 0 if ($Properties{'location'}{'value'})
2154 0 0 if (not $IsAllDay and $StartTimeZone and $StartTimeZone ne $EndTimeZone)
2159 0 0 $IsAllDay ? :
2160 0 0 if ref $Start
2161 0 0 unless $IsAllDay
2163 0 0 if $duration
2165 0 0 if %Recurrence
2166 0 0 if %Overrides
2169 0 0 if ($Properties{'status'}{'value'})
2170 0 0 if lc $Properties{'status'}{'value'} ne 'confirmed'
2172 0 0 if ($Properties{'transp'}{'value'})
2173 0 0 if lc $Properties{'transp'}{'value'} eq 'transparent'
2176 0 0 if grep {$_ eq 'owner';} @{$Participants{$email}{'roles'};}
2178 0 0 if %Participants
2182 0 0 if %Alerts
2184 0 0 if ($Properties{'lastmodified'}{'value'})
2189 0 0 if ($Properties{'recurrence-id'}{'value'})
2207 0 0 if ($Element->{'value'} =~ /Z$/)
2213 0 0 unless $TZID
2215 0 0 if exists $Self->{'_tznamemap'}{$TZID}
2219 0 0 unless $Calendar->{'objects'}
2220 0 0 unless lc $VTimeZone->{'type'} eq 'vtimezone'
2221 0 0 unless ($VTimeZone->{'properties'}{'tzid'}[0]{'value'} || '') eq $TZID
2223 0 0 unless $VTimeZone->{'objects'}
2224 0 0 unless grep {(lc $Observance->{'type'} || '') eq $_;} 'standard', 'daylight'
2225 0 0 unless defined $Observance->{'properties'}{'tzoffsetto'}[0]{'value'}
2232 0 0 unless exists $TzOffsets{'standard'}
2251 0 0 unless $isoDate =~ /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(Z?)$/i
2252 0 0 if $7
2254 0 0 unless my $Date = 'DateTime'->_new('year', $1, 'month', $2, 'day', $3, 'hour', $4, 'minute', $5, 'second', $6, 'time_zone', $timeZone, 'locale', $LOCALE)
2275 0 0 if ($vDate =~ /^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)(\.\d+)?(Z?)$/i)
2276 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)
2291 0 0 if ($vDate =~ /^(\d\d\d\d)(\d\d)(\d\d)$/)
2293 0 0 unless my $Date = 'DateTime'->_new('year', $1, 'month', $2, 'day', $3, 'time_zone', $FLOATING, 'locale', $LOCALE)
2322 0 0 if ($IsAllDay)
2327 0 0 unless ($tz)
2332 0 0 if ($UTCLinks{$tz})
2354 0 0 if $IsAllDay
2356 0 0 unless ($tz)
2361 0 0 if ($tz =~ /UTC/i)
2385 0 0 $Args->{'showAsFree'} ? :
2388 0 0 if ($recurrenceData)
2396 0 0 if $Prop eq ''
2398 0 0 if exists $Args->{'locale'}
2400 0 0 if $Property eq 'title'
2405 0 0 if $Args->{'created'}
2412 0 0 if ($locations->{$id}{'rel'} and $locations->{'id'}{'rel'} eq 'end')
2415 0 0 if ($locations->{$id}{'name'})
2423 0 0 if ($Args->{'duration'})
2426 0 0 if $Duration
2430 0 0 if ($Args->{'recurrenceRule'})
2442 0 0 if ($Args->{'recurrenceOverrides'})
2445 0 0 if ($val) { }
2446 0 0 if (keys %$val) { }
2460 0 0 if ($Args->{'alerts'})
2468 0 0 $Alert->{'relativeTo'} =~ /before/ ? :
2469 0 0 $Alert->{'relativeTo'} =~ /end/ ? :
2470 0 0 $Alert->{'relativeTo'} =~ /end/ ? :
2475 0 0 if ($Type eq 'display') { }
0 0 elsif ($Type eq 'email' or $Type eq 'uri') { }
2477 0 0 $Sign eq '-' ? :
2486 0 0 if ($Sign eq '-') { }
2508 0 0 if ($Type eq 'uri')
2518 0 0 if $Alert->{'relativeTo'} =~ /end/
2520 0 0 if ($Alert->{'action'}{'acknowledged'})
2529 0 0 if ($Args->{'participants'})
2536 0 0 if ($Attendee->{'name'})
2541 0 0 unless grep {$_ eq 'attendee';} @{$$Attendee{'roles'};}
2543 0 0 if defined $Attendee->{'kind'}
2544 0 0 if defined $Attendee->{'scheduleRSVP'}
2545 0 0 if defined $Attendee->{'x-sequence'}
2546 0 0 if defined $Attendee->{'scheduleUpdated'}
2548 0 0 if $AttendeeProps{$prop} eq ''
2550 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') { }
2561 0 0 if $Attendee->{'scheduleStatus'}
2566 0 0 if ($Args->{'replyTo'})
2567 0 0 if ($Args->{'replyTo'}{'imip'})
2569 0 0 $CN ? :
2573 0 0 if ($Args->{'links'})
2577 0 0 if ($Attach->{'rel'} and $Attach->{'rel'} eq 'enclosure') { }
2583 0 0 if defined $Mime
2584 0 0 if defined $Size
2585 0 0 if defined $FileName
2596 0 0 unless $Args->{'replyTo'} and not $Args->{'participants'}
2616 0 0 ref $Item eq 'ARRAY' ? :
2617 0 0 if (not $havepid and $Args->{'prodId'})
2629 0 0 unless $VTimeZone
2649 0 0 unless (ref $Args eq 'HASH')
2653 0 0 if ($Args->{'frequency'}) { }
2654 0 0 unless (grep {$_ eq $Args->{'frequency'};} @Frequencies)
2664 0 0 if (defined $Args->{'interval'})
2665 0 0 unless ($Args->{'interval'} =~ /^\d+$/)
2669 0 0 if ($Args->{'interval'} == 0)
2673 0 0 if ($Args->{'interval'} > 1)
2678 0 0 if (defined $Args->{'firstDayOfWeek'})
2679 0 0 unless (exists $DaysByIndex{$Args->{'firstDayOfWeek'}})
2683 0 0 unless ($Args->{'firstDayOfWeek'} == 1)
2688 0 0 if ($Args->{'byDay'})
2689 0 0 unless (ref $Args->{'byDay'} eq 'ARRAY')
2693 0 0 unless (@{$Args->{'byDay'};})
2700 0 0 if ($Args->{'byMonth'})
2701 0 0 unless (ref $Args->{'byMonth'} eq 'ARRAY')
2705 0 0 unless (@{$Args->{'byMonth'};})
2712 0 0 unless ($byMonth =~ /^(\d+)L?$/i)
2716 0 0 unless ($monthNum >= 1 and $monthNum <= 13)
2727 0 0 if (defined $Args->{'count'})
2728 0 0 if (defined $Args->{'until'})
2732 0 0 unless ($Args->{'count'} =~ /^\d+$/)
2739 0 0 if ($Args->{'until'})
2742 0 0 if ($IsAllDay) { }
2760 0 0 if ($Args->{$Name})
2761 0 0 unless (ref $Args->{$Name} eq 'ARRAY')
2765 0 0 unless (@{$Args->{$Name};})
2773 0 0 $RecurrenceProperties{$Property}{'signed'} ? :
2776 0 0 unless ($Value =~ /^$Valid$/)
2780 0 0 unless ($Min <= $Value and $Value <= $RecurrenceProperties{$Property}{'max'})
2819 0 0 if $MustBeTopLevel{$Key}
2820 0 0 if ($Key eq 'start')
2822 0 0 if _safeeq($Recurrence->{'start'}, $recurrenceId)
2826 0 0 if _safeeq($Recurrence->{$Key}, $Event->{$Key})
2831 0 0 if $MustBeTopLevel{$Key}
2836 0 0 unless %override
2853 0 0 if ($Event->{'_recurrenceObj'}) { }
0 0 elsif ($map{$uid}) { }
2871 0 0 unless ($map{$uid})
2881 0 0 unless $First->{'isAllDay'}
2883 0 0 if exists $First->{$key}
2888 0 0 if ($SubEvent->{'_recurrenceObj'})
2890 0 0 if $map{$uid}{'timeZone'}
2911 0 0 if (not $AddressSet or $AddressSet ne 'mailto:' . $NewAddressSet or not $DisplayName or $DisplayName ne $NewDisplayName)
2943 0 0 unless $calendarId
2947 0 0 unless $calendarId eq $Cal->{'id'}
2948 0 0 $isFreeBusy ? :
2951 0 0 if @$Errors
2983 0 0 if ($ENV{'JMAP_ALWAYS_FULL'} or ref $New ne 'HASH' or ref $Old or 'HASH')
2993 0 0 if _safeeq($New->{$Key}, $Old->{$Key})
3001 0 0 if (length &encode_json($New) < length &encode_json(\%subover)) { }
3014 0 0 unless $path =~ s[^([^/]+)(/?)][]
3015 0 0 unless ref $hash eq 'HASH'
3019 0 0 if ($slash) { }
0 0 elsif (defined $value) { }
3060 0 0 unless $exception