| 1 | package CSAF::Type::CVSS2; | ||||||||||
| 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 | |||||||||||
| 10 | 1 | extends 'CSAF::Type::Base'; | |||||||||
| 11 | |||||||||||
| 12 | 1 | has version => (is => 'ro', default => '2.0'); | |||||||||
| 13 | 1 | has vectorString => (is => 'ro'); | |||||||||
| 14 | 0 | ▶ | has baseScore => (is => 'ro', coerce => sub { ($_[0] + 0) }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 15 | |||||||||||
| 16 | has [qw( | ||||||||||
| 17 | accessVector | ||||||||||
| 18 | accessComplexity | ||||||||||
| 19 | authentication | ||||||||||
| 20 | confidentialityImpact | ||||||||||
| 21 | integrityImpact | ||||||||||
| 22 | availabilityImpact | ||||||||||
| 23 | exploitability | ||||||||||
| 24 | remediationLevel | ||||||||||
| 25 | reportConfidence | ||||||||||
| 26 | collateralDamagePotential | ||||||||||
| 27 | targetDistribution | ||||||||||
| 28 | confidentialityRequirement | ||||||||||
| 29 | integrityRequirement | ||||||||||
| 30 | availabilityRequirement | ||||||||||
| 31 | 0 | ▶ | )] => (is => 'rw', coerce => sub { uc $_[0] }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | has ['temporalScore', 'environmentalScore'] => (is => 'rw', coerce => sub { ($_[0] + 0) }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub TO_CSAF { | ||||||||
|
Subroutine
TO_CSAF: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 37 | |||||||||||
| 38 | 0 | my $self = shift; | |||||||||
| 39 | |||||||||||
| 40 | 0 | my $output = {version => $self->version, vectorString => $self->vectorString, baseScore => $self->baseScore}; | |||||||||
| 41 | |||||||||||
| 42 | 0 | my @attributes = qw( | |||||||||
| 43 | accessVector | ||||||||||
| 44 | accessComplexity | ||||||||||
| 45 | authentication | ||||||||||
| 46 | confidentialityImpact | ||||||||||
| 47 | integrityImpact | ||||||||||
| 48 | availabilityImpact | ||||||||||
| 49 | exploitability | ||||||||||
| 50 | remediationLevel | ||||||||||
| 51 | reportConfidence | ||||||||||
| 52 | temporalScore | ||||||||||
| 53 | collateralDamagePotential | ||||||||||
| 54 | targetDistribution | ||||||||||
| 55 | confidentialityRequirement | ||||||||||
| 56 | integrityRequirement | ||||||||||
| 57 | availabilityRequirement | ||||||||||
| 58 | environmentalScore | ||||||||||
| 59 | ); | ||||||||||
| 60 | |||||||||||
| 61 | 0 | for my $attribute (@attributes) { | |||||||||
| 62 | 0 | ▶ | $output->{$attribute} = $self->$attribute if ($self->$attribute); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 0 | return $output; | |||||||||
| 66 | |||||||||||
| 67 | } | ||||||||||
| 68 | |||||||||||
| 69 | 0 | ▶ | sub TO_JSON { shift->TO_CSAF } | ||||||||
|
Subroutine
TO_JSON: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 70 | |||||||||||
| 71 | 1 | 1; | |||||||||
| 72 | |||||||||||
| 73 | __END__ | ||||||||||