blib/lib/Seis/Object.pm

filter: Statementstmt 46.8% 15 / 32 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 45.4% 5 / 11 Podpod 0.0% 0 / 4 totaltotal 35.7% 20 / 56 CC 4 SCAR 10.9
CC
4
Cov
38%
new
6.0
isa
6.0
meta
3.8
CRAP 3.0
« blib/lib/Seis/IO.pm ↑ Summary blib/lib/Seis/Str.pm »
1 package Seis::Object;
2 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 25 ▶use 5.010_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # TODO: make more perl6-ish.
8 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
9 0 my $class = shift;
10 0 ▶ my %args = @_==1 ? %{$_[0]} : @_;
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 ? : 0 0 0
11 0 bless { %args }, $class;
12 }
13  
14 0 ▶sub meta {
Subroutine meta: not called CC=2 SCAR=13.4
Pod undocumented
15 0 my $self = shift;
16 0 ▶ my $pkg = ref $self || $self;
Condition0%0/3
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
17 25 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
18 0 my $meta = Seis::MetaClass->new(name => $pkg);
19 0 ▶ *{"${pkg}::_meta"} = sub { $meta };
Subroutine __ANON__: not called CC=1 SCAR=6.9
20 0 $meta;
21 }
22  
23 0 ▶sub WHAT {
Subroutine WHAT: not called CC=1 SCAR=6.9
Pod undocumented
24 0 my $self = shift;
25 0 Seis::Class->_new(name => Scalar::Util::blessed($self));
26 }
27  
28 0 ▶sub DESTROY { }
Subroutine DESTROY: not called CC=1 SCAR=0.0
29  
30 0 ▶sub isa {
Subroutine isa: not called CC=2 SCAR=17.9
Pod undocumented
31 0 my ($self, $stuff) = @_;
32 0 ▶ if (UNIVERSAL::isa($stuff, 'Seis::Class')) {
Branch: 1 branch
BranchTrueFalseTotal
if (UNIVERSAL::isa($stuff, 'Seis::Class')) { } 0 0 0
33 0 UNIVERSAL::isa($self, $stuff->{name});
34 } else {
35 0 UNIVERSAL::isa($self, $stuff);
36 }
37 }
38  
39 25 1;
40  
« blib/lib/Seis/IO.pm ↑ Summary blib/lib/Seis/Str.pm »