blib/lib/Acme/OnePiece.pm

filter: Statementstmt 46.4% 13 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 2 totaltotal 43.5% 17 / 39 CC 2 SCAR 9.2
CC
2
Cov
43%
new
6.0
_options
2.0
onepiece
2.0
CRAP 2.5
↑ Summary
1 package Acme::OnePiece;
2 1 ▶use 5.008005;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use IO::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = "0.02";
9  
10 0 ▶sub _options {
Subroutine _options: not called CC=1 SCAR=6.9
11 return {}
12 0 }
13  
14 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
15 0 my $class = shift;
16 0 my $file = shift;
17 0 my $options = $class->_options;
18  
19 0 ▶ my $io = IO::File->new($file, 'r') or die "Usage: Acme::OnePiece->new(\$filename)\n" . $!;
Branch: 1 branch
BranchTrueFalseTotal
my $io = "IO::File"->new($file, "r") or die "Usage: Acme::OnePiece->new(\$filename)\n" . $! 0 0 0
20 0 my @lines = $io->getlines;
21 0 my $contents = join('',@lines);
22 0 $options->{contents} = $contents;
23  
24 0 my $self = bless $options, $class;
25 0 return $self;
26 }
27  
28 0 ▶sub onepiece {
Subroutine onepiece: not called CC=1 SCAR=6.9
Pod undocumented
29 0 my ($self) = @_;
30 0 my $contents = $self->{contents};
31 0 $contents =~ s/(\n+|\s+)/-/g;
32 0 $contents =~ s/-+/-/g;
33 0 return $contents;
34 }
35  
36 1 1;
37 __END__
↑ Summary