lib/Perl/PrereqScanner/Scanner/TestNeeds.pm

filter: Statementstmt 100% 40 / 40 Branchbran 75.0% 6 / 8 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 91.6% 55 / 60 CC 9 SCAR 17.2
CC
9
Cov
94%
scan_for_prereqs
9.1
BEGIN
1.0
BEGIN
1.0
CRAP 5.6
↑ Summary
1 package Perl::PrereqScanner::Scanner::TestNeeds;
2  
3 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.001';
8  
9 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 with 'Perl::PrereqScanner::Scanner';
12  
13 2 ▶use PPIx::Literal ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use version 0.77;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 8 ▶sub scan_for_prereqs {
Subroutine scan_for_prereqs: called CC=9 SCAR=22.1
Pod undocumented
19 8 my ( $self, $ppi_doc, $req ) = @_;
20  
21 # regular use, require, and no
22 8 ▶ my $includes = $ppi_doc->find('Statement::Include') || [];
Condition50%1/2
$ppi_doc->find('Statement::Include') || []
l!l
80
MC/DC0%0/1
$ppi_doc->find('Statement::Include') || []
$ppi_doc->find('Statement::Include')
Truth table50%1/2
A
A= $ppi_doc->find('Statement::Include')
Aresult
11
00
23  
24 NODE:
25 8 for my $node ( @{$includes} ) {
26 8 ▶ next NODE if $node->module ne 'Test::Needs';
Branch: 1 branch
BranchTrueFalseTotal
if $node->module ne "Test::Needs" 0 8 8
27  
28 8 my @args = PPIx::Literal->convert( $node->arguments );
29 8 ▶ next NODE if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 0 8 8
30  
31 8 for my $arg (@args) {
32 10 ▶ if ( ref $arg eq ref {} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $arg eq ref {}) { } 6 4 10
33 6 for my $module ( keys %{$arg} ) {
34 7 ▶ if ( $module eq 'perl' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($module eq 'perl') { } 3 4 7
35 3 $req->add_minimum( $module => version->parse( $arg->{$module} )->numify() );
36 }
37 else {
38 4 $req->add_minimum( $module => "$arg->{$module}" );
39 }
40 }
41 }
42 else {
43 4 $req->add_minimum( $arg => 0 );
44 }
45 }
46 }
47  
48 8 return;
49 }
50  
51 2 __PACKAGE__->meta->make_immutable;
52  
53 2 1;
54  
55 __END__
↑ Summary