Code Duplication    Length = 4-9 lines in 2 locations

projects/plugins/jetpack/modules/sharedaddy/sharing-service.php 2 locations

@@ 468-476 (lines=9) @@
465
		if ( ! $_blog_id ) {
466
			$_blog_id = $blog_id;
467
		}
468
		if ( $service_name == false ) {
469
			if ( $post_id > 0 ) {
470
				// total number of shares for this post
471
				return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d', $_blog_id, $post_id ) );
472
			} else {
473
				// total number of shares for this blog
474
				return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d', $_blog_id ) );
475
			}
476
		}
477
478
		if ( $post_id > 0 ) {
479
			return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s', $_blog_id, $post_id, $service_name ) );
@@ 478-481 (lines=4) @@
475
			}
476
		}
477
478
		if ( $post_id > 0 ) {
479
			return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND post_id = %d AND share_service = %s', $_blog_id, $post_id, $service_name ) );
480
		} else {
481
			return (int) $wpdb->get_var( $wpdb->prepare( 'SELECT SUM( count ) FROM sharing_stats WHERE blog_id = %d AND share_service = %s', $_blog_id, $service_name ) );
482
		}
483
	}
484