Devel/IPerl/Display/Role/Source.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 97.2% 35 / 36 CC 4 SCAR 9.2
CC
4
Cov
100%
BUILDARGS
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« Devel/IPerl/Display/AudioMPEG.pm ↑ Summary Reply/Plugin/IPerl.pm »
1 package Devel::IPerl::Display::Role::Source;
2 2 $Devel::IPerl::Display::Role::Source::VERSION = '0.012';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 has [ qw[bytestream filename uri] ] => ( is => 'rw' );
9  
10 9 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=4 SCAR=13.9
Pod undocumented
11 9 my ( $class, @args ) = @_;
12  
13 # if first arg is data that needs to be determined
14 9 ▶ if( @args % 2 == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args % 2 == 1) 8 1 9
15 8 my $data = shift @args;
16 8 ▶ if( $data =~ /^http[s]?:/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($data =~ /^http[s]?:/) { } 2 6 8
elsif (eval { do { BEGIN {${^WARNING_BITS} = "\x55\x55\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} -f $data } }) { } 4 2 6
17 2 unshift @args, uri => $data;
18 2 ▶ } elsif( eval { no warnings qw(newline); -f $data } ) {
Subroutine BEGIN: called CC=1 SCAR=0.0
19 # using no warnings/eval to avoid warning about newline in filename
20 4 unshift @args, filename => $data;
21 } else {
22 2 unshift @args, bytestream => $data;
23 }
24 }
25  
26 9 return { @args };
27 };
28  
29 2 1;
30  
31 __END__
« Devel/IPerl/Display/AudioMPEG.pm ↑ Summary Reply/Plugin/IPerl.pm »