blib/lib/Perl/PrereqScanner/Scanner.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 28 / 28 CC 3 SCAR 6.9
CC
3
Cov
100%
_q_contents
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« bin/scan_prereqs ↑ Summary blib/lib/Perl/PrereqScanner.pm »
1 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Perl::PrereqScanner::Scanner 1.100;
5 # ABSTRACT: something that scans for prereqs in a Perl document
6  
7 5 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 #pod =head1 DESCRIPTION
10 #pod
11 #pod This is a role to be composed into classes that will act as scanners plugged
12 #pod into a Perl::PrereqScanner object.
13 #pod
14 #pod These classes must provide a C<scan_for_prereqs> method, which will be called
15 #pod like this:
16 #pod
17 #pod $scanner->scan_for_prereqs($ppi_doc, $version_requirements);
18 #pod
19 #pod The scanner should alter the L<CPAN::Meta::Requirements> object to reflect
20 #pod its findings about the PPI document.
21 #pod
22 #pod =cut
23  
24 5 requires 'scan_for_prereqs';
25  
26 # DO NOT RELY ON THIS EXISTING OUTSIDE OF CORE!
27 # THIS MIGHT GO AWAY WITHOUT NOTICE!
28 # -- rjbs, 2010-04-06
29 387 ▶sub _q_contents {
Subroutine _q_contents: called CC=3 SCAR=11.0
30 387 my ($self, $token) = @_;
31 387 my @contents;
32 387 ▶ if ( $token->isa('PPI::Token::QuoteLike::Words') || $token->isa('PPI::Token::Number') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($token->isa('PPI::Token::QuoteLike::Words') or $token->isa('PPI::Token::Number')) { } 57 330 387
Condition100%3/3
$token->isa("PPI::Token::QuoteLike::Words") or $token->isa("PPI::Token::Number")
l!l&&r!l&&!r
2433330
MC/DC100%2/2
$token->isa("PPI::Token::QuoteLike::Words") or $token->isa("PPI::Token::Number")
$token->isa("PPI::Token::QuoteLike::Words") $token->isa("PPI::Token::Number")
Truth table100%3/3
A or B
A= $token->isa("PPI::Token::QuoteLike::Words")B= $token->isa("PPI::Token::Number")
ABresult
1X1
011
000
33 57 @contents = $token->literal;
34 } else {
35 330 @contents = $token->string;
36 }
37  
38 387 return @contents;
39 }
40  
41 5 1;
42  
43 __END__
« bin/scan_prereqs ↑ Summary blib/lib/Perl/PrereqScanner.pm »