Farly/Value/String.pm

filter: Statementstmt 100% 29 / 29 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 83.3% 5 / 6 totaltotal 96.0% 49 / 51 CC 4 SCAR 3.8
CC
4
Cov
97%
compare
2.0
new
2.0
equals
2.0
CRAP 1.5
« Farly/ASA/Parser.pm ↑ Summary Farly.pm »
1 package Farly::Value::String;
2
3 17 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 17 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 17 our $VERSION = '0.26';
9
10 2325 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
11 2325 my ( $class, $string ) = @_;
12
13 2325 ▶ confess "string required"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $string 1 2324 2325
14 unless defined($string);
15
16 2324 $string =~ s/^\s+|\s+$//g;
17
18 2324 return bless( \$string, $class );
19 }
20
21 10460 ▶sub as_string { return ${ $_[0] } }
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
22
23 3880 ▶sub equals {
Subroutine equals: called CC=2 SCAR=6.9
Pod documented
24 3880 my ( $self, $other ) = @_;
25
26 3880 ▶ if ( $other->isa('Farly::Value::String') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($other->isa("Farly::Value::String")) 2900 980 3880
27 2900 return $self->as_string() eq $other->as_string();
28 }
29 }
30
31 20 ▶sub contains {
Subroutine contains: called CC=1 SCAR=0.0
Pod documented
32 20 my ( $self, $other ) = @_;
33 20 return $self->equals($other);
34 }
35
36 12 ▶sub intersects {
Subroutine intersects: called CC=1 SCAR=0.0
Pod documented
37 12 my ( $self, $other ) = @_;
38 12 return $self->equals($other);
39 }
40
41 1708 ▶sub compare {
Subroutine compare: called CC=2 SCAR=7.1
Pod undocumented
42 1708 my ( $self, $other ) = @_;
43
44 1708 ▶ if ( $other->isa('Farly::Value::String') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($other->isa("Farly::Value::String")) 1708 0 1708
45 1708 return $self->as_string() cmp $other->as_string();
46 }
47 }
48
49 17 1;
50 __END__
« Farly/ASA/Parser.pm ↑ Summary Farly.pm »