Addex/AddressBook.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 100% 3 / 3 totaltotal 90.0% 27 / 30 CC 2 SCAR 3.2
CC
2
Cov
90%
new
2.0
addex
2.0
BEGIN
1.0
CRAP 1.4
« Addex/Output/SpamAssassin.pm ↑ Summary Addex/Entry.pm »
1 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package App::Addex::AddressBook 0.027;
4 # ABSTRACT: the address book that addex will consult
5  
6 5 ▶use App::Addex::Entry;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 #pod =method new
11 #pod
12 #pod my $addr_book = App::Addex::AddressBook->new(\%arg);
13 #pod
14 #pod This method returns a new AddressBook. Its implementation details are left up
15 #pod to the subclasses, but it must accept a hashref as its first argument.
16 #pod
17 #pod Valid arguments are:
18 #pod
19 #pod addex - required; the App::Addex object using this address book
20 #pod
21 #pod =cut
22  
23 6 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod documented
24 6 my ($class, $arg) = @_;
25 6 ▶ Carp::croak "no addex argument provided" unless $arg->{addex};
Branch: 1 branch
BranchTrueFalseTotal
unless $arg->{"addex"} 0 6 6
26 6 bless { addex => $arg->{addex} } => $class;
27 }
28  
29 #pod =method addex
30 #pod
31 #pod my $addex = $addr_book->addex;
32 #pod
33 #pod This returns the App::Addex object with which the address book is associated.
34 #pod
35 #pod =cut
36  
37 0 ▶sub addex { $_[0]->{addex} }
Subroutine addex: not called CC=1 SCAR=6.9
Pod documented
38  
39 #pod =method entries
40 #pod
41 #pod my @entries = $addex->entries;
42 #pod
43 #pod This method returns the entries in the address book as L<App::Addex::Entry>
44 #pod objects. Its behavior in scalar context is not yet defined.
45 #pod
46 #pod This method should be implemented by a address-book-implementation-specific
47 #pod subclass.
48 #pod
49 #pod =cut
50  
51 1 ▶sub entries {
Subroutine entries: called CC=1 SCAR=0.0
Pod documented
52 1 Carp::confess "no behavior defined for virtual method entries";
53 }
54  
55 5 1;
56  
57 __END__
« Addex/Output/SpamAssassin.pm ↑ Summary Addex/Entry.pm »