blib/lib/Attribute/Constructor.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 90.4% 38 / 42 CC 2 SCAR 2.0
CC
2
Cov
97%
__ANON__
2.0
Constructor
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package Attribute::Constructor;
2  
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Attribute::Handlers;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 our $VERSION = '0.04';
10  
11 1 ▶sub UNIVERSAL::Constructor : ATTR(CODE) {
Subroutine Constructor: called CC=1 SCAR=0.0
Pod undocumented
12 1 my ($package, $symbol, $referent, $attr, $data) = @_;
13  
14 1 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶ *{$symbol} = sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
16  
17 2 my $self = shift;
18 2 ▶ my $class = ref($self) || $self;
Condition66%2/3
ref $self || $self
l!l&&r!l&&!r
110
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table66%2/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
19 2 my $instance = {};
20 2 bless( $instance, $class );
21  
22 # Run the constructor
23 2 $referent->( $instance, @_ );
24  
25 # Return the new object
26 2 return $instance;
27 }
28 1 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 1 1;
31 __END__
↑ Summary