<commit_before>
module.exports = context => {
    function inspectHardcodedPassword(node, value) {
        const isHardcoded = value.toLowerCase().includes('passw');

        if (isHardcoded) {
            return context.report({
                node,
                message : 'Do not use hadrcoded password'
            });
        }
    }

    return {
        VariableDeclarator({ id, init }) {
            if (id.name && init.type === 'Literal' ) {
                return inspectHardcodedPassword(id, id.name);
            }
        },

        Property({ key, value }) {
            if (value.type !== 'Literal') return;

            if (key.type === 'Identifier') {
                return inspectHardcodedPassword(key, key.name);
            }

            if (key.type === 'Literal') {
                return inspectHardcodedPassword(key, key.value);
            }

            if (key.type === 'TemplateLiteral') {
                return key.quasis.some(element => inspectHardcodedPassword(key, element.value.raw));
            }<commit_msg>[Fix] Add additional checks for no-hardrcoded-password rule<commit_after>
module.exports = context => {
    function inspectHardcodedPassword(node, value) {
        const isHardcoded = value.toLowerCase().includes('passw');

        if (isHardcoded) {
            return context.report({
                node,
                message : 'Do not use hadrcoded password'
            });
        }
    }

    return {
        VariableDeclarator({ id, init }) {
            if (id && id.name && init && init.type === 'Literal' ) {
                return inspectHardcodedPassword(id, id.name);
            }
        },

        Property({ key, value }) {
            if (!key || !value || value.type !== 'Literal') return;

            if (key.type === 'Identifier') {
                return inspectHardcodedPassword(key, key.name);
            }

            if (key.type === 'Literal') {
                return inspectHardcodedPassword(key, key.value);
            }

            if (key.type === 'TemplateLiteral') {
                return key.quasis.some(element => inspectHardcodedPassword(key, element.value.raw));
            }
{'fraction_non_alphanumeric': 0.12672176308539945, 'fraction_numerical': 0.0, 'mean_word_length': 1.6736196319018406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '3726983', 'n_tokens_mistral': 584, 'n_tokens_neox': 547, 'n_words': 124}