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);
@@ 1133-1137 (lines=5) @@
1130
            }
1131
        }
1132
1133
        if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
1134
            $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
1135
        } else {
1136
            $ProductClass->setCode(null);
1137
        }
1138
1139
        if (!isset($row[$headerByKey['stock_unlimited']])
1140
            || StringUtil::isBlank($row[$headerByKey['stock_unlimited']])
@@ 1311-1315 (lines=5) @@
1308
            }
1309
        }
1310
1311
        if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
1312
            $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
1313
        } else {
1314
            $ProductClass->setCode(null);
1315
        }
1316
1317
        if (!isset($row[$headerByKey['stock_unlimited']])
1318
            || StringUtil::isBlank($row[$headerByKey['stock_unlimited']])