Changelord/Command/Version.pm

filter: Statementstmt 78.3% 29 / 37 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 1 totaltotal 63.7% 37 / 58 CC 5 SCAR 25.0
CC
5
Cov
63%
run
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 12.2
« Changelord/Command/Bump.pm ↑ Summary Changelord/Command/GitGather.pm »
1 package App::Changelord::Command::Version;
2 3 our $AUTHORITY = 'cpan:YANICK';
3 # SYNOPSIS: output the latest / next version
4 3 $App::Changelord::Command::Version::VERSION = '0.0.2';
5 3 ▶use 5.36.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 use CLI::Osprey
9 3 ▶ desc => 'output the latest/next version';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 ▶use Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use YAML::XS;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use List::AllUtils qw/ first min /;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use Version::Dotted::Semantic;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 3 with 'App::Changelord::Role::Changelog';
18 3 with 'App::Changelord::Role::ChangeTypes';
19 3 with 'App::Changelord::Role::Versions';
20  
21 0 ▶sub run($self) {
Subroutine run: not called CC=5 SCAR=34.0
Pod undocumented
22 0 my $param = shift @ARGV;
23  
24 die "invalid parameter '$param', needs to be nothing, 'next' or 'latest'\n"
25 0 ▶ if $param and not grep { $param eq $_ } qw/ next latest /;
Branch: 1 branch
BranchTrueFalseTotal
if $param and not grep({$param eq $_;} "next", "latest") 0 0 0
Condition0%0/3
$param and not grep({$param eq $_;} "next", "latest")
!ll&&!rl&&r
000
MC/DC0%0/2
$param and not grep({$param eq $_;} "next", "latest")
$param not grep({$param eq $_;} "next", "latest")
Truth table0%0/3
A and not(B)
A= $paramB= not grep({$param eq $_;} "next", "latest")
ABresult
0X0
100
111
26  
27 0 ▶ if(!$param) {
Branch: 2 branches
BranchTrueFalseTotal
if (not $param) { } 0 0 0
elsif ($param eq 'next') { } 0 0 0
28 0 say "latest version: ", $self->latest_version;
29 0 say "next version: ", $self->next_version;
30 }
31 elsif( $param eq 'next' ) {
32 0 say $self->next_version;
33 }
34 else {
35 0 say $self->latest_version;
36 }
37 }
38  
39 3 'end of App::Changelog::Command::Version';
40  
41 __END__
« Changelord/Command/Bump.pm ↑ Summary Changelord/Command/GitGather.pm »