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

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