Branch Coverage

blib/lib/WebService/Discord/Webhook.pm
Criterion Covered Total %
branch 27 94 28.7


line true false branch
43 2 3 if (@_ > 1) { }
51 4 1 if ($params{'url'}) { }
0 1 elsif ($params{'id'} and $params{'token'}) { }
52 2 2 if ($params{'url'} =~ m[discord(?:app)?\.com/api/webhooks/(\d+)/([^/?]+)]i) { }
59 0 0 if ($params{'id'} =~ /^\d+$/ and $params{'token'} =~ m[^[^/?]+$]) { }
73 0 2 if ($params{'timeout'})
74 0 2 if ($params{'verify_SSL'})
80 0 2 if ($params{'wait'})
96 0 0 if ($self->{'id'} ne $response->{'id'})
102 0 0 if ($self->{'token'} ne $response->{'token'})
110 0 0 if ($response->{'guild_id'}) { }
131 0 0 if (not $response->{'success'}) { }
0 0 elsif (not $response->{'content'}) { }
154 2 0 if (@_ > 1) { }
161 1 1 unless ($params{'name'} or exists $params{'avatar'})
168 0 1 if ($params{'name'})
170 1 0 if (exists $params{'avatar'})
171 1 0 if ($params{'avatar'}) { }
175 0 1 if (substr($params{'avatar'}, 0, 8) eq "\211PNG\r\n\cZ\n") { }
0 1 elsif (substr($params{'avatar'}, 0, 2) eq "\377\330" and substr($params{'avatar'}, -2) eq "\377\331") { }
0 1 elsif (substr($params{'avatar'}, 0, 4) eq 'GIF8') { }
208 0 0 if (not $response->{'success'}) { }
0 0 elsif (not $response->{'content'}) { }
232 0 0 if (not $response->{'success'})
256 2 0 if (@_ > 1) { }
263 1 1 if ($params{'file'})
264 1 1 if ($params{'embed'})
267 1 1 if (not $params{'content'} || $params{'files'} || $params{'embeds'}) { }
1 0 elsif ($params{'embeds'} and $params{'files'}) { }
279 0 0 if ($params{'content'})
281 0 0 if ($params{'username'})
282 0 0 if ($params{'avatar_url'})
283 0 0 if ($params{'tts'})
284 0 0 if ($params{'allowed_mentions'})
288 0 0 if ($self->{'wait'})
292 0 0 if (not $params{'files'}) { }
295 0 0 if ($params{'embeds'})
350 0 0 unless ($response->{'success'})
357 0 0 if ($response->{'content'})
364 0 0 if (@_ > 1) { }
374 0 0 if ($self->{'wait'})
378 0 0 unless ($response->{'success'})
386 0 0 if ($response->{'content'})
395 0 0 unless ($params{'event'} and $params{'json'})
403 0 0 if ($self->{'wait'})
415 0 0 unless ($response->{'success'})
423 0 0 if ($response->{'content'})