Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 77-88 (lines=12) @@
74
	function get_services( $filter = 'all' ) {
75
		$services = array();
76
77
		if ( 'all' === $filter ) {
78
			return $services;
79
		} else {
80
			$connected_services = array();
81
			foreach ( $services as $service => $empty ) {
82
				$connections = $this->get_connections( $service );
83
				if ( $connections ) {
84
					$connected_services[ $service ] = $connections;
85
				}
86
			}
87
			return $connected_services;
88
		}
89
	}
90
91
	/**

projects/plugins/jetpack/modules/publicize/publicize-jetpack.php 1 location

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