Box/Collection.pm

filter: Statementstmt 75.0% 30 / 40 Branchbran 14.2% 2 / 14 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 8 / 10 Podpod 75.0% 3 / 4 totaltotal 61.9% 44 / 71 CC 9 SCAR 20.2
CC
9
Cov
59%
folderType
20.0
manager
12.0
init
3.1
CRAP 7.5
« Box/Locker/NFS.pm ↑ Summary Box/File/Message.pm »
1 # Copyrights 2001-2020 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.02.
5 # This code is part of distribution Mail-Box. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package Mail::Box::Collection;
10 3 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 $VERSION = '3.009';
12  
13 3 ▶use base qw/User::Identity::Collection Mail::Reporter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 3 ▶use Mail::Box::Identity;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 3 ▶use Scalar::Util qw/weaken/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22  
23 sub new(@)
24 5 ▶{ my $class = shift;
Subroutine new: called CC=2 SCAR=7.1
Pod documented
25 5 ▶ unshift @_,'name' if @_ % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @_ % 2 5 0 5
26 5 $class->Mail::Reporter::new(@_);
27 }
28
29 sub init($)
30 5 ▶{ my ($self, $args) = @_;
Subroutine init: called CC=3 SCAR=11.2
Pod undocumented
31 5 ▶ $args->{item_type} ||= 'Mail::Box::Identity';
Condition50%1/2
$args->{"item_type"} ||= "Mail::Box::Identity"
l!l
05
MC/DC0%0/1
$args->{"item_type"} ||= "Mail::Box::Identity"
$args->{"item_type"}
Truth table50%1/2
A
A= $args->{"item_type"}
Aresult
11
00
32  
33 5 $self->Mail::Reporter::init($args);
34 5 $self->User::Identity::Collection::init($args);
35
36 weaken($self->{MBC_manager})
37 5 ▶ if $self->{MBC_manager} = delete $args->{manager};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"MBC_manager"} = delete $args->{"manager"} 0 5 5
38
39 5 $self->{MBC_ftype} = delete $args->{folder_type};
40 5 $self;
41 }
42  
43 sub type() { 'folders' }
44  
45 #------------------------------------------
46  
47  
48 sub manager()
49 0 ▶{ my $self = shift;
Subroutine manager: not called CC=3 SCAR=24.8
Pod documented
50 return $self->{MBC_manager}
51 0 ▶ if defined $self->{MBC_manager};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"MBC_manager"} 0 0 0
52  
53 0 my $parent = $self->parent;
54 0 ▶ defined $parent ? $self->parent->manager : undef;
Branch: 1 branch
BranchTrueFalseTotal
defined $parent ? : 0 0 0
55 }
56  
57 #------------------------------------------
58  
59  
60 sub folderType()
61 0 ▶{ my $self = shift;
Subroutine folderType: not called CC=4 SCAR=30.0
Pod documented
62 0 ▶ return($self->{MBC_ftype} = shift) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
63 0 ▶ return $self->{MBC_ftype} if exists $self->{MBC_ftype};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"MBC_ftype"} 0 0 0
64  
65 0 ▶ if(my $parent = $self->parent)
Branch: 1 branch
BranchTrueFalseTotal
if (my $parent = $self->parent) 0 0 0
66 0 { return $self->{MBC_ftype} = $parent->folderType;
67 }
68  
69 0 undef;
70 }
71  
72 #------------------------------------------
73  
74 3 1;
75  
« Box/Locker/NFS.pm ↑ Summary Box/File/Message.pm »