Code Duplication    Length = 14-16 lines in 2 locations

services/WordPress/WordPressQueryProvider.php 2 locations

@@ 333-348 (lines=16) @@
330
                }
331
                        
332
                $result = $this->_serializeCategories($stmt);
333
            } else if ($navigationPropName == 'Comments') {
334
                $query = "SELECT * FROM `wp_comments`"
335
                       ." WHERE comment_approved = 1" 
336
                       ." AND comment_post_ID = $sourceEntityInstance->PostID";
337
                if ($filter !== null) {
338
                    $query .= " AND $filter";
339
                }
340
                $stmt = mysql_query($query);
341
                if ( $stmt === false) {
342
                    die(mysql_error());
343
                }
344
                        
345
                $result = $this->_serializeComments($stmt);
346
            } else {
347
                die('Post does not have navigation porperty with name: ' . $navigationPropName);
348
            }
349
            break;
350
351
        case ($srcClass == 'Tag'):
@@ 420-433 (lines=14) @@
417
                }
418
                            
419
                $result = $this->_serializePosts($stmt);
420
            } elseif ($navigationPropName == 'Comments') {
421
                $query = "SELECT * FROM `wp_comments`"
422
                     ." WHERE comment_approved = 1" 
423
                     ." AND wp_comments.user_id = $sourceEntityInstance->UserID";
424
                if ($filter !== null) {
425
                    $query .= " AND $filter";
426
                }
427
                $stmt = mysql_query($query);
428
                if ( $stmt === false) {            
429
                    die(mysql_error());
430
                }
431
                        
432
                $result = $this->_serializeComments($stmt);
433
            } else {
434
                die('User does not have navigation porperty with name: ' . $navigationPropName);
435
            }
436
            break;