Code Duplication    Length = 10-10 lines in 2 locations

phpsysinfo/plugins/bat/class.bat.inc.php 2 locations

@@ 93-102 (lines=10) @@
90
                    }
91
                    $techn = '';
92
                    if (isset($bufferWB[0]['Chemistry'])) {
93
                        switch ($bufferWB[0]['Chemistry']) {
94
                            case 1: $techn = 'Other'; break;
95
                            case 2: $techn = 'Unknown'; break;
96
                            case 3: $techn = 'PbAc'; break;
97
                            case 4: $techn = 'NiCd'; break;
98
                            case 5: $techn = 'NiMH'; break;
99
                            case 6: $techn = 'Li-ion'; break;
100
                            case 7: $techn = 'Zinc-air'; break;
101
                            case 8: $techn = 'Li-poly'; break;
102
                        }
103
                    }
104
                    $bufferWPB = CommonFunctions::getWMI($_cim, 'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity', 'FullChargeCapacity'));
105
                    if (isset($bufferWPB[0]['DesignVoltage'])) {
@@ 110-119 (lines=10) @@
107
                    }
108
                    // sometimes Chemistry from Win32_Battery returns 2 but Win32_PortableBattery returns e.g. 6
109
                    if ((($techn == '') || ($techn == 'Unknown')) && isset($bufferWPB[0]['Chemistry'])) {
110
                        switch ($bufferWPB[0]['Chemistry']) {
111
                            case 1: $techn = 'Other'; break;
112
                            case 2: $techn = 'Unknown'; break;
113
                            case 3: $techn = 'PbAc'; break;
114
                            case 4: $techn = 'NiCd'; break;
115
                            case 5: $techn = 'NiMH'; break;
116
                            case 6: $techn = 'Li-ion'; break;
117
                            case 7: $techn = 'Zinc-air'; break;
118
                            case 8: $techn = 'Li-poly'; break;
119
                        }
120
                    }
121
                    if ($techn != '') $buffer_info .= 'POWER_SUPPLY_TECHNOLOGY='.$techn."\n";
122