File Coverage

blib/lib/SBOM/CycloneDX/Component/PerformanceMetric.pm
Criterion Covered Total %
statement 26 33 78.7
branch 0 8 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 52 69.2


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Component::PerformanceMetric;
2              
3 1     1   1664 use 5.010001;
  1         5  
4 1     1   7 use strict;
  1         4  
  1         46  
5 1     1   6 use warnings;
  1         2  
  1         89  
6 1     1   8 use utf8;
  1         2  
  1         8  
7              
8 1     1   48 use SBOM::CycloneDX::List;
  1         3  
  1         76  
9              
10 1     1   7 use Types::Standard qw(Str InstanceOf);
  1         2  
  1         9  
11 1     1   3668 use Types::TypeTiny qw(ArrayLike);
  1         4  
  1         9  
12              
13 1     1   647 use Moo;
  1         3  
  1         10  
14 1     1   526 use namespace::autoclean;
  1         3  
  1         14  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has type => (is => 'rw', isa => Str);
19             has value => (is => 'rw', isa => Str);
20             has slice => (is => 'rw', isa => Str);
21             has confidence_interval => (is => 'rw', isa => Str);
22              
23              
24             sub TO_JSON {
25              
26 0     0 1   my $self = shift;
27              
28 0           my $json = {};
29              
30 0 0         $json->{type} = $self->type if $self->type;
31 0 0         $json->{value} = $self->value if $self->value;
32 0 0         $json->{slice} = $self->slice if $self->slice;
33 0 0         $json->{confidenceInterval} = $self->confidence_interval if $self->confidence_interval;
34              
35 0           return $json;
36              
37             }
38              
39             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 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 inherits all methods from L
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, The confidence interval of the metric.
72              
73             =item * C, The name of the slice this metric was computed on. By
74             default, assume this metric is not sliced.
75              
76             =item * C, The type of performance metric.
77              
78             =item * C, 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.
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
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
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