Code Duplication    Length = 14-14 lines in 2 locations

json-endpoints/class.wpcom-json-api-get-comments-tree-v1-1-endpoint.php 1 location

@@ 67-80 (lines=14) @@
64
			if ( ! isset( $comments[ $comment_post_id ] ) ) {
65
				$comments[ $comment_post_id ] = array( array(), array() );
66
			}
67
			switch ( $row[3] ) {
68
				case 'trackback':
69
					$trackbacks[ $comment_post_id ][] = $comment_id;
70
					break;
71
				case 'pingback':
72
					$pingbacks[ $comment_post_id ][] = $comment_id;
73
					break;
74
				default:
75
					if ( 0 === $comment_parent_id ) {
76
						$comments[ $comment_post_id ][0][] = $comment_id;
77
					} else {
78
						$comments[ $comment_post_id ][1][] = array( $comment_id, $comment_parent_id );
79
					}
80
			}
81
		}
82
83
		return array(

json-endpoints/class.wpcom-json-api-get-comments-tree-v1-2-endpoint.php 1 location

@@ 92-105 (lines=14) @@
89
			if ( ! isset( $comments[ $comment_post_id ] ) ) {
90
				$comments[ $comment_post_id ] = array( array(), array() );
91
			}
92
			switch ( $row[2] ) {
93
				case 'trackback':
94
					$trackbacks[ $comment_post_id ][] = $comment_id;
95
					break;
96
				case 'pingback':
97
					$pingbacks[ $comment_post_id ][] = $comment_id;
98
					break;
99
				default:
100
					if ( 0 === $comment_parent_id ) {
101
						$comments[ $comment_post_id ][0][] = $comment_id;
102
					} else {
103
						$comments[ $comment_post_id ][1][] = array( $comment_id, $comment_parent_id );
104
					}
105
			}
106
		}
107
108
		return array(