Metro/Plugin/Map.pm

filter: Statementstmt 74.4% 35 / 47 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 10 / 14 Podpod 0.0% 0 / 3 totaltotal 64.2% 45 / 70 CC 4 SCAR 10.4
CC
4
Cov
66%
mapdir
6.0
maplocation
6.0
version
6.0
CRAP 2.8
« Metro/Shim.pm ↑ Summary Metro/Graph/Step.pm »
1 1 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Map::Metro::Plugin::Map;
6  
7 # ABSTRACT: How to make your own map
8 1 our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9 1 our $VERSION = '0.2405';
10  
11 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use MooseX::AttributeShortcuts;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use File::ShareDir 'dist_dir';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use Types::Standard qw/Bool ArrayRef Str/;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use Types::Path::Tiny qw/Path/;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 has mapfile => (
20 is => 'ro',
21 isa => Path,
22 predicate => 1,
23 coerce => 1,
24 );
25 1 has do_undiacritic => (
26 is => 'rw',
27 isa => Bool,
28 default => 1,
29 );
30 has hooks => (
31 is => 'ro',
32 isa => ArrayRef[ Str ],
33 traits => ['Array'],
34 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
35 1 handles => {
36 all_hooks => 'elements',
37 },
38 );
39  
40 0 ▶sub mapdir {
Subroutine mapdir: not called CC=2 SCAR=17.9
Pod undocumented
41 0 my $self = shift;
42 0 ▶ return $self->mapfile->parent if $self->mapfile->is_absolute; # work with old api
Branch: 1 branch
BranchTrueFalseTotal
if $self->mapfile->is_absolute 0 0 0
43 0 my $package = $self->map_package;
44 0 $package =~ s{::}{-}g;
45 0 return path(dist_dir($package));
46 }
47 0 ▶sub maplocation {
Subroutine maplocation: not called CC=2 SCAR=17.9
Pod undocumented
48 0 my $self = shift;
49 0 ▶ return $self->mapfile if $self->mapfile->is_absolute; # work with old api
Branch: 1 branch
BranchTrueFalseTotal
if $self->mapfile->is_absolute 0 0 0
50 0 return $self->mapdir->child($self->mapfile);
51 }
52  
53 0 ▶sub version {
Subroutine version: not called CC=2 SCAR=17.9
Pod undocumented
54 0 my $self = shift;
55 0 ▶ return 0 if $self->mapfile->is_absolute; # work with old api when we had no map_version()
Branch: 1 branch
BranchTrueFalseTotal
if $self->mapfile->is_absolute 0 0 0
56 0 return $self->map_version;
57 }
58  
59 1 1;
60  
61 __END__
« Metro/Shim.pm ↑ Summary Metro/Graph/Step.pm »