blib/lib/Raisin/Entity/Object.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 8 / 8 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 10 / 10 Podpod 83.3% 5 / 6 totaltotal 94.9% 56 / 59 CC 6 SCAR 6.6
CC
6
Cov
98%
new
3.0
type
3.0
display_name
2.0
CRAP 1.9
« blib/lib/Raisin/Plugin.pm ↑ Summary blib/lib/Raisin/API.pm »
1 #!perl
2 #PODNAME: Raisin::Entity::Object
3 #ABSTRACT: An expose object.
4  
5 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 package Raisin::Entity::Object;
9 12 $Raisin::Entity::Object::VERSION = '0.94';
10 12 ▶use Plack::Util::Accessor qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
11 desc
12 name
13 runtime
14 using
15 12 );
16 12 ▶use Types::Standard qw(Any ArrayRef HashRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 50 ▶sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
19 50 my ($class, $name, @params) = @_;
20  
21 50 ▶ if (scalar(@params) % 2 && ref($params[-1]) eq 'CODE') {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar(@params) % 2 and ref $params[-1] eq "CODE") 6 44 50
Condition66%2/3
scalar(@params) % 2 and ref $params[-1] eq "CODE"
!ll&&!rl&&r
4406
MC/DC50%1/2
scalar(@params) % 2 and ref $params[-1] eq "CODE"
scalar(@params) % 2 ref $params[-1] eq "CODE"
Truth table66%2/3
A and B
A= scalar(@params) % 2B= ref $params[-1] eq "CODE"
ABresult
0X0
100
111
22 6 splice @params, -1, 0, 'runtime';
23 }
24  
25 50 bless { name => $name, @params }, $class;
26 }
27  
28 4 ▶sub required { 1 }
Subroutine required: called CC=1 SCAR=0.0
Pod documented
29 44 ▶sub alias { shift->{as} }
Subroutine alias: called CC=1 SCAR=0.0
Pod documented
30 28 ▶sub condition { shift->{if} }
Subroutine condition: called CC=1 SCAR=0.0
Pod documented
31  
32 9 ▶sub type {
Subroutine type: called CC=3 SCAR=11.0
Pod documented
33 9 my $self = shift;
34  
35 9 my $type = do {
36 9 ▶ if ($self->{type}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'type'}) { } 5 4 9
elsif ($self->using) { } 2 2 4
37 5 $self->{type};
38 }
39 elsif ($self->using) {
40 2 ArrayRef[HashRef];
41 }
42 else {
43 2 Any;
44 }
45 };
46  
47 9 $type;
48 }
49  
50 39 ▶sub display_name {
Subroutine display_name: called CC=2 SCAR=6.9
Pod documented
51 39 my $self = shift;
52 39 ▶ $self->alias || $self->name;
Branch: 1 branch
BranchTrueFalseTotal
$self->alias or $self->name 6 33 39
53 }
54  
55 12 1;
56  
57 __END__
« blib/lib/Raisin/Plugin.pm ↑ Summary blib/lib/Raisin/API.pm »