CPANAuthors/Utils/Authors.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 100% 41 / 41 CC 2 SCAR 2.0
CC
2
Cov
100%
_parse
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« CPANAuthors/Register.pm ↑ Summary CPANAuthors/Factory.pm »
1 package Acme::CPANAuthors::Utils::Authors;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use base 'Acme::CPANAuthors::Utils::CPANIndex';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 15 ▶sub _mappings {+{author => 'authors'}}
Subroutine _mappings: called CC=1 SCAR=0.0
8  
9 5 ▶sub _parse {
Subroutine _parse: called CC=2 SCAR=6.9
10 5 my ($self, $file) = @_;
11  
12 5 my $handle = $self->_handle($file);
13  
14 3 ▶ while (my $line = $handle->getline) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $line = $handle->getline) 30 3 33
15 30 $line =~ s/\r?\n$//;
16 30 my ($alias, $pauseid, $long) = split ' ', $line, 3;
17 30 $long =~ s/^"//;
18 30 $long =~ s/"$//;
19 30 my ($name, $email) = $long =~ /(.*) <(.+)>$/;
20 30 my $author = Acme::CPANAuthors::Utils::Authors::Author->new({
21 pauseid => $pauseid,
22 name => $name,
23 email => $email,
24 });
25  
26 30 $self->{authors}{$pauseid} = $author;
27 }
28 }
29  
30 package #
31 Acme::CPANAuthors::Utils::Authors::Author;
32  
33 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 3 ▶use base 'Class::Accessor::Fast';
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 3 __PACKAGE__->mk_ro_accessors(qw/pauseid name email/);
38  
39 3 1;
40  
41 __END__
« CPANAuthors/Register.pm ↑ Summary CPANAuthors/Factory.pm »