CSAF/Type/Branch.pm

filter: Statementstmt 69.4% 25 / 36 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 63.6% 7 / 11 Podpod 100% 2 / 2 totaltotal 56.6% 34 / 60 CC 5 SCAR 14.4
CC
5
Cov
56%
TO_CSAF
12.0
branches
6.0
__ANON__
3.7
CRAP 4.2
« CSAF/Type/CWE.pm ↑ Summary CSAF/Type/CVSS2.pm »
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
BranchTrueFalseTotal
ref $_[0] eq 'URI::VersionRange' ? : 0 0 0
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(@_)
l!l&&r!l&&!r
000
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(@_)
ABresult
1X1
011
000
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
BranchTrueFalseTotal
if (@{$self->branches->items;}) 0 0 0
31 0 $output->{branches} = $self->branches;
32 }
33  
34 0 ▶ $output->{product} = $self->product if ($self->product);
Branch: 1 branch
BranchTrueFalseTotal
if $self->product 0 0 0
35  
36 0 return $output;
37  
38 }
39  
40 1 1;
41  
42 __END__
« CSAF/Type/CWE.pm ↑ Summary CSAF/Type/CVSS2.pm »