Policies/Security/Individual.pm

filter: Statementstmt 38.1% 16 / 42 Branchbran 0.0% 0 / 26 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 55.5% 5 / 9 Podpod 66.6% 2 / 3 totaltotal 25.8% 23 / 89 CC 17 SCAR 53.4
CC
17
Cov
22%
create
306.0
new
2.0
get_available_classes_and_versions
2.0
CRAP 208.5
↑ Summary Policies/License.pm »
1 ## no critic (ControlStructures::ProhibitPostfixControls)
2 package Software::Policies::Security::Individual;
3  
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 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: Create project policy file: Security / Individual
9  
10 1 our $VERSION = '0.006';
11  
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use Software::Security::Policy::Individual 0.11;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
17 0 my ($class) = @_;
18 0 return bless {}, $class;
19 }
20  
21 0 ▶sub create {
Subroutine create: not called CC=17 SCAR=57.2
Pod documented
22 0 my ( $self, %args ) = @_;
23 0 ▶ my $version = $args{'version'} // '1';
Condition0%0/2
$args{"version"} // 1
l!l
00
MC/DC0%0/1
$args{"version"} // 1
$args{"version"}
Truth table0%0/2
A
A= $args{"version"}
Aresult
11
00
24 0 ▶ my $format = $args{'format'} // 'markdown';
Condition0%0/2
$args{"format"} // "markdown"
l!l
00
MC/DC0%0/1
$args{"format"} // "markdown"
$args{"format"}
Truth table0%0/2
A
A= $args{"format"}
Aresult
11
00
25  
26 0 my %attributes;
27 0 ▶ my $attrs = $args{'attributes'} // {};
Condition0%0/2
$args{"attributes"} // {}
l!l
00
MC/DC0%0/1
$args{"attributes"} // {}
$args{"attributes"}
Truth table0%0/2
A
A= $args{"attributes"}
Aresult
11
00
28 0 ▶ $attributes{'maintainer'} = $attrs->{'authors'}->[0] if $attrs->{'authors'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"authors"} 0 0 0
29 0 ▶ $attributes{'timeframe'} = $attrs->{'timeframe'} if $attrs->{'timeframe'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"timeframe"} 0 0 0
30 0 ▶ $attributes{'timeframe_quantity'} = $attrs->{'timeframe_quantity'} if $attrs->{'timeframe_quantity'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"timeframe_quantity"} 0 0 0
31 0 ▶ $attributes{'timeframe_units'} = $attrs->{'timeframe_units'} if $attrs->{'timeframe_units'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"timeframe_units"} 0 0 0
32 0 ▶ $attributes{'url'} = $attrs->{'url'} if $attrs->{'url'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"url"} 0 0 0
33 0 ▶ $attributes{'git_url'} = $attrs->{'git_url'} if $attrs->{'git_url'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"git_url"} 0 0 0
34 0 ▶ $attributes{'report_url'} = $attrs->{'report_url'} if $attrs->{'report_url'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"report_url"} 0 0 0
35 0 ▶ $attributes{'perl_support_years'} = $attrs->{'perl_support_years'} if $attrs->{'perl_support_years'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"perl_support_years"} 0 0 0
36 0 ▶ $attributes{'program'} = $attrs->{'name'} if $attrs->{'name'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"name"} 0 0 0
37 0 ▶ $attributes{'program'} = $attrs->{'program'} if $attrs->{'program'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"program"} 0 0 0
38 0 ▶ $attributes{'Program'} = $attrs->{'Program'} if $attrs->{'Program'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"Program"} 0 0 0
39 0 ▶ $attributes{'minimum_perl_version'} = $attrs->{'minimum_perl_version'} if $attrs->{'minimum_perl_version'};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs->{"minimum_perl_version"} 0 0 0
40 croak q{Missing option 'maintainer'}
41 0 ▶ if ( !defined $attributes{'maintainer'} );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $attributes{"maintainer"} 0 0 0
42 0 my $p = Software::Security::Policy::Individual->new( \%attributes );
43 return (
44 0 policy => 'Contributing',
45 class => 'PerlDistZilla',
46 version => $version,
47 text => $p->fulltext,
48 filename => _filename($format),
49 format => $format,
50 );
51 }
52  
53 0 ▶sub get_available_classes_and_versions {
Subroutine get_available_classes_and_versions: not called CC=1 SCAR=6.9
Pod undocumented
54 return {
55 0 'Individual' => {
56 versions => {
57 '1' => 1,
58 },
59 formats => {
60 'markdown' => 1,
61 'text' => 1,
62 },
63 },
64 };
65 }
66  
67 0 ▶sub _filename {
Subroutine _filename: not called CC=1 SCAR=6.9
68 0 my ($format) = @_;
69 0 my %formats = ( 'markdown' => 'SECURITY.md', );
70 0 return $formats{$format};
71 }
72  
73 1 1;
74  
75 __END__
↑ Summary Policies/License.pm »