| 1 | package SBOM::CycloneDX::Declarations::Map; | ||||||||||
| 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 | # Like bom-ref | ||||||||||
| 19 | 1 | has requirement => (is => 'rw', isa => Str); | |||||||||
| 20 | |||||||||||
| 21 | # array of bom-ref | ||||||||||
| 22 | 0 | ▶ | has claims => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 23 | |||||||||||
| 24 | # array of bom-ref | ||||||||||
| 25 | 0 | ▶ | has counter_claims => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 26 | |||||||||||
| 27 | 1 | has conformance => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Declarations::Conformance']); | |||||||||
| 28 | 1 | has confidence => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Declarations::Confidence']); | |||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||
| 32 | |||||||||||
| 33 | 0 | my $self = shift; | |||||||||
| 34 | |||||||||||
| 35 | 0 | my $json = {}; | |||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | $json->{requirement} = $self->requirement if $self->requirement; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 0 | ▶ | $json->{claims} = $self->claims if @{$self->claims}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 0 | ▶ | $json->{counterClaims} = $self->counter_claims if @{$self->counter_claims}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 0 | ▶ | $json->{conformance} = $self->conformance if $self->conformance; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | 0 | ▶ | $json->{confidence} = $self->confidence if $self->confidence; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | |||||||||||
| 43 | 0 | return $json; | |||||||||
| 44 | |||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 1 | 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<SBOM::CycloneDX::Declarations::Map> provide the groupg of requirements to | ||||||||||
| 63 | claims and the attestors declared conformance and confidence thereof. | ||||||||||
| 64 | |||||||||||
| 65 | =head2 METHODS | ||||||||||
| 66 | |||||||||||
| 67 | L<SBOM::CycloneDX::Declarations::Map> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 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<claims>, The list of `bom-ref` to the claims being attested to. | ||||||||||
| 79 | |||||||||||
| 80 | =item * C<confidence>, The confidence of the claim meeting the requirement. | ||||||||||
| 81 | |||||||||||
| 82 | =item * C<conformance>, The conformance of the claim meeting a requirement. | ||||||||||
| 83 | |||||||||||
| 84 | =item * C<counter_claims>, The list of `bom-ref` to the counter claims being | ||||||||||
| 85 | attested to. | ||||||||||
| 86 | |||||||||||
| 87 | =item * C<requirement>, 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 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 <gdt@cpan.org> | ||||||||||
| 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 | ||||||||||