File Coverage

blib/lib/SBOM/CycloneDX/Component/Commit.pm
Criterion Covered Total %
statement 23 31 74.1
branch 0 10 0.0
condition n/a
subroutine 8 9 88.8
pod 1 1 100.0
total 32 51 62.7


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Component::Commit;
2              
3 1     1   2300 use 5.010001;
  1         5  
4 1     1   5 use strict;
  1         3  
  1         32  
5 1     1   6 use warnings;
  1         2  
  1         61  
6 1     1   6 use utf8;
  1         2  
  1         7  
7              
8 1     1   31 use SBOM::CycloneDX::List;
  1         3  
  1         30  
9              
10 1     1   3 use Types::Standard qw(Str InstanceOf);
  1         2  
  1         11  
11              
12 1     1   3541 use Moo;
  1         3  
  1         9  
13 1     1   482 use namespace::autoclean;
  1         2  
  1         12  
14              
15             extends 'SBOM::CycloneDX::Base';
16              
17             has uid => (is => 'rw', isa => Str);
18             has url => (is => 'rw', isa => Str);
19             has author => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::IdentifiableAction']);
20             has committer => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::IdentifiableAction']);
21             has message => (is => 'rw', isa => Str);
22              
23             sub TO_JSON {
24              
25 0     0 1   my $self = shift;
26              
27 0           my $json = {};
28              
29 0 0         $json->{uid} = $self->uid if $self->uid;
30 0 0         $json->{url} = $self->url if $self->url;
31 0 0         $json->{author} = $self->author if $self->author;
32 0 0         $json->{committer} = $self->committer if $self->committer;
33 0 0         $json->{message} = $self->message if $self->message;
34              
35 0           return $json;
36              
37             }
38              
39             1;
40              
41             =encoding utf-8
42              
43             =head1 NAME
44              
45             SBOM::CycloneDX::Component::Commit - Commit
46              
47             =head1 SYNOPSIS
48              
49             SBOM::CycloneDX::Component::Commit->new();
50              
51              
52             =head1 DESCRIPTION
53              
54             L specifies an individual commit.
55              
56             =head2 METHODS
57              
58             L inherits all methods from L
59             and implements the following new ones.
60              
61             =over
62              
63             =item SBOM::CycloneDX::Component::Commit->new( %PARAMS )
64              
65             Properties:
66              
67             =over
68              
69             =item * C, The author who created the changes in the commit
70              
71             =item * C, The person who committed or pushed the commit
72              
73             =item * C, The text description of the contents of the commit
74              
75             =item * C, A unique identifier of the commit. This may be version
76             control specific. For example, Subversion uses revision numbers whereas git
77             uses commit hashes.
78              
79             =item * C, The URL to the commit. This URL will typically point to a
80             commit in a version control system.
81              
82             =back
83              
84             =item $commit->author
85              
86             =item $commit->committer
87              
88             =item $commit->message
89              
90             =item $commit->uid
91              
92             =item $commit->url
93              
94             =back
95              
96              
97             =head1 SUPPORT
98              
99             =head2 Bugs / Feature Requests
100              
101             Please report any bugs or feature requests through the issue tracker
102             at L.
103             You will be notified automatically of any progress on your issue.
104              
105             =head2 Source Code
106              
107             This is open source software. The code repository is available for
108             public review and contribution under the terms of the license.
109              
110             L
111              
112             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
113              
114              
115             =head1 AUTHOR
116              
117             =over 4
118              
119             =item * Giuseppe Di Terlizzi
120              
121             =back
122              
123              
124             =head1 LICENSE AND COPYRIGHT
125              
126             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
127              
128             This is free software; you can redistribute it and/or modify it under
129             the same terms as the Perl 5 programming language system itself.
130              
131             =cut