lib/YAMLScript/Core.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 4 totaltotal 79.5% 35 / 44 CC 2 SCAR 2.7
CC
2
Cov
90%
ends_with_q
2.0
read_string_ys
2.0
BEGIN
1.0
CRAP 1.3
« lib/YAMLScript/Main.pm ↑ Summary lib/YAMLScript/Common.pm »
1 20 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package YAMLScript::Core;
3  
4 20 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 20 ▶use YAMLScript::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub dirname {
Subroutine dirname: called CC=1 SCAR=0.0
Pod undocumented
9 1 my ($file_path) = @_;
10 20 ▶ use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 my(undef, $dirname, undef) = File::Spec->splitpath($file_path);
12 1 STRING->new($dirname);
13 }
14  
15 11 ▶sub ends_with_q {
Subroutine ends_with_q: called CC=2 SCAR=7.1
Pod undocumented
16 11 my ($str, $substr) = @_;
17 11 ▶ BOOLEAN->new(
Condition66%2/3
length "$str" >= length "$substr" && substr("$str", 0 - length("$substr")) eq "$substr"
!ll&&!rl&&r
0110
MC/DC50%1/2
length "$str" >= length "$substr" && substr("$str", 0 - length("$substr")) eq "$substr"
length "$str" >= length "$substr" substr("$str", 0 - length("$substr")) eq "$substr"
Truth table66%2/3
A && B
A= length "$str" >= length "$substr"B= substr("$str", 0 - length("$substr")) eq "$substr"
ABresult
0X0
100
111
18 length("$str") >= length("$substr") and
19 substr("$str", 0-length("$substr")) eq "$substr"
20 );
21 }
22  
23 9 ▶sub read_file_ys {
Subroutine read_file_ys: called CC=1 SCAR=0.0
Pod undocumented
24 9 my ($file) = @_;
25 9 my $text = RT->slurp_file($file);
26 9 RT->reader->read_ys($text, $file);
27 }
28  
29 0 ▶sub read_string_ys {
Subroutine read_string_ys: not called CC=1 SCAR=6.9
Pod undocumented
30 0 my ($string) = @_;
31 0 RT->reader->read_ys($string, undef);
32 }
33  
34 20 1;
« lib/YAMLScript/Main.pm ↑ Summary lib/YAMLScript/Common.pm »