| 1 | package App::Midgen::Role::Output::MB; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use constant {NONE => q{},}; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | # Load time and dependencies negate execution time | ||||||||||||||||||||||||||||
| 8 | # use namespace::clean -except => 'meta'; | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 2 | our $VERSION = '0.34'; | |||||||||||||||||||||||||||
| 11 | 2 | $VERSION = eval $VERSION; ## no critic | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use English qw( -no_match_vars ); # Avoids reg-ex performance penalty | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 2 | local $OUTPUT_AUTOFLUSH = 1; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 2 | ▶ | use File::Spec; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | ####### | ||||||||||||||||||||||||||||
| 19 | # header_mb | ||||||||||||||||||||||||||||
| 20 | ####### | ||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub header_mb { | ||||||||||||||||||||||||||
|
Subroutine
header_mb: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 23 | 0 | ▶ | my $package_name = shift || NONE; | ||||||||||||||||||||||||||
|
Condition0%0/2
shift() || ''
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if ($package_name ne NONE) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 0 | $package_name =~ s{::}{-}g; | |||||||||||||||||||||||||||
| 27 | 0 | print "\n" . '"dist_name" => "' . $package_name . q{",} . "\n"; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | return; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | ####### | ||||||||||||||||||||||||||||
| 33 | # body_mb | ||||||||||||||||||||||||||||
| 34 | ####### | ||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub body_mb { | ||||||||||||||||||||||||||
|
Subroutine
body_mb: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 37 | 0 | my $title = shift; | |||||||||||||||||||||||||||
| 38 | 0 | ▶ | my $required_ref = shift || return; | ||||||||||||||||||||||||||
|
Condition0%0/2
shift() || (return)
MC/DC0%0/1
shift() || (return)
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | ▶ | return if not %{$required_ref}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 0 | print "\n"; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | my $pm_length = 0; | |||||||||||||||||||||||||||
| 45 | 0 | foreach my $module_name (sort keys %{$required_ref}) { | |||||||||||||||||||||||||||
| 46 | 0 | ▶ | if (length $module_name > $pm_length) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | 0 | $pm_length = length $module_name; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | $title =~ s/^RuntimeRequires/requires/; | |||||||||||||||||||||||||||
| 52 | 0 | $title =~ s/^TestRequires/test_requires/; | |||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 0 | print q{"} . lc $title . '" => {' . "\n"; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | foreach my $module_name (sort keys %{$required_ref}) { | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | next | ||||||||||||||||||||||||||||
| 59 | if $title eq 'test_requires' | ||||||||||||||||||||||||||||
| 60 | 0 | ▶ | && $required_ref->{$module_name} =~ m/mcpan/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$title eq "test_requires" and $required_ref->{$module_name} =~ /mcpan/
MC/DC0%0/2
$title eq "test_requires" and $required_ref->{$module_name} =~ /mcpan/
$title eq "test_requires"
$required_ref->{$module_name} =~ /mcpan/
Truth table0%0/3
A and B
A= $title eq "test_requires"B= $required_ref->{$module_name} =~ /mcpan/
| |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | my $sq_key = "\"$module_name\""; | |||||||||||||||||||||||||||
| 63 | printf "\t %-*s => \"%s\",\n", $pm_length + 2, $sq_key, | ||||||||||||||||||||||||||||
| 64 | 0 | $required_ref->{$module_name}; | |||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | 0 | print "},\n"; | |||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 0 | return; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | ####### | ||||||||||||||||||||||||||||
| 72 | # footer_mb | ||||||||||||||||||||||||||||
| 73 | ####### | ||||||||||||||||||||||||||||
| 74 | 0 | ▶ | sub footer_mb { | ||||||||||||||||||||||||||
|
Subroutine
footer_mb: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 75 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 0 | ▶ | if (defined -d File::Spec->catdir($App::Midgen::Working_Dir, 'script')) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 78 | 0 | print "\n" . '"script_files" => [' . "\n"; | |||||||||||||||||||||||||||
| 79 | 0 | print "\t\"script/...\"\n"; | |||||||||||||||||||||||||||
| 80 | 0 | print "],\n"; | |||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||
| 82 | elsif (defined -d File::Spec->catdir($App::Midgen::Working_Dir, 'bin')) { | ||||||||||||||||||||||||||||
| 83 | 0 | print "\n" . '"script_files" => [' . "\n"; | |||||||||||||||||||||||||||
| 84 | 0 | print "\t\"bin/...\"\n"; | |||||||||||||||||||||||||||
| 85 | 0 | print "],\n"; | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 0 | print "\n"; | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 0 | return; | |||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | 2 | ▶ | no Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | 2 | 1; | |||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | __END__ | ||||||||||||||||||||||||||||