lib/Perl/PrereqScanner/NotQuiteLite/Parser/Catalyst.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 87.5% 14 / 16 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 87.2% 48 / 55 SCAR 24.9
CC
12
Cov
91%
parse_catalyst_args
12.2
BEGIN
1.0
BEGIN
1.0
CRAP 12.1
« lib/Perl/PrereqScanner/NotQuiteLite/Parser/TestRequires.pm ↑ Summary blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/KeywordDeclare.pm »
1 package Perl::PrereqScanner::NotQuiteLite::Parser::Catalyst;
2  
3 88 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 88 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 88 ▶use Perl::PrereqScanner::NotQuiteLite::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 sub register { return {
8 87 ▶ use => {
Subroutine register: called CC=1 SCAR=0.0
Pod undocumented
9 Catalyst => 'parse_catalyst_args',
10 },
11 }}
12  
13 sub parse_catalyst_args {
14 3 ▶ my ($class, $c, $used_module, $raw_tokens) = @_;
Subroutine parse_catalyst_args: called CC=12 SCAR=25.0
Pod undocumented
15  
16 3 my @copied_tokens = @$raw_tokens;
17 3 ▶ if (($copied_tokens[0][1] || '') eq '()') {
Branch: 1 branch
BranchTrueFalseTotal
if (($copied_tokens[0][1] || "") eq "()") 2 1 3
Condition50%1/2
$copied_tokens[0][1] || ''
l!l
30
MC/DC0%0/1
$copied_tokens[0][1] || ''
$copied_tokens[0][1]
Truth table50%1/2
A
A= $copied_tokens[0][1]
Aresult
11
00
18 2 my $token = shift @copied_tokens;
19 2 unshift @copied_tokens, @{$token->[0]};
20 }
21 3 ▶ if (is_version($copied_tokens[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_version($copied_tokens[0])) 0 3 3
22 0 $c->add($used_module => shift @copied_tokens);
23 }
24  
25 3 my @plugins;
26 3 for my $token (@copied_tokens) {
27 14 ▶ my $desc = $token->[1] or next;
Branch: 1 branch
BranchTrueFalseTotal
my $desc = $token->[1] or next 0 14 14
28 14 ▶ if ($desc eq 'STRING') {
Branch: 2 branches
BranchTrueFalseTotal
if ($desc eq 'STRING') { } 4 10 14
elsif ($desc eq 'QUOTED_WORD_LIST') { } 1 9 10
29 4 push @plugins, $token->[0][0];
30 } elsif ($desc eq 'QUOTED_WORD_LIST') {
31 1 push @plugins, split /\s/, $token->[0][0];
32 }
33 }
34  
35 3 for my $plugin (@plugins) {
36 9 ▶ next if $plugin =~ /^\-/;
Branch: 1 branch
BranchTrueFalseTotal
if $plugin =~ /^\-/ 1 8 9
37 8 ▶ $plugin = "Catalyst::Plugin::$plugin" unless $plugin =~ s/^\+//;
Branch: 1 branch
BranchTrueFalseTotal
unless $plugin =~ s/^\+// 6 2 8
38 8 ▶ $c->add($plugin => 0) if is_module_name($plugin);
Branch: 1 branch
BranchTrueFalseTotal
if is_module_name($plugin) 5 3 8
39 }
40 }
41  
42 88 1;
43  
44 __END__
« lib/Perl/PrereqScanner/NotQuiteLite/Parser/TestRequires.pm ↑ Summary blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/KeywordDeclare.pm »