blib/lib/CPAN/Distrostatus.pm

filter: Statementstmt 88.0% 22 / 25 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 0.0% 0 / 6 totaltotal 69.5% 32 / 46 CC 4 SCAR 8.2
CC
4
Cov
81%
something_has_just_failed
6.0
text
2.1
new
2.0
CRAP 2.3
« blib/lib/CPAN/LWP/UserAgent.pm ↑ Summary blib/lib/CPAN/Exception/yaml_not_installed.pm »
1 # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
2 # vim: ts=4 sts=4 sw=4:
3 package CPAN::Distrostatus;
4 24 use overload '""' => "as_string",
5 24 ▶ fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 24 ▶use vars qw($something_has_failed_at);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 24 use vars qw(
8 $VERSION
9 24 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 24 $VERSION = "5.5";
11  
12  
13 sub new {
14 21 ▶ my($class,$arg) = @_;
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
15 21 my $failed = substr($arg,0,2) eq "NO";
16 21 ▶ if ($failed) {
Branch: 1 branch
BranchTrueFalseTotal
if ($failed) 4 17 21
17 4 $something_has_failed_at = $CPAN::CurrentCommandId;
18 }
19 bless {
20 21 TEXT => $arg,
21 FAILED => $failed,
22 COMMANDID => $CPAN::CurrentCommandId,
23 TIME => time,
24 }, $class;
25 }
26 sub something_has_just_failed () {
27 0 ▶ defined $something_has_failed_at &&
Subroutine something_has_just_failed: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
defined $something_has_failed_at and $something_has_failed_at == $CPAN::CurrentCommandId 0 0 0
28 $something_has_failed_at == $CPAN::CurrentCommandId;
29 }
30 0 ▶sub commandid { shift->{COMMANDID} }
Subroutine commandid: not called CC=1 SCAR=6.9
Pod undocumented
31 7 ▶sub failed { shift->{FAILED} }
Subroutine failed: called CC=1 SCAR=0.0
Pod undocumented
32 sub text {
33 25 ▶ my($self,$set) = @_;
Subroutine text: called CC=2 SCAR=7.6
Pod undocumented
34 25 ▶ if (defined $set) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $set) 0 25 25
35 0 $self->{TEXT} = $set;
36 }
37 25 $self->{TEXT};
38 }
39 sub as_string {
40 25 ▶ my($self) = @_;
Subroutine as_string: called CC=1 SCAR=0.0
Pod undocumented
41 25 $self->text;
42 }
43  
44  
45 24 1;
« blib/lib/CPAN/LWP/UserAgent.pm ↑ Summary blib/lib/CPAN/Exception/yaml_not_installed.pm »