| 1 | package CSAF::Type::Branch; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | use Moo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use CSAF::Type::Branches; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | ▶ | use CSAF::Type::Product; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 1 | extends 'CSAF::Type::Base'; | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 1 | has category => (is => 'rw', required => 1); | |||||||||||||||||||
| 15 | 0 | ▶ | has name => (is => 'rw', required => 1, coerce => sub { ref($_[0]) eq 'URI::VersionRange' ? $_[0]->to_string : $_[0] }); | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
| |||||||||||||||||||||
| 16 | 0 | ▶ | has product => (is => 'rw', predicate => 1, coerce => sub { CSAF::Type::Product->new(shift) }); | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 0 | ▶ | sub branches { | ||||||||||||||||||
|
Subroutine
branches: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 20 | 0 | my $self = shift; | |||||||||||||||||||
| 21 | 0 | ▶ | $self->{branches} ||= CSAF::Type::Branches->new(@_); | ||||||||||||||||||
|
Condition0%0/3
$self->{"branches"} ||= "CSAF::Type::Branches"->new(@_)
MC/DC0%0/2
$self->{"branches"} ||= "CSAF::Type::Branches"->new(@_)
$self->{"branches"}
"CSAF::Type::Branches"->new(@_)
Truth table0%0/3
A ||= B
A= $self->{"branches"}B= "CSAF::Type::Branches"->new(@_)
| |||||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | ▶ | sub TO_CSAF { | ||||||||||||||||||
|
Subroutine
TO_CSAF: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | my $self = shift; | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | my $output = {category => $self->category, name => $self->name}; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | ▶ | if (@{$self->branches->items}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | 0 | $output->{branches} = $self->branches; | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | ▶ | $output->{product} = $self->product if ($self->product); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 0 | return $output; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 1 | 1; | |||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | __END__ | ||||||||||||||||||||