CLI/Command/List.pm

filter: Statementstmt 41.3% 12 / 29 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 100% 2 / 2 totaltotal 39.1% 18 / 46 CC 5 SCAR 27.5
CC
5
Cov
33%
execute
30.0
abstract
2.0
BEGIN
1.0
CRAP 15.6
« CLI/Command/Init.pm ↑ Summary CLI/Manifest.pm »
1 package Luv::CLI::Command::List;
2  
3 # ABSTRACT: list current library dependencies
4  
5 1 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Object::Pad;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use App::Cmd::Setup -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Luv::CLI::Manifest;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶sub abstract {
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
13 0 "Lists the current dependencies.";
14 }
15  
16 0 ▶sub execute ( $self, $opt, $args ) {
Subroutine execute: not called CC=5 SCAR=34.0
Pod documented
17 0 my $manifest_path = "luv.json";
18 0 ▶ die "No luv.json found — run 'luv init' first\n" unless -e $manifest_path;
Branch: 1 branch
BranchTrueFalseTotal
unless -e $manifest_path 0 0 0
19  
20 0 my $manifest = Luv::CLI::Manifest->new( path => $manifest_path );
21 0 $manifest->load;
22  
23 0 my $deps = $manifest->dependencies;
24  
25 0 ▶ unless (%$deps) {
Branch: 1 branch
BranchTrueFalseTotal
unless (%$deps) 0 0 0
26 0 print "No dependencies\n";
27 0 return;
28 }
29  
30 0 for my $key ( sort keys %$deps ) {
31 0 my $dep = $deps->{$key};
32 0 ▶ my $name = $dep->{name} // $key;
Condition0%0/3
$dep->{"name"} // $key
l!l&&r!l&&!r
000
MC/DC0%0/2
$dep->{"name"} // $key
$dep->{"name"} $key
Truth table0%0/3
A // B
A= $dep->{"name"}B= $key
ABresult
1X1
011
000
33 0 print "$name\n";
34 0 print " url: $dep->{url}\n";
35 0 print " ref: $dep->{ref}\n";
36 0 print " path: $dep->{path}\n";
37 }
38  
39 0 return;
40 }
41  
42 1 1;
43  
44 __END__
« CLI/Command/Init.pm ↑ Summary CLI/Manifest.pm »