Sawfish.pm

filter: Statementstmt 46.0% 23 / 50 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 54.5% 6 / 11 Podpod 40.0% 2 / 5 totaltotal 36.0% 31 / 86 CC 8 SCAR 24.5
CC
8
Cov
35%
canonical_display_name
30.0
new
12.0
get_server_version
6.0
CRAP 11.6
« Sawfish/XProp.pm ↑ Summary Sawfish/UNIX.pm »
1 package X11::WM::Sawfish;
2  
3 # Copyright (C) 2003 Craig B. Agricola. All rights reserved. This library is
4 # free software; you can redistribute it and/or modify it under the same terms
5 # as Perl itself.
6  
7 1 ▶use 5.005;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 require Exporter;
12  
13 1 our @ISA = qw(Exporter);
14 1 our @EXPORT_OK = qw();
15 1 our @EXPORT = qw();
16 1 our $VERSION = '0.03';
17  
18 1 ▶use Sys::Hostname;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use X11::WM::Sawfish::UNIX;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use X11::WM::Sawfish::XProp;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
24 0 my $package = shift(@_);
25 0 ▶ $package = ref($package) || $package;
Condition0%0/3
ref $package || $package
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $package || $package
ref $package $package
Truth table0%0/3
A || B
A= ref $packageB= $package
ABresult
1X1
011
000
26 0 my ($self) = new X11::WM::Sawfish::UNIX(@_);
27 0 ▶ if (!defined($self)) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self) 0 0 0
28 0 $self = new X11::WM::Sawfish::XProp(@_);
29 }
30 0 return($self);
31 }
32  
33 0 ▶sub canonical_display_name {
Subroutine canonical_display_name: not called CC=5 SCAR=34.0
Pod undocumented
34 0 my ($display) = @_;
35 0 ▶ if (!defined($display)) { $display = $ENV{"DISPLAY"}; }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $display) 0 0 0
36 0 $display =~ s/^unix:/:/;
37 0 ▶ if (substr($display, 0, 1) eq ":") {
Branch: 1 branch
BranchTrueFalseTotal
if (substr($display, 0, 1) eq ":") 0 0 0
38 0 $display = hostname() . $display;
39 }
40 0 my $i = index($display, ":");
41 0 ▶ if (($i > -1) && (index($display, ".", $i) == -1))
Branch: 1 branch
BranchTrueFalseTotal
if ($i > -1 and (index($display, ".", $i) == -1)) 0 0 0
Condition0%0/3
$i > -1 and (index($display, ".", $i) == -1)
!ll&&!rl&&r
000
MC/DC0%0/2
$i > -1 and (index($display, ".", $i) == -1)
$i > -1 (index($display, ".", $i) == -1)
Truth table0%0/3
A and B
A= $i > -1B= (index($display, ".", $i) == -1)
ABresult
0X0
100
111
42 {
43 0 $display .= ".0";
44 }
45 0 return($display);
46 }
47  
48 0 ▶sub sawfish_socket_name {
Subroutine sawfish_socket_name: not called CC=1 SCAR=6.9
Pod undocumented
49 0 my ($display) = @_;
50 0 my $socket = sprintf("/tmp/.sawfish-%s/%s",
51 (getpwuid($<))[0], canonical_display_name($display));
52 0 return($socket);
53 }
54  
55 0 ▶sub get_server_version {
Subroutine get_server_version: not called CC=2 SCAR=17.9
Pod undocumented
56 0 my ($self) = @_;
57 0 my ($response) = $self->eval_form("sawfish-version");
58 0 ▶ if (defined($response)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $response) 0 0 0
59 0 $response =~ s#^"##;
60 0 $response =~ s#"$##;
61 0 $self->{ServerVersion} = $response;
62 }
63 0 return($response);
64 }
65  
66 0 ▶sub ServerVersion {
Subroutine ServerVersion: not called CC=1 SCAR=6.9
Pod documented
67 0 return($_[0]->{ServerVersion});
68 }
69  
70 1 1;
71 __END__
« Sawfish/XProp.pm ↑ Summary Sawfish/UNIX.pm »