EO/Attributes.pm

filter: Statementstmt 95.9% 71 / 74 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 94.7% 18 / 19 Podpod 0.0% 0 / 3 totaltotal 92.0% 92 / 100 CC 3 SCAR 1.9
CC
3
Cov
95%
__ANON__
2.0
__ANON__
2.0
__ANON__
1.4
CRAP 1.2
« EO/Pair.pm ↑ Summary EO/System/Perl.pm »
1  
2 package EO::Attributes;
3  
4 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 18 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 18 ▶use Attribute::Handlers;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 18 ▶use Scalar::Util qw(blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 18 our $VERSION = 0.96;
11  
12 34 ▶sub UNIVERSAL::Private : ATTR(CODE) {
Subroutine Private: called CC=1 SCAR=0.0
Pod undocumented
13 34 my ($package, $symbol, $referent, $attr, $data) = @_;
14 18 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 18 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 34 my $thing = *{$symbol};
17 34 my $meth = substr($thing, rindex($thing,':')+1);
18 34 ▶ *{$symbol} = sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
19 216 my $self = shift;
20 216 my $class = ref($self);
21 216 my ($callpkg, $callfile, $callline) = caller();
22 216 ▶ if ($package ne $callpkg) {
Branch: 1 branch
BranchTrueFalseTotal
if ($package ne $callpkg) 4 212 216
23 4 my $text = "Can't private method \"$meth\" from package $package";
24 4 throw EO::Error::Method::Private
25 text => $text,
26 file => $callfile;
27 }
28 212 $referent->( $self, @_ );
29 34 };
30 18 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32  
33 65 ▶sub UNIVERSAL::Abstract : ATTR(CODE) {
Subroutine Abstract: called CC=1 SCAR=0.0
Pod undocumented
34 65 my ($package, $symbol, $referent, $attr, $data) = @_;
35 18 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
36 18 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
37 65 my $thing = *{$symbol};
38 65 my $meth = substr($thing, rindex($thing,':')+1);
39 65 ▶ *{$symbol} = sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
40 1 my $self = shift;
41 1 ▶ my $class = blessed($self) ? ref($self) : $self;
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($self) ? : 1 0 1
42 1 my ($package, $filename, $line) = caller();
43 1 my $text = "Can't call abstract method \"$meth\" on object of type \"$class\"";
44 1 throw EO::Error::Method::Abstract
45 text => $text,
46 file => $filename;
47 65 };
48 18 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
49  
50 17 ▶sub UNIVERSAL::Deprecated : ATTR(CODE) {
Subroutine Deprecated: called CC=1 SCAR=0.0
Pod undocumented
51 17 my ($package, $symbol, $referent, $attr, $data) = @_;
52 18 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
53 18 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
54 17 my $thing = *{$symbol};
55 17 my $meth = substr($thing, rindex($thing,':')+1);
56 17 ▶ *{$symbol} = sub {
Subroutine __ANON__: not called CC=1 SCAR=3.5
57 0 my ($pkg, $filename, $line) = caller();
58 0 print STDERR "use of deprecated method $meth at $filename line $line\n";
59 0 $referent->( @_ );
60 }
61 18 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
62  
63 #sub UNIVERSAL::private : ATTR(CODE) { UNIVERSAL::Private(@_) }
64 #sub UNIVERSAL::abstract : ATTR(CODE) { UNIVERSAL::Private(@_) }
65  
66 18 1;
67  
68 __END__
« EO/Pair.pm ↑ Summary EO/System/Perl.pm »