Resume/Output/ToPlain.pm

filter: Statementstmt 66.0% 76 / 115 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 93.1% 27 / 29 Podpod n/a totaltotal 63.5% 103 / 162 CC 12 SCAR 34.2
CC
12
Cov
57%
to_plain
107.9
formatted_address
2.7
BEGIN
1.1
CRAP 30.5
↑ Summary Resume/MoopsParserTrait.pm »
1 2 ▶use MoopsX::UsingMoose;
Subroutine __ANON__: called CC=1 SCAR=0.0
2 2 ▶use 5.14.0;
Subroutine __ANON__: called CC=1 SCAR=0.0
3 2 ▶use strict;
Subroutine __ANON__: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine __ANON__: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Role for plain output
7 # PODNAME: Acme::Resume::Output::ToPlain
8 2 our $VERSION = '0.0109';
9 2  
10 2 ▶role Acme::Resume::Output::ToPlain {
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=1.0
11  
12 2 ▶ use String::Nudge;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 ▶ method to_plain {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine to_plain: not called CC=11 SCAR=46.8
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
15  
16 0 my @lines = ($self->name, '',
17 $self->email, '',
18 $self->phone, '',
19 $self->formatted_address, '');
20  
21 0 ▶ if($self->has_education) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_education) 0 0 0
22 0 push @lines => 'Education', '-' x length 'education';
23  
24 0 foreach my $edu ($self->all_educations) {
25 0 push @lines => 'School: ' . $edu->school;
26 0 ▶ push @lines => 'Url: ' . $edu->url if $edu->has_url;
Branch: 1 branch
BranchTrueFalseTotal
if $edu->has_url 0 0 0
27 0 push @lines => 'Location: ' . $edu->location;
28 0 push @lines => 'Program: ' . $edu->program;
29 0 push @lines => 'Started: ' . $edu->started->strftime('%Y-%m-%d');
30 0 ▶ push @lines => 'Left: ' . $edu->left->strftime('%Y-%m-%d') if $edu->has_left;
Branch: 1 branch
BranchTrueFalseTotal
if $edu->has_left 0 0 0
31 0 push @lines => "Description:\n" . nudge($edu->description), '', '';
32 }
33 }
34  
35 0 ▶ if($self->has_job_history) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_job_history) 0 0 0
36 0 push @lines => '', 'Work experience', '-' x length 'work experience';
37  
38 0 foreach my $job ($self->all_jobs) {
39  
40 0 push @lines => 'Company: ' . $job->company;
41 0 ▶ push @lines => 'Url: ' . $job->url if $job->has_url;
Branch: 1 branch
BranchTrueFalseTotal
if $job->has_url 0 0 0
42 0 push @lines => 'Location: ' . $job->location;
43 0 push @lines => 'Role: ' . $job->role;
44 0 push @lines => 'Started: ' . $job->started->strftime('%Y-%m-%d');
45  
46 0 ▶ if($job->has_left) {
Branch: 2 branches
BranchTrueFalseTotal
if ($job->has_left) { } 0 0 0
elsif ($job->current) { } 0 0 0
47 0 my $start = $job->started;
48 0 my $left = $job->left;
49  
50 0 $left = $left->minus_years($start->year);
51 0 $left = $left->minus_months($start->month);
52 0 $left = $left->minus_days($start->day_of_month);
53  
54 0 push @lines => 'Left: ' . $job->left->strftime('%Y-%m-%d') . ' ' . sprintf '(%d years, %d months and %d days)', $left->year, $left->month, $left->day_of_month;
55 }
56 elsif($job->current) {
57 0 my $start = $job->started;
58 0 my $now = Time::Moment->now;
59  
60 0 $now = $now->minus_years($start->year);
61 0 $now = $now->minus_months($start->month);
62 0 $now = $now->minus_days($start->day_of_month);
63 0 push @lines => 'Left: Current job' . ' ' . sprintf '(%d years, %d months and %d days - and counting)', $now->year, $now->month, $now->day_of_month;
64 }
65 0 push @lines => "Description:\n" . nudge($job->description), '', '';
66 }
67 }
68  
69 0 return join "\n" => @lines;
70 }
71  
72 0 ▶ method formatted_address {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine formatted_address: not called CC=2 SCAR=9.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
73 0 return $self->join_address("\n");
74 }
75 }
76  
77 2 1;
78  
79 __END__
↑ Summary Resume/MoopsParserTrait.pm »