Nopaste/Service/Codepeek.pm

filter: Statementstmt 50.0% 12 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 51.4% 18 / 35 CC 2 SCAR 10.0
CC
2
Cov
46%
return
6.0
uri
2.0
fill_form
2.0
CRAP 2.7
« Nopaste/Service.pm ↑ Summary Nopaste/Service/Mojopaste.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package App::Nopaste::Service::Codepeek;
4 # ABSTRACT: (DEPRECATED) Service for Codepeek - http://codepeek.com
5  
6 1 our $VERSION = '1.013';
7  
8 1 ▶use parent 'App::Nopaste::Service';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 warnings::warnif('deprecated', 'codepeek.com is offline, so this service no longer works');
11  
12 0 ▶sub uri { 'http://codepeek.com/paste' }
Subroutine uri: not called CC=1 SCAR=6.9
Pod documented
13  
14 0 ▶sub fill_form {
Subroutine fill_form: not called CC=1 SCAR=6.9
Pod documented
15 0 my $self = shift;
16 0 my $mech = shift;
17 0 my %args = @_;
18  
19 0 $mech->form_number(1);
20  
21 $mech->submit_form(
22 fields => {
23 'paste' => $args{text},
24 'language' => ucfirst $args{lang},
25 'privacy' => $args{private},
26 },
27 0 );
28 }
29  
30 0 ▶sub return {
Subroutine return: not called CC=2 SCAR=17.9
Pod documented
31 0 my $self = shift;
32 0 my $mech = shift;
33  
34 0 my $link = $mech->find_link( text_regex => qr#^http://codepeek.com/paste/[a-z0-9]+$#i );
35 0 my $url = $link->url;
36 0 ▶ return (0, "Could not construct paste link.") if !$url;
Branch: 1 branch
BranchTrueFalseTotal
unless $url 0 0 0
37 0 return (1, $url);
38 }
39  
40 1 1;
41  
42 __END__
« Nopaste/Service.pm ↑ Summary Nopaste/Service/Mojopaste.pm »