Code Duplication    Length = 11-13 lines in 2 locations

phpsysinfo/includes/os/class.FreeBSD.inc.php 2 locations

@@ 73-83 (lines=11) @@
70
                        $dev = new NetDevice();
71
                        $dev->setName($ar_buf[0]);
72
                        if (strlen($ar_buf[3]) < 17) { /* no Address */
73
                            if (isset($ar_buf[11]) && (trim($ar_buf[11]) != '')) { /* Idrop column exist*/
74
                              $dev->setTxBytes($ar_buf[9]);
75
                              $dev->setRxBytes($ar_buf[6]);
76
                              $dev->setErrors($ar_buf[4] + $ar_buf[8]);
77
                              $dev->setDrops($ar_buf[11] + $ar_buf[5]);
78
                            } else {
79
                              $dev->setTxBytes($ar_buf[8]);
80
                              $dev->setRxBytes($ar_buf[5]);
81
                              $dev->setErrors($ar_buf[4] + $ar_buf[7]);
82
                              $dev->setDrops($ar_buf[10]);
83
                            }
84
                        } else {
85
                            if (isset($ar_buf[12]) && (trim($ar_buf[12]) != '')) { /* Idrop column exist*/
86
                              $dev->setTxBytes($ar_buf[10]);
@@ 84-96 (lines=13) @@
81
                              $dev->setErrors($ar_buf[4] + $ar_buf[7]);
82
                              $dev->setDrops($ar_buf[10]);
83
                            }
84
                        } else {
85
                            if (isset($ar_buf[12]) && (trim($ar_buf[12]) != '')) { /* Idrop column exist*/
86
                              $dev->setTxBytes($ar_buf[10]);
87
                              $dev->setRxBytes($ar_buf[7]);
88
                              $dev->setErrors($ar_buf[5] + $ar_buf[9]);
89
                              $dev->setDrops($ar_buf[12] + $ar_buf[6]);
90
                            } else {
91
                              $dev->setTxBytes($ar_buf[9]);
92
                              $dev->setRxBytes($ar_buf[6]);
93
                              $dev->setErrors($ar_buf[5] + $ar_buf[8]);
94
                              $dev->setDrops($ar_buf[11]);
95
                            }
96
                        }
97
                        if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig', $ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {
98
                            $bufe2 = preg_split("/\n/", $bufr2, -1, PREG_SPLIT_NO_EMPTY);
99
                            foreach ($bufe2 as $buf2) {