Code Duplication    Length = 5-7 lines in 6 locations

src/Eccube/Controller/Admin/Product/CsvImportController.php 6 locations

@@ 298-304 (lines=7) @@
295
                            $Product->setName(StringUtil::trimAll($row[$headerByKey['name']]));
296
                        }
297
298
                        if (isset($row[$headerByKey['note']])) {
299
                            if (StringUtil::isNotBlank($row[$headerByKey['note']])) {
300
                                $Product->setNote(StringUtil::trimAll($row[$headerByKey['note']]));
301
                            } else {
302
                                $Product->setNote(null);
303
                            }
304
                        }
305
306
                        if (isset($row[$headerByKey['description_list']])) {
307
                            if (StringUtil::isNotBlank($row[$headerByKey['description_list']])) {
@@ 306-312 (lines=7) @@
303
                            }
304
                        }
305
306
                        if (isset($row[$headerByKey['description_list']])) {
307
                            if (StringUtil::isNotBlank($row[$headerByKey['description_list']])) {
308
                                $Product->setDescriptionList(StringUtil::trimAll($row[$headerByKey['description_list']]));
309
                            } else {
310
                                $Product->setDescriptionList(null);
311
                            }
312
                        }
313
314
                        if (isset($row[$headerByKey['description_detail']])) {
315
                            if (StringUtil::isNotBlank($row[$headerByKey['description_detail']])) {
@@ 333-339 (lines=7) @@
330
                            }
331
                        }
332
333
                        if (isset($row[$headerByKey['search_word']])) {
334
                            if (StringUtil::isNotBlank($row[$headerByKey['search_word']])) {
335
                                $Product->setSearchWord(StringUtil::trimAll($row[$headerByKey['search_word']]));
336
                            } else {
337
                                $Product->setSearchWord(null);
338
                            }
339
                        }
340
341
                        if (isset($row[$headerByKey['free_area']])) {
342
                            if (StringUtil::isNotBlank($row[$headerByKey['free_area']])) {
@@ 341-347 (lines=7) @@
338
                            }
339
                        }
340
341
                        if (isset($row[$headerByKey['free_area']])) {
342
                            if (StringUtil::isNotBlank($row[$headerByKey['free_area']])) {
343
                                $Product->setFreeArea(StringUtil::trimAll($row[$headerByKey['free_area']]));
344
                            } else {
345
                                $Product->setFreeArea(null);
346
                            }
347
                        }
348
349
                        // 商品画像登録
350
                        $this->createProductImage($row, $Product, $data, $headerByKey);
@@ 1132-1136 (lines=5) @@
1129
            }
1130
        }
1131
1132
        if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
1133
            $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
1134
        } else {
1135
            $ProductClass->setCode(null);
1136
        }
1137
1138
        if (!isset($row[$headerByKey['stock_unlimited']])
1139
            || StringUtil::isBlank($row[$headerByKey['stock_unlimited']])
@@ 1310-1314 (lines=5) @@
1307
            }
1308
        }
1309
1310
        if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
1311
            $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
1312
        } else {
1313
            $ProductClass->setCode(null);
1314
        }
1315
1316
        if (!isset($row[$headerByKey['stock_unlimited']])
1317
            || StringUtil::isBlank($row[$headerByKey['stock_unlimited']])