File Coverage

blib/lib/SBOM/CycloneDX/Declarations/Map.pm
Criterion Covered Total %
statement 26 36 72.2
branch 0 10 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 57 63.1


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Declarations::Map;
2              
3 1     1   1436 use 5.010001;
  1         4  
4 1     1   6 use strict;
  1         1  
  1         16  
5 1     1   3 use warnings;
  1         1  
  1         46  
6 1     1   3 use utf8;
  1         2  
  1         9  
7              
8 1     1   73 use SBOM::CycloneDX::List;
  1         2  
  1         27  
9              
10 1     1   4 use Types::Standard qw(Str InstanceOf);
  1         2  
  1         10  
11 1     1   2375 use Types::TypeTiny qw(ArrayLike);
  1         2  
  1         6  
12              
13 1     1   528 use Moo;
  1         3  
  1         11  
14 1     1   369 use namespace::autoclean;
  1         2  
  1         16  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             # Like bom-ref
19             has requirement => (is => 'rw', isa => Str);
20              
21             # array of bom-ref
22             has claims => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
23              
24             # array of bom-ref
25             has counter_claims => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
26              
27             has conformance => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Declarations::Conformance']);
28             has confidence => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Declarations::Confidence']);
29              
30              
31             sub TO_JSON {
32              
33 0     0 1   my $self = shift;
34              
35 0           my $json = {};
36              
37 0 0         $json->{requirement} = $self->requirement if $self->requirement;
38 0 0         $json->{claims} = $self->claims if @{$self->claims};
  0            
39 0 0         $json->{counterClaims} = $self->counter_claims if @{$self->counter_claims};
  0            
40 0 0         $json->{conformance} = $self->conformance if $self->conformance;
41 0 0         $json->{confidence} = $self->confidence if $self->confidence;
42              
43 0           return $json;
44              
45             }
46              
47             1;
48              
49             =encoding utf-8
50              
51             =head1 NAME
52              
53             SBOM::CycloneDX::Declarations::Map - Map
54              
55             =head1 SYNOPSIS
56              
57             SBOM::CycloneDX::Declarations::Map->new();
58              
59              
60             =head1 DESCRIPTION
61              
62             L provide the groupg of requirements to
63             claims and the attestors declared conformance and confidence thereof.
64              
65             =head2 METHODS
66              
67             L inherits all methods from L
68             and implements the following new ones.
69              
70             =over
71              
72             =item SBOM::CycloneDX::Declarations::Map->new( %PARAMS )
73              
74             Properties:
75              
76             =over
77              
78             =item * C, The list of `bom-ref` to the claims being attested to.
79              
80             =item * C, The confidence of the claim meeting the requirement.
81              
82             =item * C, The conformance of the claim meeting a requirement.
83              
84             =item * C, The list of `bom-ref` to the counter claims being
85             attested to.
86              
87             =item * C, The `bom-ref` to the requirement being attested to.
88              
89             =back
90              
91             =item $map->claims
92              
93             =item $map->confidence
94              
95             =item $map->conformance
96              
97             =item $map->counter_claims
98              
99             =item $map->requirement
100              
101             =back
102              
103              
104             =head1 SUPPORT
105              
106             =head2 Bugs / Feature Requests
107              
108             Please report any bugs or feature requests through the issue tracker
109             at L.
110             You will be notified automatically of any progress on your issue.
111              
112             =head2 Source Code
113              
114             This is open source software. The code repository is available for
115             public review and contribution under the terms of the license.
116              
117             L
118              
119             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
120              
121              
122             =head1 AUTHOR
123              
124             =over 4
125              
126             =item * Giuseppe Di Terlizzi
127              
128             =back
129              
130              
131             =head1 LICENSE AND COPYRIGHT
132              
133             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
134              
135             This is free software; you can redistribute it and/or modify it under
136             the same terms as the Perl 5 programming language system itself.
137              
138             =cut