Nopaste/Service/Mojopaste.pm

filter: Statementstmt 48.0% 12 / 25 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 3 / 3 totaltotal 52.6% 20 / 38 CC 3 SCAR 9.8
CC
3
Cov
45%
fill_form
6.0
uri
2.1
return
2.0
CRAP 2.7
« Nopaste/Service/Codepeek.pm ↑ Summary Nopaste/Service/Shadowcat.pm »
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package App::Nopaste::Service::Mojopaste;
4 # ABSTRACT: Service provider for mojopaste
5  
6 2 our $VERSION = '1.013';
7  
8 2 ▶use parent 'App::Nopaste::Service';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶sub uri { $ENV{NOPASTE_MOJOPASTE_WEBPATH} || 'https://ssl.thorsen.pm/paste' }
Subroutine uri: called CC=2 SCAR=7.6
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$ENV{"NOPASTE_MOJOPASTE_WEBPATH"} or "https://ssl.thorsen.pm/paste" 0 1 1
11  
12 0 ▶sub fill_form {
Subroutine fill_form: not called CC=2 SCAR=17.9
Pod documented
13 0 my $self = shift;
14 0 my $mech = shift;
15 0 my %args = @_;
16  
17 # Hack around bot protection
18 0 my $form = $mech->form_number(1);
19 0 my $action = $form->action;
20 0 ▶ if ($action =~ m{/invalid$}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($action =~ m[/invalid$]) 0 0 0
21 0 $action =~ s{/invalid$}{};
22 0 $form->action($action);
23 }
24  
25 $mech->submit_form(
26 fields => {
27 p => 1,
28 paste => $args{text},
29 },
30 0 );
31  
32 }
33  
34 0 ▶sub return {
Subroutine return: not called CC=1 SCAR=6.9
Pod documented
35 0 my $self = shift;
36 0 my $mech = shift;
37  
38 0 my $link = $mech->uri();
39  
40 0 return (1, $link);
41 }
42  
43  
44 2 1;
45  
46 __END__
« Nopaste/Service/Codepeek.pm ↑ Summary Nopaste/Service/Shadowcat.pm »