Box/Collection.pm

filter: Statementstmt 75.6% 31 / 41 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 62.5% 45 / 72 CC 9 SCAR 20.2
CC
9
Cov
60%
folderType
20.0
manager
12.0
init
3.1
CRAP 7.5
« Box/MH/Index.pm ↑ Summary Box/Locker/NFS.pm »
1 # This code is part of Perl distribution Mail-Box version 4.02.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2001-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Mail::Box::Collection;{
13 3 our $VERSION = '4.02';
14 }
15  
16 3 ▶use parent qw/User::Identity::Collection Mail::Reporter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 3 ▶use Log::Report 'mail-box', import => [ qw// ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 3 ▶use Mail::Box::Identity;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 3 ▶use Scalar::Util qw/weaken/;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 #--------------------
28  
29 sub new(@)
30 5 ▶{ my $class = shift;
Subroutine new: called CC=2 SCAR=7.1
Pod documented
31 5 ▶ unshift @_,'name' if @_ % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @_ % 2 5 0 5
32 5 $class->Mail::Reporter::new(@_);
33 }
34  
35 sub init($)
36 5 ▶{ my ($self, $args) = @_;
Subroutine init: called CC=3 SCAR=11.2
Pod undocumented
37 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
38  
39 5 $self->Mail::Reporter::init($args);
40 5 $self->User::Identity::Collection::init($args);
41  
42 weaken($self->{MBC_manager})
43 5 ▶ if $self->{MBC_manager} = delete $args->{manager};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"MBC_manager"} = delete $args->{"manager"} 0 5 5
44  
45 5 $self->{MBC_ftype} = delete $args->{folder_type};
46 5 $self;
47 }
48  
49 #--------------------
50  
51 sub type() { 'folders' }
52  
53  
54 sub manager()
55 0 ▶{ my $self = shift;
Subroutine manager: not called CC=3 SCAR=24.8
Pod documented
56 return $self->{MBC_manager}
57 0 ▶ if defined $self->{MBC_manager};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"MBC_manager"} 0 0 0
58  
59 0 my $parent = $self->parent;
60 0 ▶ defined $parent ? $self->parent->manager : undef;
Branch: 1 branch
BranchTrueFalseTotal
defined $parent ? : 0 0 0
61 }
62  
63  
64 sub folderType()
65 0 ▶{ my $self = shift;
Subroutine folderType: not called CC=4 SCAR=30.0
Pod documented
66 0 ▶ return ($self->{MBC_ftype} = shift) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
67 0 ▶ return $self->{MBC_ftype} if exists $self->{MBC_ftype};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"MBC_ftype"} 0 0 0
68  
69 0 ▶ if(my $parent = $self->parent)
Branch: 1 branch
BranchTrueFalseTotal
if (my $parent = $self->parent) 0 0 0
70 0 { return $self->{MBC_ftype} = $parent->folderType;
71 }
72  
73 0 undef;
74 }
75  
76 3 1;
« Box/MH/Index.pm ↑ Summary Box/Locker/NFS.pm »