Code Duplication    Length = 12-12 lines in 2 locations

_inc/lib/class.jetpack-keyring-service-helper.php 1 location

@@ 50-61 (lines=12) @@
47
48
		);
49
50
		if ( 'all' == $filter ) {
51
			return $services;
52
		} else {
53
			$connected_services = array();
54
			foreach ( $services as $service => $empty ) {
55
				$connections = $this->get_connections( $service );
56
				if ( $connections ) {
57
					$connected_services[ $service ] = $connections;
58
				}
59
			}
60
			return $connected_services;
61
		}
62
	}
63
64
	/**

modules/publicize/publicize-jetpack.php 1 location

@@ 304-315 (lines=12) @@
301
			'google_plus' => array(),
302
		);
303
304
		if ( 'all' == $filter ) {
305
			return $services;
306
		} else {
307
			$connected_services = array();
308
			foreach ( $services as $service => $empty ) {
309
				$connections = $this->get_connections( $service, $_blog_id, $_user_id );
310
				if ( $connections ) {
311
					$connected_services[ $service ] = $connections;
312
				}
313
			}
314
			return $connected_services;
315
		}
316
	}
317
318
	function get_connection( $service, $id, $_blog_id = false, $_user_id = false ) {