Code Duplication    Length = 12-12 lines in 2 locations

modules/calypsoify/class.jetpack-calypsoify.php 2 locations

@@ 347-358 (lines=12) @@
344
		);
345
		return in_array( $origin, $allowed, true ) ? $origin : 'https://wordpress.com';
346
347
		function get_site_suffix() {
348
			if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) {
349
				$site_suffix = Jetpack::build_raw_urls( home_url() );
350
			} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
351
				$site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
352
			}
353
354
			if ( $site_suffix ) {
355
				return "/${site_suffix}";
356
			}
357
			return '';
358
		}
359
	}
360
361
	/**
@@ 369-380 (lines=12) @@
366
	 *
367
	 * @return string
368
	 */
369
	private function get_site_suffix() {
370
		if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'build_raw_urls' ) ) {
371
			$site_suffix = Jetpack::build_raw_urls( home_url() );
372
		} elseif ( class_exists( 'WPCOM_Masterbar' ) && method_exists( 'WPCOM_Masterbar', 'get_calypso_site_slug' ) ) {
373
			$site_suffix = WPCOM_Masterbar::get_calypso_site_slug( get_current_blog_id() );
374
		}
375
376
		if ( $site_suffix ) {
377
			return "/${site_suffix}";
378
		}
379
		return '';
380
	}
381
382
	/**
383
	 * Returns the Calypso URL that displays either the current post type list (if no args