BugTree/Bug.pm

filter: Statementstmt 64.2% 27 / 42 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 58.3% 7 / 12 Podpod 50.0% 1 / 2 totaltotal 56.4% 35 / 62 CC 4 SCAR 13.7
CC
4
Cov
56%
as_string
12.0
summary_tree
6.0
__ANON__
2.0
CRAP 3.9
« BugTree.pm ↑ Summary
1 package WWW::Bugzilla::BugTree::Bug;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use 5.012;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use XML::Simple qw( XMLin );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 0 ▶use overload '""' => sub { shift->as_string };
Subroutine BEGIN: called CC=1 SCAR=0.2
Subroutine __ANON__: not called CC=1 SCAR=0.2
9  
10 # ABSTRACT: A bug tree returned from WWW::Bugzilla::BugTree
11 1 our $VERSION = '0.08'; # VERSION
12  
13  
14 1 has url => (
15 is => 'ro',
16 required => 1,
17 );
18  
19  
20 1 has res => (
21 is => 'ro',
22 required => 1,
23 );
24  
25  
26 1 has id => (
27 is => 'ro',
28 required => 1,
29 );
30  
31 has as_hashref => (
32 is => 'ro',
33 init_arg => undef,
34 lazy => 1,
35 0 ▶ default => sub {
Subroutine __ANON__: not called CC=1 SCAR=0.2
36 1 ▶ no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 0 XMLin(shift->res->decoded_content);
38 },
39 1 );
40  
41  
42 has children => (
43 is => 'ro',
44 init_arg => undef,
45 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
46 1 );
47  
48  
49 sub as_string
50 0 ▶{
Subroutine as_string: not called CC=3 SCAR=24.8
Pod documented
51 0 my($self) = @_;
52 0 my $id = $self->id;
53 0 my $status = $self->as_hashref->{bug}->{bug_status};
54 0 my $subject = $self->as_hashref->{bug}->{short_desc};
55 0 my $resolution = $self->as_hashref->{bug}->{resolution};
56 0 ▶ undef $resolution if ref $resolution;
Branch: 1 branch
BranchTrueFalseTotal
if ref $resolution 0 0 0
57 0 ▶ $resolution ? "$id $status ($resolution) $subject" : "$id $status $subject";
Branch: 1 branch
BranchTrueFalseTotal
$resolution ? : 0 0 0
58 }
59  
60 # undocumented function
61 sub summary_tree
62 0 ▶{
Subroutine summary_tree: not called CC=2 SCAR=17.9
Pod undocumented
63 0 my($self) = @_;
64
65 0 ▶ [ $self->as_string, @{ $self->children } > 0 ? map { $_->summary_tree } @{ $self->children } : () ];
Branch: 1 branch
BranchTrueFalseTotal
@{$self->children;} > 0 ? : 0 0 0
66 }
67  
68 1 1;
69  
70 __END__
« BugTree.pm ↑ Summary