App/Command/issues.pm

filter: Statementstmt 96.3% 26 / 27 Branchbran 60.0% 6 / 10 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 85.7% 6 / 7 Podpod 100% 3 / 3 totaltotal 75.4% 43 / 57 CC 9 SCAR 19.2
CC
9
Cov
79%
execute
10.5
abstract
2.0
BEGIN
1.0
CRAP 6.8
« Plugin/CheckIssues.pm ↑ Summary
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Dist::Zilla::App::Command::issues;
4 # vim: set ts=8 sts=4 sw=4 tw=115 et :
5 # ABSTRACT: Print the count of outstanding RT and github issues for your distribution
6  
7 1 our $VERSION = '0.011';
8  
9 1 ▶use Dist::Zilla::App -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 0 ▶sub abstract { "print your distribution's count of outstanding RT and github issues" }
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
12  
13 sub opt_spec
14 2 ▶{
Subroutine opt_spec: called CC=1 SCAR=0.0
Pod documented
15 2 [ 'all!' => 'check both RT and github, regardless of plugin configuration' ],
16 [ 'rt!' => 'get RT information', { default => 1 } ],
17 [ 'github!' => 'get github information', { default => 1 } ],
18 [ 'colour|color!' => 'Uses L<Term::ANSIColor> to colour-code the results according to severity', { default => 1 } ],
19 [ 'repo=s' => 'URL of the github repository' ],
20 }
21  
22 sub execute
23 2 ▶{
Subroutine execute: called CC=9 SCAR=23.5
Pod documented
24 2 my ($self, $opt) = @_; # $arg
25  
26 2 ▶ $self->app->chrome->logger->mute unless $self->app->global_options->verbose;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->app->global_options->verbose 2 0 2
27  
28 # parse dist.ini and load, instantiate all plugins
29 2 my $zilla = $self->zilla;
30  
31 2 $self->app->chrome->logger->unmute;
32  
33 2 require List::Util;
34 2 ▶ my $plugin = List::Util::first { $_->isa('Dist::Zilla::Plugin::CheckIssues') } @{ $zilla->plugins };
Subroutine __ANON__: called CC=1 SCAR=0.0
35 2 ▶ if (not $plugin)
Branch: 1 branch
BranchTrueFalseTotal
unless ($plugin) 2 0 2
36 {
37 2 require Dist::Zilla::Plugin::CheckIssues;
38 2 ▶ $plugin =
Branch: 2 branches
BranchTrueFalseTotal
$opt->all || $opt->rt ? : 2 0 2
$opt->all || $opt->github ? : 2 0 2
Condition33%2/6
$opt->all or $opt->rt
l!l&&r!l&&!r
020
$opt->all or $opt->github
l!l&&r!l&&!r
020
MC/DC0%0/2
$opt->all or $opt->rt
$opt->all $opt->rt
MC/DC0%0/2
$opt->all or $opt->github
$opt->all $opt->github
Truth table33%1/3
A or B
A= $opt->allB= $opt->rt
ABresult
1X1
011
000
Truth table33%1/3
A or B
A= $opt->allB= $opt->github
ABresult
1X1
011
000
39 Dist::Zilla::Plugin::CheckIssues->new(
40 zilla => $zilla,
41 plugin_name => 'issues_command',
42 rt => ($opt->all || $opt->rt ? 1 : 0),
43 github => ($opt->all || $opt->github ? 1 : 0),
44 colour => $opt->colour,
45 );
46 }
47  
48 2 ▶ $plugin->repo_url($opt->repo) if $opt->repo;
Branch: 1 branch
BranchTrueFalseTotal
if $opt->repo 1 1 2
49  
50 2 my @issues = $plugin->get_issues;
51  
52 2 $self->log($_) foreach @issues;
53 }
54  
55 1 1;
56  
57 __END__
« Plugin/CheckIssues.pm ↑ Summary