<commit_before><?php
/**
 * WordPress Coding Standard.
 *
 * @package WPCS\WordPressCodingStandards
 * @link    https://github.com/WordPress/WordPress-Coding-Standards
 * @license https://opensource.org/licenses/MIT MIT
 */

namespace WordPressCS\WordPress\Sniffs\WP;

use WordPressCS\WordPress\AbstractFunctionRestrictionsSniff;

/**
 * Discourages the use of various WordPress functions and suggests alternatives.
 *
 * @package WPCS\WordPressCodingStandards
 *
 * @since   0.11.0
 * @since   0.13.0 Class name changed: this class is now namespaced.
 */
class DiscouragedFunctionsSniff extends AbstractFunctionRestrictionsSniff {

	/**
	 * Groups of functions to restrict.
	 *
	 * Example: groups => array(
	 *  'lambda' => array(
	 *      'type'      => 'error' | 'warning',
	 *      'message'   => 'Use anonymous functions instead please!',
	 *      'functions' => array( 'file_get_contents', 'create_function' ),
	 *  )
	 * )
	 *
	 * @return array
	 */
	public function getGroups() {
		return array(
			'query_posts' => array(
				'type'      => 'warning',
				'message'   => '%s() is discouraged. Use WP_Query instead.',
				'functions' => array(
					'query_posts',
				),
			),

			'wp_reset_query' => array(
				'type'      => 'warning',
				'message'   => '%s() is discouraged. Use the wp_reset_postdata() instead.',
				'functions' => array(
					'wp_reset_query',
				),
			),
		);
	}

}
<commit_msg>Correct grammar for wp_reset_query warning<commit_after><?php
/**
 * WordPress Coding Standard.
 *
 * @package WPCS\WordPressCodingStandards
 * @link    https://github.com/WordPress/WordPress-Coding-Standards
 * @license https://opensource.org/licenses/MIT MIT
 */

namespace WordPressCS\WordPress\Sniffs\WP;

use WordPressCS\WordPress\AbstractFunctionRestrictionsSniff;

/**
 * Discourages the use of various WordPress functions and suggests alternatives.
 *
 * @package WPCS\WordPressCodingStandards
 *
 * @since   0.11.0
 * @since   0.13.0 Class name changed: this class is now namespaced.
 */
class DiscouragedFunctionsSniff extends AbstractFunctionRestrictionsSniff {

	/**
	 * Groups of functions to restrict.
	 *
	 * Example: groups => array(
	 *  'lambda' => array(
	 *      'type'      => 'error' | 'warning',
	 *      'message'   => 'Use anonymous functions instead please!',
	 *      'functions' => array( 'file_get_contents', 'create_function' ),
	 *  )
	 * )
	 *
	 * @return array
	 */
	public function getGroups() {
		return array(
			'query_posts' => array(
				'type'      => 'warning',
				'message'   => '%s() is discouraged. Use WP_Query instead.',
				'functions' => array(
					'query_posts',
				),
			),

			'wp_reset_query' => array(
				'type'      => 'warning',
				'message'   => '%s() is discouraged. Use wp_reset_postdata() instead.',
				'functions' => array(
					'wp_reset_query',
				),
			),
		);
	}

}

{'fraction_non_alphanumeric': 0.14391014391014392, 'fraction_numerical': 0.005616005616005616, 'mean_word_length': 3.1424418604651163, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '972001', 'n_tokens_mistral': 1016, 'n_tokens_neox': 891, 'n_words': 207}