Code Duplication    Length = 8-8 lines in 2 locations

projects/plugins/jetpack/_inc/lib/class.jetpack-password-checker.php 1 location

@@ 505-512 (lines=8) @@
502
	 * @param String $char character.
503
	 * @return Integer the character code.
504
	 */
505
	protected function get_char_index( $char ) {
506
		$char = strtolower( $char[0] );
507
		if ( $char < 'a' || $char > 'z' ) {
508
			return 0;
509
		} else {
510
			return ord( $char[0] ) - ord( 'a' ) + 1;
511
		}
512
	}
513
514
	/**
515
	 * This is the password strength calculation algorithm, based on the formula H = L(logN/log2).

projects/packages/password-checker/src/class-password-checker.php 1 location

@@ 529-536 (lines=8) @@
526
	 * @param String $char character.
527
	 * @return Integer the character code.
528
	 */
529
	protected function get_char_index( $char ) {
530
		$char = strtolower( $char[0] );
531
		if ( $char < 'a' || $char > 'z' ) {
532
			return 0;
533
		} else {
534
			return ord( $char[0] ) - ord( 'a' ) + 1;
535
		}
536
	}
537
538
	/**
539
	 * This is the password strength calculation algorithm, based on the formula H = L(logN/log2).