Branch Coverage

blib/lib/Concierge/Users.pm
Criterion Covered Total %
branch 72 88 81.8


line true false branch
17 1 68 unless ref $config eq "HASH"
22 2 66 unless my $storage_dir = $config->{'storage_dir'}
23 15 51 unless (-d $storage_dir)
25 0 15 if $@
30 2 64 unless my $backend_type = $config->{'backend'}
35 16 2 $back eq 'yaml' ? :
17 18 $back eq 'file' ? :
29 35 if ($back eq 'database') { }
45 0 62 if $@
60 2 60 unless $configure_result->{'success'}
78 0 60 unless open my $fh, ">", $config_file
83 0 60 if $@
91 0 60 unless open my $fh, ">", $yaml_file
97 0 60 if $@
116 2 63 unless $config_file and -f $config_file
123 0 63 unless open my $fh, "<", $config_file
128 0 63 if $@
134 1 62 if $@
138 1 61 unless $saved_config->{'backend_module'} and $saved_config->{'fields'}
143 0 61 if $@
166 2 128 unless ref $user_data eq "HASH"
184 0 128 unless $data->{'user_id'} and $data->{'user_id'} =~ /^[a-zA-Z0-9._\@-]{2,30}$/u
189 3 125 unless $data->{'moniker'} and $data->{'moniker'} =~ /^[a-zA-Z0-9]{2,24}$/u
194 2 123 if $existing->{'success'}
204 246 798 if $field eq "user_id" or $field eq "moniker"
209 798 0 if (defined $def->{'default'}) { }
0 0 elsif (defined $def->{'null_value'}) { }
221 0 123 unless $result->{'success'}
225 3 120 unless $validation->{'success'}
236 10 110 if $validation->{'warnings'}
245 3 201 unless $user_id and $user_id =~ /\S/u
252 137 64 unless ($fetch_result->{'success'})
259 3 61 if ($options->{'fields'} and ref $options->{'fields'} eq "ARRAY")
277 1 20 unless $user_id and $user_id =~ /\S/u
280 2 18 unless ref $updates eq "HASH"
285 4 14 unless ($existing->{'success'})
300 1 13 unless $validation->{'success'}
308 1 12 if ($validation->{'warnings'})
321 5 12 if ($filter_string and $filter_string =~ /\S/u)
326 0 17 unless $users->{'data'}
331 5 12 $filter_string && $filter_string =~ /\S/u ? :
340 2 8 unless $user_id and $user_id =~ /\S/u
345 3 5 unless ($existing->{'success'})
362 61 0 if ($self->{'backend'} and $self->{'backend'}->can("disconnect"))