CycloneDX/Component/PerformanceMetric.pm

filter: Statementstmt 82.0% 32 / 39 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 100% 1 / 1 totaltotal 72.4% 42 / 58 CC 5 SCAR 24.3
CC
5
Cov
68%
TO_JSON
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.4
« CycloneDX/CryptoProperties/CertificateExtension.pm ↑ Summary CycloneDX/License.pm »
1 package SBOM::CycloneDX::Component::PerformanceMetric;
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 SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Types::Standard qw(Str InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 extends 'SBOM::CycloneDX::Base';
17  
18 1 has type => (is => 'rw', isa => Str);
19 1 has value => (is => 'rw', isa => Str);
20 1 has slice => (is => 'rw', isa => Str);
21 1 has confidence_interval => (is => 'rw', isa => Str);
22  
23  
24 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=5 SCAR=34.0
Pod documented
25  
26 0 my $self = shift;
27  
28 0 my $json = {};
29  
30 0 ▶ $json->{type} = $self->type if $self->type;
Branch: 1 branch
BranchTrueFalseTotal
if $self->type 0 0 0
31 0 ▶ $json->{value} = $self->value if $self->value;
Branch: 1 branch
BranchTrueFalseTotal
if $self->value 0 0 0
32 0 ▶ $json->{slice} = $self->slice if $self->slice;
Branch: 1 branch
BranchTrueFalseTotal
if $self->slice 0 0 0
33 0 ▶ $json->{confidenceInterval} = $self->confidence_interval if $self->confidence_interval;
Branch: 1 branch
BranchTrueFalseTotal
if $self->confidence_interval 0 0 0
34  
35 0 return $json;
36  
37 }
38  
39 1 1;
40  
41 =encoding utf-8
42  
43 =head1 NAME
44  
45 SBOM::CycloneDX::Component::PerformanceMetric - Performance Metric
46  
47 =head1 SYNOPSIS
48  
49 SBOM::CycloneDX::Component::PerformanceMetric->new();
50  
51  
52 =head1 DESCRIPTION
53  
54 L<SBOM::CycloneDX::Component::PerformanceMetric> provides the model performance
55 metrics being reported. Examples may include accuracy, F1 score, precision,
56 top-3 error rates, MSC, etc.
57  
58 =head2 METHODS
59  
60 L<SBOM::CycloneDX::Component::PerformanceMetric> inherits all methods from L<SBOM::CycloneDX::Base>
61 and implements the following new ones.
62  
63 =over
64  
65 =item SBOM::CycloneDX::Component::PerformanceMetric->new( %PARAMS )
66  
67 Properties:
68  
69 =over
70  
71 =item * C<confidence_interval>, The confidence interval of the metric.
72  
73 =item * C<slice>, The name of the slice this metric was computed on. By
74 default, assume this metric is not sliced.
75  
76 =item * C<type>, The type of performance metric.
77  
78 =item * C<value>, The value of the performance metric.
79  
80 =back
81  
82 =item $performance_metric->confidence_interval
83  
84 =item $performance_metric->slice
85  
86 =item $performance_metric->type
87  
88 =item $performance_metric->value
89  
90 =back
91  
92  
93 =head1 SUPPORT
94  
95 =head2 Bugs / Feature Requests
96  
97 Please report any bugs or feature requests through the issue tracker
98 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
99 You will be notified automatically of any progress on your issue.
100  
101 =head2 Source Code
102  
103 This is open source software. The code repository is available for
104 public review and contribution under the terms of the license.
105  
106 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
107  
108 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
109  
110  
111 =head1 AUTHOR
112  
113 =over 4
114  
115 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
116  
117 =back
118  
119  
120 =head1 LICENSE AND COPYRIGHT
121  
122 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
123  
124 This is free software; you can redistribute it and/or modify it under
125 the same terms as the Perl 5 programming language system itself.
126  
127 =cut
« CycloneDX/CryptoProperties/CertificateExtension.pm ↑ Summary CycloneDX/License.pm »