File Coverage

blib/lib/SBOM/CycloneDX/Declarations/Confidence.pm
Criterion Covered Total %
statement 23 28 82.1
branch 0 4 0.0
condition n/a
subroutine 8 9 88.8
pod 1 1 100.0
total 32 42 76.1


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Declarations::Confidence;
2              
3 1     1   2024 use 5.010001;
  1         5  
4 1     1   7 use strict;
  1         2  
  1         28  
5 1     1   6 use warnings;
  1         2  
  1         63  
6 1     1   7 use utf8;
  1         3  
  1         11  
7              
8 1     1   41 use SBOM::CycloneDX::List;
  1         3  
  1         37  
9              
10 1     1   6 use Types::Standard qw(Str Num);
  1         2  
  1         11  
11              
12 1     1   3856 use Moo;
  1         4  
  1         14  
13 1     1   551 use namespace::autoclean;
  1         3  
  1         18  
14              
15             extends 'SBOM::CycloneDX::Base';
16              
17             has score => (is => 'rw', isa => Num);
18             has rationale => (is => 'rw', isa => Str);
19              
20             sub TO_JSON {
21              
22 0     0 1   my $self = shift;
23              
24 0           my $json = {};
25              
26 0 0         $json->{score} = $self->score if $self->score;
27 0 0         $json->{rationale} = $self->rationale if $self->rationale;
28              
29 0           return $json;
30              
31             }
32              
33             1;
34              
35             =encoding utf-8
36              
37             =head1 NAME
38              
39             SBOM::CycloneDX::Declarations::Confidence - Confidence
40              
41             =head1 SYNOPSIS
42              
43             SBOM::CycloneDX::Declarations::Confidence->new();
44              
45              
46             =head1 DESCRIPTION
47              
48             L provide the confidence of the claim
49             meeting the requirement.
50              
51             =head2 METHODS
52              
53             L inherits all methods from L
54             and implements the following new ones.
55              
56             =over
57              
58             =item SBOM::CycloneDX::Declarations::Confidence->new( %PARAMS )
59              
60             Properties:
61              
62             =over
63              
64             =item * C, The rationale for the confidence score.
65              
66             =item * C, The confidence of the claim between and inclusive of 0 and
67             1, where 1 is 100% confidence.
68              
69             =back
70              
71             =item $confidence->rationale
72              
73             =item $confidence->score
74              
75             =back
76              
77              
78             =head1 SUPPORT
79              
80             =head2 Bugs / Feature Requests
81              
82             Please report any bugs or feature requests through the issue tracker
83             at L.
84             You will be notified automatically of any progress on your issue.
85              
86             =head2 Source Code
87              
88             This is open source software. The code repository is available for
89             public review and contribution under the terms of the license.
90              
91             L
92              
93             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
94              
95              
96             =head1 AUTHOR
97              
98             =over 4
99              
100             =item * Giuseppe Di Terlizzi
101              
102             =back
103              
104              
105             =head1 LICENSE AND COPYRIGHT
106              
107             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
108              
109             This is free software; you can redistribute it and/or modify it under
110             the same terms as the Perl 5 programming language system itself.
111              
112             =cut