| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public static function getRate($to,$from,$pounds,$ounces,$service) |
||
| 12 | { |
||
| 13 | $rate = new \SimpleXMLElement("<RateV4Request></RateV4Request>"); |
||
| 14 | $rate->addAttribute('USERID', self::$user); |
||
| 15 | $revision = $rate->addChild("Revision",'2'); |
||
|
|
|||
| 16 | $pack = $rate->addChild('Package'); |
||
| 17 | $pack->addAttribute('ID','0'); |
||
| 18 | $pack->addChild('Service',$service); |
||
| 19 | $pack->addChild('ZipOrigination',$from); |
||
| 20 | $pack->addChild('ZipDestination',$to); |
||
| 21 | $pack->addChild('Pounds',$pounds); |
||
| 22 | $pack->addChild('Ounces',$ounces); |
||
| 23 | $pack->addChild('Container','VARIABLE'); |
||
| 24 | $pack->addChild('Size','Regular'); |
||
| 25 | $url = self::$service . '&XML='.$rate->asXML(); |
||
| 26 | return simplexml_load_file($url); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.