| 1 | package NDFD::Weather::Report; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use 5.010000; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use SOAP::Lite;# + trace => 'debug'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use XML::Simple; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use version; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | our $VERSION=1.00; | |||||||||||||||||||||||||||
| 9 | 1 | require Exporter; | |||||||||||||||||||||||||||
| 10 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # Items to export into callers namespace by default. Note: do not export | ||||||||||||||||||||||||||||
| 13 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||||||||||||||||||||
| 14 | # Do not simply export all your public functions/methods/constants. | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | # This allows declaration use NDFD::Weather::Report ':all'; | ||||||||||||||||||||||||||||
| 17 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | ||||||||||||||||||||||||||||
| 18 | # will save memory. | ||||||||||||||||||||||||||||
| 19 | 1 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||||||||||||||||||||
| 20 | NDFDgen LatLonListCityNames GetCurrentWeather | ||||||||||||||||||||||||||||
| 21 | ) ] ); | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1 | our @EXPORT = qw( | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 0 | my $class = shift; | |||||||||||||||||||||||||||
| 31 | 0 | my %params=@_; | |||||||||||||||||||||||||||
| 32 | 0 | my $self ={ | |||||||||||||||||||||||||||
| 33 | %params, | ||||||||||||||||||||||||||||
| 34 | }; | ||||||||||||||||||||||||||||
| 35 | 0 | return bless $self, $class; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub _request{ | ||||||||||||||||||||||||||
|
Subroutine
_request: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 38 | 0 | my $class=shift; | |||||||||||||||||||||||||||
| 39 | 0 | my ($self)=shift; | |||||||||||||||||||||||||||
| 40 | $$self{'uri'} = ($$self{'uri'}) ? $$self{'uri'} : | ||||||||||||||||||||||||||||
| 41 | 'http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl', | ||||||||||||||||||||||||||||
| 42 | $$self{'proxy'} = ($$self{'proxy'}) ? $$self{'proxy'} : | ||||||||||||||||||||||||||||
| 43 | 'http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php', | ||||||||||||||||||||||||||||
| 44 | $$self{'EndPoint_url'} = ($$self{'EndPoint_url'}) ? $$self{'EndPoint_url'} : | ||||||||||||||||||||||||||||
| 45 | 'http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl', | ||||||||||||||||||||||||||||
| 46 | my $soap_request = SOAP::Lite | ||||||||||||||||||||||||||||
| 47 | -> uri($$self{'uri'}) | ||||||||||||||||||||||||||||
| 48 | 0 | ▶ | ->on_action(sub{join '#',@_ }) | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | -> proxy($$self{'proxy'} | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 50 | ); | ||||||||||||||||||||||||||||
| 51 | 0 | $soap_request->ns($$self{'EndPoint_url'}, 'ndf'); | |||||||||||||||||||||||||||
| 52 | 0 | $soap_request->envprefix('soapenv'); | |||||||||||||||||||||||||||
| 53 | 0 | $soap_request->readable(1); | |||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub Parse_XML_Data_decode{ | ||||||||||||||||||||||||||
|
Subroutine
Parse_XML_Data_decode: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 56 | 0 | my $class=shift; | |||||||||||||||||||||||||||
| 57 | 0 | my ($xml)=shift; | |||||||||||||||||||||||||||
| 58 | 0 | ▶ | if (SOAP::Deserializer->is_xml($xml)==1){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 0 | return eval{ | |||||||||||||||||||||||||||
| 60 | 0 | SOAP::Deserializer->decode($xml); | |||||||||||||||||||||||||||
| 61 | }; | ||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | ####error message marker no. 1 ### | ||||||||||||||||||||||||||||
| 65 | 0 | ▶ | print "xml_Data_parse_error","Xml parsing error: $@" if $@; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | 0 | ▶ | sub Parse_XML_deserialize{ | ||||||||||||||||||||||||||
|
Subroutine
Parse_XML_deserialize: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 68 | 0 | my $class=shift; | |||||||||||||||||||||||||||
| 69 | 0 | my ($xml)=shift; | |||||||||||||||||||||||||||
| 70 | 0 | ▶ | if (SOAP::Deserializer->is_xml($xml)==1){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | 0 | return eval{ | |||||||||||||||||||||||||||
| 72 | 0 | SOAP::Deserializer->deserialize($xml); | |||||||||||||||||||||||||||
| 73 | }; | ||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | ####error message marker no. 2 ### | ||||||||||||||||||||||||||||
| 77 | 0 | ▶ | print "xml_Data_parse_error","Xml parsing error: $@" if $@; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||
| 79 | 0 | ▶ | sub Parse_XML_Data{ | ||||||||||||||||||||||||||
|
Subroutine
Parse_XML_Data: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 80 | 0 | my $class=shift; | |||||||||||||||||||||||||||
| 81 | 0 | my ($xml)=shift; | |||||||||||||||||||||||||||
| 82 | 0 | return eval{ | |||||||||||||||||||||||||||
| 83 | 0 | XMLin($xml,ForceArray => 1,NormaliseSpace=>2,SuppressEmpty=>undef) | |||||||||||||||||||||||||||
| 84 | }; | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | ####error message marker no. 3 ### | ||||||||||||||||||||||||||||
| 87 | 0 | ▶ | print "xml_Data_parse_error","Xml parsing error: $@" if $@; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | package NDFD::Weather::Processer; | ||||||||||||||||||||||||||||
| 92 | 1 | ▶ | use NDFD::Weather::GenerateXML; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 93 | 1 | ▶ | use NDFD::Weather::RequestProcess; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 94 | 1 | our @ISA = qw(NDFD::Weather::Report); | |||||||||||||||||||||||||||
| 95 | 0 | ▶ | sub CornerPoints{ | ||||||||||||||||||||||||||
|
Subroutine
CornerPoints: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 96 | 0 | my $Process_Return1= | |||||||||||||||||||||||||||
| 97 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 98 | ->_CP(shift) | ||||||||||||||||||||||||||||
| 99 | ; | ||||||||||||||||||||||||||||
| 100 | 0 | ▶ | if(!$Process_Return1->valueof('//CornerPointsResponse/listLatLonOut/')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | if(!$Process_Return1->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | 0 | my $error_msg0 =$Process_Return1->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 104 | 0 | my $error_msg1 =$Process_Return1->valueof('//detail'); | |||||||||||||||||||||||||||
| 105 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 106 | }else{ | ||||||||||||||||||||||||||||
| 107 | return | ||||||||||||||||||||||||||||
| 108 | 0 | $Process_Return1 | |||||||||||||||||||||||||||
| 109 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||
| 112 | 0 | return $Process_Return1->valueof('//CornerPointsResponse/listLatLonOut/'); | |||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||
| 114 | 0 | ▶ | sub LatLonListCityNames{ | ||||||||||||||||||||||||||
|
Subroutine
LatLonListCityNames: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 115 | 0 | my $Process_Return2= | |||||||||||||||||||||||||||
| 116 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 117 | ->_LLLCN(shift) | ||||||||||||||||||||||||||||
| 118 | ; | ||||||||||||||||||||||||||||
| 119 | 0 | ▶ | if(!$Process_Return2->valueof('//LatLonListCityNamesResponse/listLatLonOut/')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 120 | 0 | ▶ | if(!$Process_Return2->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | 0 | my $error_msg0 =$Process_Return2->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 123 | 0 | my $error_msg1 =$Process_Return2->valueof('//detail'); | |||||||||||||||||||||||||||
| 124 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 125 | }else{ | ||||||||||||||||||||||||||||
| 126 | return | ||||||||||||||||||||||||||||
| 127 | 0 | $Process_Return2 | |||||||||||||||||||||||||||
| 128 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||
| 131 | 0 | return $Process_Return2->valueof('//LatLonListCityNamesResponse/listLatLonOut/'); | |||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||
| 133 | 0 | ▶ | sub LatLonListZipCode{ | ||||||||||||||||||||||||||
|
Subroutine
LatLonListZipCode: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 134 | 0 | my $Process_Return3= | |||||||||||||||||||||||||||
| 135 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 136 | ->_LLLZC(shift) | ||||||||||||||||||||||||||||
| 137 | ; | ||||||||||||||||||||||||||||
| 138 | 0 | ▶ | if(!$Process_Return3->valueof('//LatLonListZipCodeResponse/listLatLonOut/')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 139 | 0 | ▶ | if(!$Process_Return3->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||
| 141 | 0 | my $error_msg0 =$Process_Return3->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 142 | 0 | my $error_msg1 =$Process_Return3->valueof('//detail'); | |||||||||||||||||||||||||||
| 143 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 144 | }else{ | ||||||||||||||||||||||||||||
| 145 | return | ||||||||||||||||||||||||||||
| 146 | 0 | $Process_Return3 | |||||||||||||||||||||||||||
| 147 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||
| 150 | 0 | return $Process_Return3->valueof('//LatLonListZipCodeResponse/listLatLonOut/'); | |||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||
| 152 | 0 | ▶ | sub NDFDgenByDay{ | ||||||||||||||||||||||||||
|
Subroutine
NDFDgenByDay: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 153 | 0 | my $Process_Return4= | |||||||||||||||||||||||||||
| 154 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 155 | ->_NDFDGBD(shift); | ||||||||||||||||||||||||||||
| 156 | 0 | ▶ | if(!$Process_Return4->valueof('//NDFDgenByDayResponse/dwmlByDayOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 157 | 0 | ▶ | if(!$Process_Return4->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | 0 | my $error_msg0 =$Process_Return4->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 160 | 0 | my $error_msg1 =$Process_Return4->valueof('//detail'); | |||||||||||||||||||||||||||
| 161 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 162 | }else{ | ||||||||||||||||||||||||||||
| 163 | return | ||||||||||||||||||||||||||||
| 164 | 0 | $Process_Return4 | |||||||||||||||||||||||||||
| 165 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||
| 168 | 0 | return $Process_Return4->valueof('//NDFDgenByDayResponse/dwmlByDayOut'); | |||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||
| 170 | 0 | ▶ | sub NDFDgenByDayLatLonList{ | ||||||||||||||||||||||||||
|
Subroutine
NDFDgenByDayLatLonList: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 171 | 0 | my $Process_Return5= | |||||||||||||||||||||||||||
| 172 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 173 | ->_NDFDGBDLLL(shift) | ||||||||||||||||||||||||||||
| 174 | ; | ||||||||||||||||||||||||||||
| 175 | 0 | ▶ | if(!$Process_Return5->valueof('//NDFDgenByDayLatLonListResponse/dwmlByDayOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 176 | 0 | ▶ | if(!$Process_Return5->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 0 | my $error_msg0 =$Process_Return5->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 179 | 0 | my $error_msg1 =$Process_Return5->valueof('//detail'); | |||||||||||||||||||||||||||
| 180 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 181 | }else{ | ||||||||||||||||||||||||||||
| 182 | return | ||||||||||||||||||||||||||||
| 183 | 0 | $Process_Return5 | |||||||||||||||||||||||||||
| 184 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||
| 187 | 0 | return $Process_Return5->valueof('//NDFDgenByDayLatLonListResponse/dwmlByDayOut'); | |||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||
| 189 | 0 | ▶ | sub GmlLatLonList{ | ||||||||||||||||||||||||||
|
Subroutine
GmlLatLonList: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 190 | 0 | my $Process_Return6 = | |||||||||||||||||||||||||||
| 191 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 192 | ->_GLLL(shift) | ||||||||||||||||||||||||||||
| 193 | ; | ||||||||||||||||||||||||||||
| 194 | 0 | ▶ | if(!$Process_Return6->valueof('//GmlLatLonListResponse/dwGmlOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 195 | 0 | ▶ | if(!$Process_Return6->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 0 | my $error_msg0 =$Process_Return6->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 198 | 0 | my $error_msg1 =$Process_Return6->valueof('//detail'); | |||||||||||||||||||||||||||
| 199 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 200 | }else{ | ||||||||||||||||||||||||||||
| 201 | return | ||||||||||||||||||||||||||||
| 202 | 0 | $Process_Return6 | |||||||||||||||||||||||||||
| 203 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||
| 206 | #else{return $Process_Return6->valueof('//GmlLatLonListResponse/dwGmlOut')}; | ||||||||||||||||||||||||||||
| 207 | 0 | return $Process_Return6->valueof('//GmlLatLonListResponse/dwGmlOut'); | |||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||
| 209 | 0 | ▶ | sub NDFDgen{ | ||||||||||||||||||||||||||
|
Subroutine
NDFDgen: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 210 | 0 | my $Process_Return7 = | |||||||||||||||||||||||||||
| 211 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 212 | ->_NDFDG(shift) | ||||||||||||||||||||||||||||
| 213 | ; | ||||||||||||||||||||||||||||
| 214 | 0 | ▶ | if(!$Process_Return7->valueof('//NDFDgenResponse/dwmlOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 215 | 0 | ▶ | if(!$Process_Return7->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | 0 | my $error_msg0 =$Process_Return7->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 218 | 0 | my $error_msg1 =$Process_Return7->valueof('//detail'); | |||||||||||||||||||||||||||
| 219 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 220 | }else{ | ||||||||||||||||||||||||||||
| 221 | return | ||||||||||||||||||||||||||||
| 222 | 0 | $Process_Return7 | |||||||||||||||||||||||||||
| 223 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||
| 226 | 0 | return $Process_Return7->valueof('//NDFDgenResponse/dwmlOut'); | |||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | 0 | ▶ | sub GmlTimeSeries{ | ||||||||||||||||||||||||||
|
Subroutine
GmlTimeSeries: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 230 | 0 | my $Process_Return8 = | |||||||||||||||||||||||||||
| 231 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 232 | ->_GTS(shift) | ||||||||||||||||||||||||||||
| 233 | ; | ||||||||||||||||||||||||||||
| 234 | 0 | ▶ | if(!$Process_Return8->valueof('//GmlTimeSeriesResponse/dwGmlOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 235 | #&debug($Process_Return8 | ||||||||||||||||||||||||||||
| 236 | # ->valueof('//ExceptionText')); | ||||||||||||||||||||||||||||
| 237 | 0 | ▶ | if(!$Process_Return8->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | 0 | my $error_msg0 =$Process_Return8->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 240 | 0 | my $error_msg1 =$Process_Return8->valueof('//detail'); | |||||||||||||||||||||||||||
| 241 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 242 | }else{ | ||||||||||||||||||||||||||||
| 243 | return | ||||||||||||||||||||||||||||
| 244 | 0 | $Process_Return8 | |||||||||||||||||||||||||||
| 245 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||
| 249 | 0 | return $Process_Return8->valueof('//GmlTimeSeriesResponse/dwGmlOut'); | |||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||
| 251 | 0 | ▶ | sub LatLonListLine{ | ||||||||||||||||||||||||||
|
Subroutine
LatLonListLine: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 252 | 0 | my $Process_Return9 = | |||||||||||||||||||||||||||
| 253 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 254 | ->_LLLL(shift) | ||||||||||||||||||||||||||||
| 255 | ; | ||||||||||||||||||||||||||||
| 256 | 0 | ▶ | if(!$Process_Return9->valueof('//LatLonListLineResponse/listLatLonOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 257 | 0 | ▶ | if(!$Process_Return9->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||
| 259 | 0 | my $error_msg0 =$Process_Return9->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 260 | 0 | my $error_msg1 =$Process_Return9->valueof('//detail'); | |||||||||||||||||||||||||||
| 261 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 262 | }else{ | ||||||||||||||||||||||||||||
| 263 | return | ||||||||||||||||||||||||||||
| 264 | 0 | $Process_Return9 | |||||||||||||||||||||||||||
| 265 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||
| 269 | 0 | return $Process_Return9->valueof('//LatLonListLineResponse/listLatLonOut'); | |||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||
| 271 | 0 | ▶ | sub LatLonListSquare{ | ||||||||||||||||||||||||||
|
Subroutine
LatLonListSquare: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 272 | 0 | my $Process_Return10 = | |||||||||||||||||||||||||||
| 273 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 274 | ->_LLLS(shift) | ||||||||||||||||||||||||||||
| 275 | ; | ||||||||||||||||||||||||||||
| 276 | 0 | ▶ | if(!$Process_Return10->valueof('//LatLonListSquareResponse/listLatLonOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 277 | 0 | ▶ | if(!$Process_Return10->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||
| 279 | 0 | my $error_msg0 =$Process_Return10->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 280 | 0 | my $error_msg1 =$Process_Return10->valueof('//detail'); | |||||||||||||||||||||||||||
| 281 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 282 | }else{ | ||||||||||||||||||||||||||||
| 283 | return | ||||||||||||||||||||||||||||
| 284 | 0 | $Process_Return10 | |||||||||||||||||||||||||||
| 285 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||
| 289 | 0 | return $Process_Return10->valueof('//LatLonListSquareResponse/listLatLonOut'); | |||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||
| 291 | 0 | ▶ | sub LatLonListSubgrid{ | ||||||||||||||||||||||||||
|
Subroutine
LatLonListSubgrid: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 292 | 0 | my $Process_Return11 = | |||||||||||||||||||||||||||
| 293 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 294 | ->_LLLSBD(shift) | ||||||||||||||||||||||||||||
| 295 | ; | ||||||||||||||||||||||||||||
| 296 | 0 | ▶ | if(!$Process_Return11->valueof('//LatLonListSubgridResponse/listLatLonOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 297 | 0 | ▶ | if(!$Process_Return11->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||
| 299 | 0 | my $error_msg0 =$Process_Return11->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 300 | 0 | my $error_msg1 =$Process_Return11->valueof('//detail'); | |||||||||||||||||||||||||||
| 301 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 302 | }else{ | ||||||||||||||||||||||||||||
| 303 | return | ||||||||||||||||||||||||||||
| 304 | 0 | $Process_Return11 | |||||||||||||||||||||||||||
| 305 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||
| 309 | 0 | return $Process_Return11->valueof('//LatLonListSubgridResponse/listLatLonOut'); | |||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||
| 311 | 0 | ▶ | sub NDFDgenLatLonList{ | ||||||||||||||||||||||||||
|
Subroutine
NDFDgenLatLonList: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 312 | 0 | my $Process_Return12 = | |||||||||||||||||||||||||||
| 313 | NDFD::Weather::RequestProcess | ||||||||||||||||||||||||||||
| 314 | ->_NDFDLLLT(shift) | ||||||||||||||||||||||||||||
| 315 | ; | ||||||||||||||||||||||||||||
| 316 | 0 | ▶ | if(!$Process_Return12->valueof('//NDFDgenLatLonListResponse/dwmlOut')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 317 | |||||||||||||||||||||||||||||
| 318 | 0 | ▶ | if(!$Process_Return12->valueof('//ExceptionText')){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||
| 320 | 0 | my $error_msg0 =$Process_Return12->valueof('//faultstring'); | |||||||||||||||||||||||||||
| 321 | 0 | my $error_msg1 =$Process_Return12->valueof('//detail'); | |||||||||||||||||||||||||||
| 322 | 0 | return "Error :-".$error_msg0.". Details :- ".$error_msg1; | |||||||||||||||||||||||||||
| 323 | }else{ | ||||||||||||||||||||||||||||
| 324 | return | ||||||||||||||||||||||||||||
| 325 | 0 | $Process_Return12 | |||||||||||||||||||||||||||
| 326 | ->valueof('//ExceptionText'); | ||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||
| 330 | 0 | return $Process_Return12->valueof('//NDFDgenLatLonListResponse/dwmlOut'); | |||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||
| 332 | 0 | ▶ | sub GetCurrentWeather{ | ||||||||||||||||||||||||||
|
Subroutine
GetCurrentWeather: not called CC=4 SCAR=25.8
| |||||||||||||||||||||||||||||
| 333 | 0 | shift; | |||||||||||||||||||||||||||
| 334 | 0 | my $latitude=shift; | |||||||||||||||||||||||||||
| 335 | 0 | my $longitude=shift; | |||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||
| 338 | 0 | ▶ | die "latitude or longitude vlaue is missing !!" unless defined $latitude and $longitude; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $latitude and $longitude
MC/DC0%0/2
defined $latitude and $longitude
defined $latitude
$longitude
Truth table0%0/3
A and B
A= defined $latitudeB= $longitude
| |||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||
| 340 | 1 | ▶ | use LWP::Simple; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 341 | 0 | my $url = "http://forecast.weather.gov/MapClick.php?lat=$latitude&lon=$longitude&unit=0&lg=english&FcstType=dwml"; | |||||||||||||||||||||||||||
| 342 | 0 | my $content = get $url; | |||||||||||||||||||||||||||
| 343 | 0 | ▶ | die "Couldn't get $url" unless defined $content; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 344 | #$q->header('text/xml'); | ||||||||||||||||||||||||||||
| 345 | 0 | return $content; | |||||||||||||||||||||||||||
| 346 | } | ||||||||||||||||||||||||||||
| 347 | #sub debug{ | ||||||||||||||||||||||||||||
| 348 | # my $messsage=shift; | ||||||||||||||||||||||||||||
| 349 | # print $messsage; | ||||||||||||||||||||||||||||
| 350 | #} | ||||||||||||||||||||||||||||
| 351 | 1 | 1; | |||||||||||||||||||||||||||
| 352 | __END__ | ||||||||||||||||||||||||||||