| 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
| |||||||||||
| 57 | 0 | ▶ | $resolution ? "$id $status ($resolution) $subject" : "$id $status $subject"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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
| |||||||||||
| 66 | } | ||||||||||
| 67 | |||||||||||
| 68 | 1 | 1; | |||||||||
| 69 | |||||||||||
| 70 | __END__ | ||||||||||