| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package JMAP::Validation::Tests::Contact; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
13
|
use strict; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
89
|
|
|
4
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
|
4
|
|
|
|
|
3
|
|
|
|
4
|
|
|
|
|
72
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1269
|
use JMAP::Validation::Tests::Address; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
85
|
|
|
7
|
4
|
|
|
4
|
|
16
|
use JMAP::Validation::Tests::Array; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
56
|
|
|
8
|
4
|
|
|
4
|
|
12
|
use JMAP::Validation::Tests::Boolean; |
|
|
4
|
|
|
|
|
4
|
|
|
|
4
|
|
|
|
|
44
|
|
|
9
|
4
|
|
|
4
|
|
12
|
use JMAP::Validation::Tests::ContactInformation; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
163
|
|
|
10
|
4
|
|
|
4
|
|
1310
|
use JMAP::Validation::Tests::File; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
80
|
|
|
11
|
4
|
|
|
4
|
|
16
|
use JMAP::Validation::Tests::Object; |
|
|
4
|
|
|
|
|
4
|
|
|
|
4
|
|
|
|
|
47
|
|
|
12
|
4
|
|
|
4
|
|
8
|
use JMAP::Validation::Tests::String; |
|
|
4
|
|
|
|
|
4
|
|
|
|
4
|
|
|
|
|
585
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub is_Contact { |
|
15
|
248832
|
|
|
248832
|
0
|
214111
|
my ($value) = @_; |
|
16
|
|
|
|
|
|
|
|
|
17
|
248832
|
50
|
|
|
|
348542
|
return unless JMAP::Validation::Tests::Object::is_object($value); |
|
18
|
248832
|
50
|
|
|
|
479762
|
return unless JMAP::Validation::Tests::String::is_id($value->{id}); |
|
19
|
248832
|
50
|
|
|
|
1365670
|
return unless JMAP::Validation::Tests::Boolean::is_boolean($value->{isFlagged}); |
|
20
|
|
|
|
|
|
|
|
|
21
|
248832
|
100
|
|
|
|
383583
|
if (defined $value->{avatar}) { |
|
22
|
221184
|
50
|
|
|
|
382257
|
return unless JMAP::Validation::Tests::File::is_File($value->{avatar}); |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
248832
|
|
|
|
|
466950
|
my @string_types = qw{ |
|
26
|
|
|
|
|
|
|
prefix |
|
27
|
|
|
|
|
|
|
firstName |
|
28
|
|
|
|
|
|
|
lastName |
|
29
|
|
|
|
|
|
|
suffix |
|
30
|
|
|
|
|
|
|
nickname |
|
31
|
|
|
|
|
|
|
company |
|
32
|
|
|
|
|
|
|
department |
|
33
|
|
|
|
|
|
|
jobTitle |
|
34
|
|
|
|
|
|
|
notes |
|
35
|
|
|
|
|
|
|
}; |
|
36
|
|
|
|
|
|
|
|
|
37
|
248832
|
|
|
|
|
218266
|
foreach my $field (@string_types) { |
|
38
|
2239488
|
50
|
|
|
|
3073532
|
return unless JMAP::Validation::Tests::String::is_string($value->{$field}); |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
248832
|
50
|
|
|
|
390120
|
return unless JMAP::Validation::Tests::String::is_date($value->{birthday}); |
|
42
|
248832
|
50
|
|
|
|
359362
|
return unless JMAP::Validation::Tests::String::is_date($value->{anniversary}); |
|
43
|
|
|
|
|
|
|
|
|
44
|
248832
|
|
|
|
|
252814
|
foreach my $ContactInformation_type (qw{emails phones online}) { |
|
45
|
746496
|
50
|
|
|
|
1160127
|
return unless JMAP::Validation::Tests::Array::is_array($value->{$ContactInformation_type}); |
|
46
|
|
|
|
|
|
|
|
|
47
|
746496
|
|
|
|
|
878323
|
my $method = "JMAP::Validation::Tests::ContactInformation::is_ContactInformation_$ContactInformation_type"; |
|
48
|
746496
|
|
|
|
|
1255097
|
$method =~ s/s$//; |
|
49
|
|
|
|
|
|
|
|
|
50
|
746496
|
|
|
|
|
509157
|
foreach my $ContactInformation (@{$value->{$ContactInformation_type}}) { |
|
|
746496
|
|
|
|
|
921428
|
|
|
51
|
4
|
|
|
4
|
|
14
|
no strict 'refs'; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
416
|
|
|
52
|
11943936
|
50
|
|
|
|
23587544
|
return unless $method->($ContactInformation); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
248832
|
50
|
|
|
|
395866
|
return unless JMAP::Validation::Tests::Array::is_array($value->{addresses}); |
|
57
|
|
|
|
|
|
|
|
|
58
|
248832
|
|
|
|
|
195194
|
foreach my $address (@{$value->{addresses}}) { |
|
|
248832
|
|
|
|
|
323339
|
|
|
59
|
2488320
|
50
|
|
|
|
3061666
|
return unless JMAP::Validation::Tests::Address::is_Address($address); |
|
60
|
|
|
|
|
|
|
} |
|
61
|
248832
|
|
|
|
|
625319
|
return 1; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |