CPAN/Module.pm

filter: Statementstmt 78.3% 58 / 74 Branchbran 50.0% 32 / 64 Conditioncond 0.0% 0 / 14 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 61.5% 8 / 13 Podpod 100% 5 / 5 totaltotal 58.1% 103 / 177 CC 40 SCAR 38.2
CC
40
Cov
59%
init
66.6
metacpan_url
20.0
package
12.0
CRAP 45.4
« CPAN/Generic.pm ↑ Summary CPAN/Changes.pm »
1 ##----------------------------------------------------------------------------
2 ## Meta CPAN API - ~/lib/Net/API/CPAN/Module.pm
3 ## Version v0.1.0
4 ## Copyright(c) 2023 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2023/07/25
7 ## Modified 2023/11/24
8 ## All rights reserved
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 # This module file has been automatically generated. Any change made here will be lost.
15 # Edit the script in ./build/build_modules.pl instead
16 package Net::API::CPAN::Module;
17 BEGIN
18 2 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶ use parent qw( Net::API::CPAN::File );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 our $VERSION = 'v0.1.0';
24 };
25  
26 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: not called CC=1 SCAR=0.0
28  
29 sub init
30 1 ▶{
Subroutine init: called CC=33 SCAR=42.0
Pod documented
31 1 my $self = shift( @_ );
32 1 ▶ $self->{abstract} = undef unless( CORE::exists( $self->{abstract} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"abstract"} 1 0 1
33 1 ▶ $self->{author} = undef unless( CORE::exists( $self->{author} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"author"} 1 0 1
34 1 ▶ $self->{authorized} = undef unless( CORE::exists( $self->{authorized} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"authorized"} 1 0 1
35 1 ▶ $self->{binary} = undef unless( CORE::exists( $self->{binary} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"binary"} 1 0 1
36 1 ▶ $self->{date} = undef unless( CORE::exists( $self->{date} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"date"} 1 0 1
37 1 ▶ $self->{deprecated} = undef unless( CORE::exists( $self->{deprecated} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"deprecated"} 1 0 1
38 1 ▶ $self->{description} = undef unless( CORE::exists( $self->{description} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"description"} 1 0 1
39 1 ▶ $self->{dir} = undef unless( CORE::exists( $self->{dir} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"dir"} 1 0 1
40 1 ▶ $self->{directory} = undef unless( CORE::exists( $self->{directory} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"directory"} 1 0 1
41 1 ▶ $self->{dist_fav_count} = undef unless( CORE::exists( $self->{dist_fav_count} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"dist_fav_count"} 1 0 1
42 1 ▶ $self->{distribution} = undef unless( CORE::exists( $self->{distribution} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"distribution"} 1 0 1
43 1 ▶ $self->{documentation} = undef unless( CORE::exists( $self->{documentation} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"documentation"} 1 0 1
44 1 ▶ $self->{download_url} = undef unless( CORE::exists( $self->{download_url} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"download_url"} 1 0 1
45 1 ▶ $self->{id} = undef unless( CORE::exists( $self->{id} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"id"} 1 0 1
46 1 ▶ $self->{indexed} = undef unless( CORE::exists( $self->{indexed} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"indexed"} 1 0 1
47 1 ▶ $self->{level} = undef unless( CORE::exists( $self->{level} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"level"} 1 0 1
48 1 ▶ $self->{maturity} = undef unless( CORE::exists( $self->{maturity} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"maturity"} 1 0 1
49 1 ▶ $self->{mime} = undef unless( CORE::exists( $self->{mime} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"mime"} 1 0 1
50 1 ▶ $self->{module} = [] unless( CORE::exists( $self->{module} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"module"} 1 0 1
51 1 ▶ $self->{name} = undef unless( CORE::exists( $self->{name} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"name"} 1 0 1
52 1 $self->{object} = 'module';
53 1 ▶ $self->{path} = undef unless( CORE::exists( $self->{path} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"path"} 1 0 1
54 1 ▶ $self->{pod} = undef unless( CORE::exists( $self->{pod} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"pod"} 1 0 1
55 1 ▶ $self->{pod_lines} = undef unless( CORE::exists( $self->{pod_lines} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"pod_lines"} 1 0 1
56 1 ▶ $self->{release} = undef unless( CORE::exists( $self->{release} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"release"} 1 0 1
57 1 ▶ $self->{sloc} = undef unless( CORE::exists( $self->{sloc} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"sloc"} 1 0 1
58 1 ▶ $self->{slop} = undef unless( CORE::exists( $self->{slop} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"slop"} 1 0 1
59 1 ▶ $self->{stat} = undef unless( CORE::exists( $self->{stat} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"stat"} 1 0 1
60 1 ▶ $self->{status} = undef unless( CORE::exists( $self->{status} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"status"} 1 0 1
61 1 ▶ $self->{suggest} = undef unless( CORE::exists( $self->{suggest} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"suggest"} 1 0 1
62 1 ▶ $self->{version} = '' unless( CORE::exists( $self->{version} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"version"} 1 0 1
63 1 ▶ $self->{version_numified} = undef unless( CORE::exists( $self->{version_numified} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"version_numified"} 1 0 1
64 1 $self->{_init_strict_use_sub} = 1;
65 1 $self->{_exception_class} = 'Net::API::CPAN::Exception';
66 1 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 1 0 1
67 1 $self->{fields} = [qw(
68 abstract author authorized binary date deprecated description dir directory
69 dist_fav_count distribution documentation download_url id indexed level maturity
70 mime module name path pod pod_lines release sloc slop stat status suggest version
71 version_numified
72 )];
73 1 return( $self );
74 }
75  
76 # NOTE: sub abstract is inherited from Net::API::CPAN::File
77  
78 # NOTE: sub author is inherited from Net::API::CPAN::File
79  
80 # NOTE: sub authorized is inherited from Net::API::CPAN::File
81  
82 # NOTE: sub binary is inherited from Net::API::CPAN::File
83  
84 # NOTE: sub date is inherited from Net::API::CPAN::File
85  
86 # NOTE: sub deprecated is inherited from Net::API::CPAN::File
87  
88 # NOTE: sub description is inherited from Net::API::CPAN::File
89  
90 # NOTE: sub dir is inherited from Net::API::CPAN::File
91  
92 # NOTE: sub directory is inherited from Net::API::CPAN::File
93  
94 # NOTE: sub dist_fav_count is inherited from Net::API::CPAN::File
95  
96 # NOTE: sub distribution is inherited from Net::API::CPAN::File
97  
98 # NOTE: sub documentation is inherited from Net::API::CPAN::File
99  
100 # NOTE: sub download_url is inherited from Net::API::CPAN::File
101  
102 # NOTE: sub id is inherited from Net::API::CPAN::File
103  
104 # NOTE: sub indexed is inherited from Net::API::CPAN::File
105  
106 # NOTE: sub level is inherited from Net::API::CPAN::File
107  
108 # NOTE: sub maturity is inherited from Net::API::CPAN::File
109  
110 sub metacpan_url
111 0 ▶{
Subroutine metacpan_url: not called CC=4 SCAR=30.0
Pod documented
112 0 my $self = shift( @_ );
113 0 ▶ my $author = $self->author ||
Condition0%0/2
$self->author || (return $self->error('No module author is set to return a Meta CPAN URL for this module.'))
l!l
00
MC/DC0%0/1
$self->author || (return $self->error('No module author is set to return a Meta CPAN URL for this module.'))
$self->author
Truth table0%0/2
A
A= $self->author
Aresult
11
00
114 return( $self->error( "No module author is set to return a Meta CPAN URL for this module." ) );
115 0 ▶ my $release = $self->release ||
Condition0%0/2
$self->release || (return $self->error('No module release is set to return a Meta CPAN URL for this module.'))
l!l
00
MC/DC0%0/1
$self->release || (return $self->error('No module release is set to return a Meta CPAN URL for this module.'))
$self->release
Truth table0%0/2
A
A= $self->release
Aresult
11
00
116 return( $self->error( "No module release is set to return a Meta CPAN URL for this module." ) );
117 0 ▶ my $path = $self->path ||
Condition0%0/2
$self->path || (return $self->error('No module path is set to return a Meta CPAN URL for this module.'))
l!l
00
MC/DC0%0/1
$self->path || (return $self->error('No module path is set to return a Meta CPAN URL for this module.'))
$self->path
Truth table0%0/2
A
A= $self->path
Aresult
11
00
118 return( $self->error( "No module path is set to return a Meta CPAN URL for this module." ) );
119 0 my $api_uri = $self->api->api_uri->clone;
120 0 $api_uri->path( "/pod/$author/$release/$path" );
121 0 return( $api_uri );
122 }
123  
124 # NOTE: sub mime is inherited from Net::API::CPAN::File
125  
126 # NOTE: sub module is inherited from Net::API::CPAN::File
127  
128 # NOTE: sub name is inherited from Net::API::CPAN::File
129  
130 0 ▶sub object { return( shift->_set_get_scalar_as_object( 'object', @_ ) ); }
Subroutine object: not called CC=1 SCAR=6.9
Pod documented
131  
132 sub package
133 0 ▶{
Subroutine package: not called CC=3 SCAR=24.8
Pod documented
134 0 my $self = shift( @_ );
135 0 ▶ my $doc = $self->documentation ||
Condition0%0/2
$self->documentation || (return $self->error('No documentation module class is set to call Net::API::CPAN->package'))
l!l
00
MC/DC0%0/1
$self->documentation || (return $self->error('No documentation module class is set to call Net::API::CPAN->package'))
$self->documentation
Truth table0%0/2
A
A= $self->documentation
Aresult
11
00
136 return( $self->error( "No documentation module class is set to call Net::API::CPAN->package" ) );
137 0 ▶ my $result = $self->api->package( $doc ) || return( $self->pass_error );
Condition0%0/2
$self->api->package($doc) || (return $self->pass_error)
l!l
00
MC/DC0%0/1
$self->api->package($doc) || (return $self->pass_error)
$self->api->package($doc)
Truth table0%0/2
A
A= $self->api->package($doc)
Aresult
11
00
138 0 return( $result );
139 }
140  
141 # NOTE: sub path is inherited from Net::API::CPAN::File
142  
143 sub permission
144 0 ▶{
Subroutine permission: not called CC=3 SCAR=24.8
Pod documented
145 0 my $self = shift( @_ );
146 0 ▶ my $doc = $self->documentation ||
Condition0%0/2
$self->documentation || (return $self->error('No documentation module class is set to call Net::API::CPAN->package'))
l!l
00
MC/DC0%0/1
$self->documentation || (return $self->error('No documentation module class is set to call Net::API::CPAN->package'))
$self->documentation
Truth table0%0/2
A
A= $self->documentation
Aresult
11
00
147 return( $self->error( "No documentation module class is set to call Net::API::CPAN->package" ) );
148 0 ▶ my $result = $self->api->permission( $doc ) || return( $self->pass_error );
Condition0%0/2
$self->api->permission($doc) || (return $self->pass_error)
l!l
00
MC/DC0%0/1
$self->api->permission($doc) || (return $self->pass_error)
$self->api->permission($doc)
Truth table0%0/2
A
A= $self->api->permission($doc)
Aresult
11
00
149 0 return( $result );
150 }
151  
152 # NOTE: sub pod is inherited from Net::API::CPAN::File
153  
154 # NOTE: sub pod_lines is inherited from Net::API::CPAN::File
155  
156 # NOTE: sub release is inherited from Net::API::CPAN::File
157  
158 # NOTE: sub sloc is inherited from Net::API::CPAN::File
159  
160 # NOTE: sub slop is inherited from Net::API::CPAN::File
161  
162 # NOTE: sub stat is inherited from Net::API::CPAN::File
163  
164 # NOTE: sub status is inherited from Net::API::CPAN::File
165  
166 # NOTE: sub suggest is inherited from Net::API::CPAN::File
167  
168 # NOTE: sub version is inherited from Net::API::CPAN::File
169  
170 # NOTE: sub version_numified is inherited from Net::API::CPAN::File
171  
172 2 1;
173 # NOTE: POD
174 __END__
« CPAN/Generic.pm ↑ Summary CPAN/Changes.pm »