blib/lib/IO/Uncompress/Brotli.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 2 SCAR 2.9
CC
2
Cov
100%
unbro
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/IO/Compress/Brotli.pm ↑ Summary Brotli.xs »
1 package IO::Uncompress::Brotli;
2  
3 3 ▶use 5.008000;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use parent qw/Exporter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 our @EXPORT = qw/unbro/;
9 3 our @EXPORT_OK = @EXPORT;
10  
11 3 our $VERSION = '0.023';
12  
13 3 require XSLoader;
14 3 XSLoader::load('IO::Compress::Brotli', $VERSION);
15  
16 # 0.004001 has unbro with prototype $$
17 # 0.004_002 renames it to unbro_given_size, and provides unbro with
18 # prototype $;$ which calls:
19 # * unbro_given_size when called with two arguments
20 # * the OO interface when called with one argument
21 134 ▶sub unbro ($;$) {
Subroutine unbro: called CC=2 SCAR=6.9
Pod documented
22 134 my ($buffer, $decoded_size) = @_;
23 134 ▶ if (defined $decoded_size) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $decoded_size) { } 89 45 134
24 89 return unbro_given_size($buffer, $decoded_size)
25 } else {
26 45 my $bro = IO::Uncompress::Brotli->create;
27 45 return $bro->decompress($buffer);
28 }
29 }
30  
31 3 1;
32 __END__
« blib/lib/IO/Compress/Brotli.pm ↑ Summary Brotli.xs »