File Coverage

blib/lib/SBOM/CycloneDX/Component/QuantitativeAnalysis.pm
Criterion Covered Total %
statement 26 33 78.7
branch 0 4 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 48 75.0


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Component::QuantitativeAnalysis;
2              
3 1     1   1701 use 5.010001;
  1         7  
4 1     1   8 use strict;
  1         2  
  1         29  
5 1     1   6 use warnings;
  1         3  
  1         59  
6 1     1   6 use utf8;
  1         3  
  1         9  
7              
8 1     1   53 use SBOM::CycloneDX::List;
  1         3  
  1         38  
9              
10 1     1   6 use Types::Standard qw(InstanceOf);
  1         3  
  1         21  
11 1     1   3431 use Types::TypeTiny qw(ArrayLike);
  1         4  
  1         10  
12              
13 1     1   626 use Moo;
  1         4  
  1         9  
14 1     1   504 use namespace::autoclean;
  1         2  
  1         11  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has performance_metrics => (
19             is => 'rw',
20             isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Component::PerformanceMetric']],
21             default => sub { SBOM::CycloneDX::List->new }
22             );
23              
24             has graphics => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Component::GraphicsCollection']);
25              
26              
27             sub TO_JSON {
28              
29 0     0 1   my $self = shift;
30              
31 0           my $json = {};
32              
33 0 0         $json->{performanceMetrics} = $self->performance_metrics if @{$self->performance_metrics};
  0            
34 0 0         $json->{graphics} = $self->graphics if %{$self->graphics->TO_JSON};
  0            
35              
36 0           return $json;
37              
38             }
39              
40             1;
41              
42             =encoding utf-8
43              
44             =head1 NAME
45              
46             SBOM::CycloneDX::Component::QuantitativeAnalysis - Quantitative Analysis
47              
48             =head1 SYNOPSIS
49              
50             SBOM::CycloneDX::Component::QuantitativeAnalysis->new();
51              
52              
53             =head1 DESCRIPTION
54              
55             L provides a quantitative
56             analysis of the model.
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::QuantitativeAnalysis->new( %PARAMS )
66              
67             Properties:
68              
69             =over
70              
71             =item * C, The model performance metrics being reported.
72             Examples may include accuracy, F1 score, precision, top-3 error rates, MSC,
73             etc.
74              
75             =item * C, A collection of graphics that represent various measurements.
76              
77             =back
78              
79             =item $quantitative_analysis->performance_metrics
80              
81             =item $quantitative_analysis->graphics
82              
83             =back
84              
85              
86             =head1 SUPPORT
87              
88             =head2 Bugs / Feature Requests
89              
90             Please report any bugs or feature requests through the issue tracker
91             at L.
92             You will be notified automatically of any progress on your issue.
93              
94             =head2 Source Code
95              
96             This is open source software. The code repository is available for
97             public review and contribution under the terms of the license.
98              
99             L
100              
101             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
102              
103              
104             =head1 AUTHOR
105              
106             =over 4
107              
108             =item * Giuseppe Di Terlizzi
109              
110             =back
111              
112              
113             =head1 LICENSE AND COPYRIGHT
114              
115             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
116              
117             This is free software; you can redistribute it and/or modify it under
118             the same terms as the Perl 5 programming language system itself.
119              
120             =cut