blib/lib/DBIx/Class/InflateColumn/Path/Class.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 4 / 4 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 90.9% 40 / 44 CC 5 SCAR 10.4
CC
5
Cov
94%
register_column
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.8
↑ Summary
1 package DBIx::Class::InflateColumn::Path::Class;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Path::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = '0.001001';
8  
9 3 ▶sub register_column {
Subroutine register_column: called CC=5 SCAR=16.1
Pod documented
10 3 my ($self, $column, $info, @rest) = @_;
11 3 $self->next::method($column, $info, @rest);
12  
13 3 my $inflate;
14 3 ▶ if( exists $info->{'is_file'} || $info->{'is_file'} ){
Branch: 2 branches
BranchTrueFalseTotal
if (exists $info->{'is_file'} or $info->{'is_file'}) { } 1 2 3
elsif (exists $info->{'is_dir'} or $info->{'is_dir'}) { } 1 1 2
Condition66%2/3
exists $info->{"is_file"} or $info->{"is_file"}
l!l&&r!l&&!r
102
MC/DC50%1/2
exists $info->{"is_file"} or $info->{"is_file"}
exists $info->{"is_file"} $info->{"is_file"}
Truth table66%2/3
A or B
A= exists $info->{"is_file"}B= $info->{"is_file"}
ABresult
1X1
011
000
15 1 ▶ $inflate = sub { return Path::Class::file(shift) };
Subroutine __ANON__: called CC=1 SCAR=0.0
16 ▶ } elsif( exists $info->{'is_dir'} || $info->{'is_dir'} ){
Condition66%2/3
exists $info->{"is_dir"} or $info->{"is_dir"}
l!l&&r!l&&!r
101
MC/DC50%1/2
exists $info->{"is_dir"} or $info->{"is_dir"}
exists $info->{"is_dir"} $info->{"is_dir"}
Truth table66%2/3
A or B
A= exists $info->{"is_dir"}B= $info->{"is_dir"}
ABresult
1X1
011
000
17 1 ▶ $inflate = sub { return Path::Class::dir(shift) };
Subroutine __ANON__: called CC=1 SCAR=0.0
18 } else {
19 1 return;
20 }
21  
22 $self->inflate_column
23 (
24 $column => {
25 inflate => $inflate,
26 4 ▶ deflate => sub { return shift->stringify },
Subroutine __ANON__: called CC=1 SCAR=0.0
27 }
28 2 );
29 }
30  
31 1 1;
32  
33 __END__;
↑ Summary