PS1/Plugin/Date.pm

filter: Statementstmt 57.8% 11 / 19 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 48.3% 15 / 31 CC 3 SCAR 18.7
CC
3
Cov
46%
date
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« PS1/Plugin/Env.pm ↑ Summary PS1/Plugin/Ruby.pm »
1 package App::PS1::Plugin::Date;
2  
3 # Created on: 2011-06-21 09:48:24
4 # Create by: Ivan Wills
5 # $Id$
6 # $Revision$, $HeadURL$, $Date$
7 # $Revision$, $Source$, $Date$
8  
9 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use English qw/ -no_match_vars /;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 our $VERSION = 0.08;
14  
15 0 ▶sub date {
Subroutine date: not called CC=3 SCAR=24.8
Pod documented
16 0 my ($self, $options) = @_;
17  
18 0 my ($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
19 0 $year += 1900;
20 0 $mon++;
21 0 my $date = sprintf "%04d-%02d-%02d", $year, $mon, $mday;
22 0 ▶ if ( $self->cols && $self->cols > 60 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->cols and $self->cols > 60) 0 0 0
Condition0%0/3
$self->cols and $self->cols > 60
!ll&&!rl&&r
000
MC/DC0%0/2
$self->cols and $self->cols > 60
$self->cols $self->cols > 60
Truth table0%0/3
A and B
A= $self->colsB= $self->cols > 60
ABresult
0X0
100
111
23 0 $date .= sprintf " %02d:%02d:%02d", $hour, $min, $sec;
24 }
25  
26 0 return $self->surround( length $date, $self->colour('date') . $date );
27 }
28  
29 1 1;
30  
31 __END__
« PS1/Plugin/Env.pm ↑ Summary PS1/Plugin/Ruby.pm »