blib/lib/perl5i/2/UNIVERSAL.pm

filter: Statementstmt 90.0% 27 / 30 Branchbran 100% 4 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 76.9% 10 / 13 Podpod 0.0% 0 / 9 totaltotal 75.4% 46 / 61 SCAR 13.9
CC
4
Cov
92%
alias
4.0
is_number
2.0
is_even
2.0
CRAP 4.0
« blib/lib/perl5i/1/UNIVERSAL.pm ↑ Summary lib/perl5i.pm »
1 package perl5i::2::UNIVERSAL;
2  
3 # Methods which apply to all autoboxed objects.
4 #
5 # They do NOT apply to blessed objects. That should go into perl5i::2::Meta::Instance.
6  
7 109 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 109 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 109 require Carp::Fix::1_25;
11  
12 sub alias {
13 934 ▶ my $self = shift;
Subroutine alias: called CC=4 SCAR=13.9
Pod undocumented
14  
15 934 ▶ Carp::Fix::1_25::croak('Not enough arguments given to alias()') unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 1 933 934
16  
17 933 my @name = @_;
18 933 ▶ unshift @name, (caller)[0] unless @name > 1 or grep /::/, @name;
Branch: 1 branch
BranchTrueFalseTotal
unless @name > 1 or grep /::/, @name 9 924 933
Condition100%3/3
@name > 1 or grep /::/, @name
l!l&&r!l&&!r
92319
MC/DC100%2/2
@name > 1 or grep /::/, @name
@name > 1 grep /::/, @name
Truth table100%3/3
A or B
A= @name > 1B= grep /::/, @name
ABresult
1X1
011
000
19  
20 933 my $name = join '::', @name;
21  
22 # If this redefines something, assume the user wanted to
23 109 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 109 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
25 933 *{$name} = $self;
26 933 return 1;
27 }
28  
29 0 ▶sub is_number { return }
Subroutine is_number: not called CC=1 SCAR=6.9
Pod undocumented
30 3 ▶sub is_positive { return }
Subroutine is_positive: called CC=1 SCAR=0.0
Pod undocumented
31 3 ▶sub is_negative { return }
Subroutine is_negative: called CC=1 SCAR=0.0
Pod undocumented
32 0 ▶sub is_even { return }
Subroutine is_even: not called CC=1 SCAR=6.9
Pod undocumented
33 0 ▶sub is_odd { return }
Subroutine is_odd: not called CC=1 SCAR=6.9
Pod undocumented
34 3 ▶sub is_int { return }
Subroutine is_int: called CC=1 SCAR=0.0
Pod undocumented
35 3 ▶sub is_integer { return }
Subroutine is_integer: called CC=1 SCAR=0.0
Pod undocumented
36 3 ▶sub is_decimal { return }
Subroutine is_decimal: called CC=1 SCAR=0.0
Pod undocumented
37  
38 109 1;
« blib/lib/perl5i/1/UNIVERSAL.pm ↑ Summary lib/perl5i.pm »