PerlDistSite/Common.pm

filter: Statementstmt 82.7% 24 / 29 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 65.9% 31 / 47 SCAR 15.2
CC
4
Cov
67%
spew_if_changed
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.6
« PerlDistSite/MenuItem/MarkdownFile.pm ↑ Summary PerlDistSite/Compile.pm »
1 package Web::PerlDistSite::Common;
2  
3 2 our $VERSION = '0.001010';
4  
5 2 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Type::Params qw( -sigs );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use YAML::PP;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Types::Common ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Path::Tiny qw( path );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use HTML::HTML5::Entities ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 use Exporter::Almighty -setup => {
13 tag => {
14 sigs => [ 'signature', 'signature_for' ],
15 path => [ 'path' ],
16 html => [ 'esc_html' ],
17 },
18 const => {
19 booleans => { true => !!1, false => !!0 },
20 },
21 type => [
22 'Types::Common',
23 ],
24 class => [
25 'Path::Tiny',
26 ],
27 also => [
28 'strict',
29 'warnings',
30 'feature' => [ 'state' ],
31 'experimental' => [ 'signatures' ],
32 ],
33 2 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 2 PathTiny->coercion->add_type_coercions(
36 Types::Common::Str, q{ Path::Tiny::path( $_ ) },
37 );
38  
39 2 *esc_html = \&HTML::HTML5::Entities::encode_entities;
40  
41 sub Path::Tiny::spew_if_changed {
42 0 ▶ my ( $self, $content ) = @_;
Subroutine spew_if_changed: not called CC=4 SCAR=30.0
Pod undocumented
43 0 ▶ my $orig = $self->exists ? $self->slurp_utf8 : \0;
Branch: 1 branch
BranchTrueFalseTotal
$self->exists ? : 0 0 0
44 0 ▶ if ( ref $orig or $orig ne $content ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $orig or $orig ne $content) 0 0 0
Condition0%0/3
ref $orig or $orig ne $content
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $orig or $orig ne $content
ref $orig $orig ne $content
Truth table0%0/3
A or B
A= ref $origB= $orig ne $content
ABresult
1X1
011
000
45 0 $self->spew_utf8( $content );
46 }
47 0 return $self;
48 }
49  
50 2 1;
« PerlDistSite/MenuItem/MarkdownFile.pm ↑ Summary PerlDistSite/Compile.pm »