line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Tests::Contact; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
13
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
84
|
|
4
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
73
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1229
|
use JMAP::Validation::Tests::Address; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
81
|
|
7
|
4
|
|
|
4
|
|
17
|
use JMAP::Validation::Tests::Array; |
|
4
|
|
|
|
|
2
|
|
|
4
|
|
|
|
|
51
|
|
8
|
4
|
|
|
4
|
|
12
|
use JMAP::Validation::Tests::Boolean; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
42
|
|
9
|
4
|
|
|
4
|
|
10
|
use JMAP::Validation::Tests::ContactInformation; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
48
|
|
10
|
4
|
|
|
4
|
|
1200
|
use JMAP::Validation::Tests::File; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
78
|
|
11
|
4
|
|
|
4
|
|
14
|
use JMAP::Validation::Tests::Object; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
42
|
|
12
|
4
|
|
|
4
|
|
10
|
use JMAP::Validation::Tests::String; |
|
4
|
|
|
|
|
2
|
|
|
4
|
|
|
|
|
651
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub is_Contact { |
15
|
248832
|
|
|
248832
|
0
|
194999
|
my ($value) = @_; |
16
|
|
|
|
|
|
|
|
17
|
248832
|
50
|
|
|
|
349546
|
return unless JMAP::Validation::Tests::Object::is_object($value); |
18
|
248832
|
50
|
|
|
|
518556
|
return unless JMAP::Validation::Tests::String::is_id($value->{id}); |
19
|
248832
|
50
|
|
|
|
1350588
|
return unless JMAP::Validation::Tests::Boolean::is_boolean($value->{isFlagged}); |
20
|
|
|
|
|
|
|
|
21
|
248832
|
100
|
|
|
|
396226
|
if (defined $value->{avatar}) { |
22
|
221184
|
50
|
|
|
|
362934
|
return unless JMAP::Validation::Tests::File::is_File($value->{avatar}); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
248832
|
|
|
|
|
438353
|
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
|
|
|
|
|
232563
|
foreach my $field (@string_types) { |
38
|
2239488
|
50
|
|
|
|
3170757
|
return unless JMAP::Validation::Tests::String::is_string($value->{$field}); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
248832
|
50
|
|
|
|
412259
|
return unless JMAP::Validation::Tests::String::is_date($value->{birthday}); |
42
|
248832
|
50
|
|
|
|
383925
|
return unless JMAP::Validation::Tests::String::is_date($value->{anniversary}); |
43
|
|
|
|
|
|
|
|
44
|
248832
|
|
|
|
|
252995
|
foreach my $ContactInformation_type (qw{emails phones online}) { |
45
|
746496
|
50
|
|
|
|
1311773
|
return unless JMAP::Validation::Tests::Array::is_array($value->{$ContactInformation_type}); |
46
|
|
|
|
|
|
|
|
47
|
746496
|
|
|
|
|
903451
|
my $method = "JMAP::Validation::Tests::ContactInformation::is_ContactInformation_$ContactInformation_type"; |
48
|
746496
|
|
|
|
|
1278901
|
$method =~ s/s$//; |
49
|
|
|
|
|
|
|
|
50
|
746496
|
|
|
|
|
469286
|
foreach my $ContactInformation (@{$value->{$ContactInformation_type}}) { |
|
746496
|
|
|
|
|
950147
|
|
51
|
4
|
|
|
4
|
|
18
|
no strict 'refs'; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
431
|
|
52
|
11943936
|
50
|
|
|
|
25896228
|
return unless $method->($ContactInformation); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
248832
|
50
|
|
|
|
464521
|
return unless JMAP::Validation::Tests::Array::is_array($value->{addresses}); |
57
|
|
|
|
|
|
|
|
58
|
248832
|
|
|
|
|
211723
|
foreach my $address (@{$value->{addresses}}) { |
|
248832
|
|
|
|
|
352626
|
|
59
|
2488320
|
50
|
|
|
|
3093620
|
return unless JMAP::Validation::Tests::Address::is_Address($address); |
60
|
|
|
|
|
|
|
} |
61
|
248832
|
|
|
|
|
724331
|
return 1; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |