PDRUtils/Cmd.pm

filter: Statementstmt 72.7% 16 / 22 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 63.3% 19 / 30 CC 5 SCAR 29.5
CC
5
Cov
62%
_has_prereq
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 19.1
« PDRUtils/SingleCmd.pm ↑ Summary PDRUtils/DistIniCmd/remove_prereq.pm »
1 package App::PDRUtils::Cmd;
2  
3 29 our $DATE = '2021-05-25'; # DATE
4 29 our $VERSION = '0.122'; # VERSION
5  
6 29 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 29 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 29 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 29 our %mod_args = (
11 module => {
12 schema => 'str*',
13 req => 1,
14 pos => 0,
15 },
16 );
17  
18 29 my $re_mod_ver = qr/\Av?\d{1,15}(?: (?:(?:\.\d{1,3}){0,2})|(?:\.\d{1,8}) )\z/x;
19  
20 29 our %mod_ver_args = (
21 module_version => {
22 schema => ['str*', match=>$re_mod_ver], # XXX perl::mod_ver?
23 req => 1,
24 pos => 1,
25 },
26 );
27  
28 29 our %opt_mod_ver_args = (
29 module_version => {
30 schema => ['str*', match=>$re_mod_ver], # XXX perl::mod_ver?
31 default => "0",
32 pos => 1,
33 },
34 );
35  
36 29 our %by_ver_args = (
37 by => {
38 schema => ['str*', match=>$re_mod_ver], # XXX perl::mod_ver?
39 req => 1,
40 pos => 1,
41 },
42 );
43  
44 0 ▶sub _has_prereq {
Subroutine _has_prereq: not called CC=5 SCAR=34.0
45 0 my ($iod, $mod) = @_;
46 0 for my $section ($iod->list_sections) {
47 # like in lint-prereqs
48 0 ▶ $section =~ m!\A(
Branch: 1 branch
BranchTrueFalseTotal
$section =~ m[\A( osprereqs \s*/\s* .+ | osprereqs(::\w+)+ | prereqs (?: \s*/\s* (?<prereqs_phase_rel>\w+))? | extras \s*/\s* lint[_-]prereqs \s*/\s* (assume-(?:provided|used)) )\z]xi or next 0 0 0
49 osprereqs \s*/\s* .+ |
50 osprereqs(::\w+)+ |
51 prereqs (?: \s*/\s* (?<prereqs_phase_rel>\w+))? |
52 extras \s*/\s* lint[_-]prereqs \s*/\s* (assume-(?:provided|used))
53 )\z!ix or next;
54 0 for my $param ($iod->list_keys($section)) {
55 0 ▶ return 1 if $param eq $mod;
Branch: 1 branch
BranchTrueFalseTotal
if $param eq $mod 0 0 0
56 }
57 }
58 0 0;
59 }
60  
61 29 1;
62 # ABSTRACT: Common stuffs for App::PDRUtils::*Cmd::*
63  
64 __END__
« PDRUtils/SingleCmd.pm ↑ Summary PDRUtils/DistIniCmd/remove_prereq.pm »