BambooCli/Command/Project.pm

filter: Statementstmt 69.0% 29 / 42 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 8 / 10 Podpod 100% 2 / 2 totaltotal 61.9% 39 / 63 CC 7 SCAR 32.2
CC
7
Cov
58%
run
56.0
details_sub
2.0
BEGIN
1.0
CRAP 25.1
↑ Summary BambooCli/Command/Plans.pm »
1 package App::BambooCli::Command::Project;
2  
3 # Created on: 2019-06-04 07:54:58
4 # Create by: Ivan Wills
5 # $Id$
6 # $Revision$, $HeadURL$, $Date$
7 # $Revision$, $Source$, $Date$
8  
9 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use List::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 #use List::MoreUtils;
16 1 ▶use Data::Dumper qw/Dumper/;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use English qw/ -no_match_vars /;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 extends 'App::BambooCli::Command';
20  
21 1 our $VERSION = version->new('0.0.1');
22  
23 1 our $NAME = 'plans';
24 1 our $OPTIONS = [
25 'key|k=s',
26 'force|f!',
27 'verbose|v+',
28 ];
29  
30 0 ▶sub details_sub { return ( $NAME, $OPTIONS )};
Subroutine details_sub: not called CC=1 SCAR=6.9
Pod documented
31  
32 0 ▶sub run {
Subroutine run: not called CC=7 SCAR=40.3
Pod documented
33 0 my ($self) = @_;
34 0 my $bamboo = $self->config->bamboo;
35 0 my $key = $self->defaults->{key};
36  
37 0 my $project = $bamboo->project($key);
38 0 my @plans = $project->plans;
39  
40 0 my %max = ( key => 1, name => 1, builds => 1 );
41 0 for my $project (@plans) {
42 0 ▶ $max{key} = length $project->key if $max{key} < length $project->key;
Branch: 1 branch
BranchTrueFalseTotal
if $max{"key"} < length $project->key 0 0 0
43 0 ▶ $max{name} = length $project->name if $max{name} < length $project->name;
Branch: 1 branch
BranchTrueFalseTotal
if $max{"name"} < length $project->name 0 0 0
44 0 ▶ $max{builds} = length $project->builds if $max{builds} < length $project->builds;
Branch: 1 branch
BranchTrueFalseTotal
if $max{"builds"} < length $project->builds 0 0 0
45 }
46 0 for my $project (@plans) {
47 0 ▶ printf "%-$max{key}s %-$max{name}s (%$max{builds}d) %s\n", $project->key, $project->name, $project->builds, $project->link || '';
Condition0%0/2
$project->link || ''
l!l
00
MC/DC0%0/1
$project->link || ''
$project->link
Truth table0%0/2
A
A= $project->link
Aresult
11
00
48 }
49 }
50  
51 1 1;
52  
53 __END__
↑ Summary BambooCli/Command/Plans.pm »