Code Duplication    Length = 10-11 lines in 2 locations

class.jetpack-admin.php 1 location

@@ 60-70 (lines=11) @@
57
		add_action( 'jetpack_unrecognized_action', array( $this, 'handle_unrecognized_action' ) );
58
	}
59
60
	static function sort_requires_connection_last( $module1, $module2 ) {
61
		if ( $module1['requires_connection'] == $module2['requires_connection'] ) {
62
			return 0;
63
		} elseif ( $module1['requires_connection'] ) {
64
			return 1;
65
		} elseif ( $module2['requires_connection'] ) {
66
			return -1;
67
		}
68
69
		return 0;
70
	}
71
72
	// Produce JS understandable objects of modules containing information for
73
	// presentation like description, name, configuration url, etc.

class.jetpack-modules-list-table.php 1 location

@@ 192-201 (lines=10) @@
189
		return true;
190
	}
191
192
	static function sort_requires_connection_last( $module1, $module2 ) {
193
		if ( $module1['requires_connection'] == $module2['requires_connection'] ) {
194
			return 0;
195
		}
196
		if ( $module1['requires_connection'] ) {
197
			return 1;
198
		}
199
		if ( $module2['requires_connection'] ) {
200
			return -1;
201
		}
202
203
		return 0;
204
	}