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

filter: Statementstmt 96.5% 28 / 29 Branchbran 75.0% 6 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 88.6% 39 / 44 SCAR 17.9
CC
6
Cov
92%
parse_mojo_base_args
4.0
register
3.0
BEGIN
1.0
CRAP 6.0
« blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/Mixin.pm ↑ Summary lib/Perl/PrereqScanner/NotQuiteLite/Parser/Autouse.pm »
1 package Perl::PrereqScanner::NotQuiteLite::Parser::MojoBase;
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 88 my @MojoBaseLike = qw/
8 Mojo::Base
9 Mojo::Weixin::Base Mojo::Webqq::Base
10 Kelp::Base Rethinkdb::Base PMLTQ::Base
11 /;
12  
13 sub register {
14 87 ▶ my ($class, %args) = @_;
Subroutine register: called CC=3 SCAR=11.0
Pod undocumented
15 87 ▶ my %mojo_base_like = map {$_ => 1} (@MojoBaseLike, @{$args{mojo_base_like} || []});
Branch: 1 branch
BranchTrueFalseTotal
$args{"mojo_base_like"} or [] 87 0 87
16 87 my %mapping;
17 87 for my $module (keys %mojo_base_like) {
18 522 $mapping{use}{$module} = 'parse_mojo_base_args';
19 }
20 87 return \%mapping;
21 }
22  
23 sub parse_mojo_base_args {
24 12 ▶ my ($class, $c, $used_module, $raw_tokens) = @_;
Subroutine parse_mojo_base_args: called CC=4 SCAR=13.9
Pod undocumented
25  
26 12 my $tokens = convert_string_tokens($raw_tokens);
27 12 ▶ if (is_version($tokens->[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_version($tokens->[0])) 0 12 12
28 0 $c->add($used_module => shift @$tokens);
29 }
30 12 my $module = $tokens->[0];
31 12 ▶ if (ref $module) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $module) 2 10 12
32 2 $module = $module->[0];
33 }
34 12 ▶ if (is_module_name($module)) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_module_name($module)) 8 4 12
35 8 $module =~ s|'|::|g;
36 8 $c->add($module => 0);
37 }
38 }
39  
40 88 1;
41  
42 __END__
« blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/Mixin.pm ↑ Summary lib/Perl/PrereqScanner/NotQuiteLite/Parser/Autouse.pm »