<commit_before>if (Meteor.isClient) {
    // Create an anonymous user
    Meteor.loginVisitor();
    Meteor.subscribe('allUsers');

    Template.scoreButton.events({
        'click button': function () {
            // Increment player score
            Meteor.call('incrementScore');
        }
    });

    Template.allUsers.helpers({
        users: function () {
            // Get a list of all users, sorted in reverse-order by score
            return Meteor.users.find(
                {},
                { sort: { 'profile.score': -1 } }
            ).fetch();
        }
    });
    Template.userName.events({
        'keyup #name': function (event) {
            // Set the current username in the database
            var username = event.target.value;
            Meteor.call('changeUserName', username);
        }
    });
    Template.userName.helpers({
        username: function () {
            // Return the current username into the template
            return Meteor.users.find(Meteor.userId()).fetch()[0].username;
        }
    });
}

if (Meteor.isServer) {
    //Meteor.loginVisitor(); // If enabled, will periodically clear user database
    Meteor.publish('allUsers', function() {
        // publish a list of all users
        return Meteor.users.find();
    });

    Meteor.startup(function () {
        // code to run on server at startup
    });

    Meteor.methods({
        // Increment the score by one
        incrementScore: function () {
            Meteor.users.update(
                { _id: Meteor.userId() },
                { $inc: { 'profile.score': 1 } }
            );
        },
        changeUserName: function (username) {
            // Change the username of the current user
            Meteor.users.update(
                { _id: Meteor.userId() },
                { $set: { 'username': username } }
            );
        },
        getUserName: function () {
            // Get the username of the current user
            var userId = Meteor.userId();
            var user = Meteor.users.find(userId).fetch();
            var username = user[0].username;
            return username;
        }
    });
}<commit_msg>Running through linter.<commit_after>if (Meteor.isClient) {
    // Create an anonymous user
    Meteor.loginVisitor();
    Meteor.subscribe('allUsers');

    Template.scoreButton.events({
        'click button': function () {
            'use strict';
            // Increment player score
            Meteor.call('incrementScore');
        }
    });

    Template.allUsers.helpers({
        users: function () {
            'use strict';
            // Get a list of all users, sorted in reverse-order by score
            return Meteor.users.find(
                {},
                { sort: { 'profile.score': -1 } }
            ).fetch();
        }
    });
    Template.userName.events({
        'keyup #name': function (event) {
            'use strict';
            // Set the current username in the database
            var username = event.target.value;
            Meteor.call('changeUserName', username);
        }
    });
    Template.userName.helpers({
        username: function () {
            'use strict';
            // Return the current username into the template
            return Meteor.users.find(Meteor.userId()).fetch()[0].username;
        }
    });
}

if (Meteor.isServer) {
    //Meteor.loginVisitor(); // If enabled, will periodically clear user database
    Meteor.publish('allUsers', function () {
        'use strict';
        // publish a list of all users
        return Meteor.users.find();
    });

//    Meteor.startup(function () {
//        // code to run on server at startup
//    });

    Meteor.methods({
        // Increment the score by one
        incrementScore: function () {
            'use strict';
            Meteor.users.update(
                { _id: Meteor.userId() },
                { $inc: { 'profile.score': 1 } }
            );
        },
        changeUserName: function (username) {
            'use strict';
            // Change the username of the current user
            Meteor.users.update(
                { _id: Meteor.userId() },
                { $set: { 'username': username } }
            );
        },
        getUserName: function () {
            'use strict';
            // Get the username of the current user
            var userId = Meteor.userId(),
                user = Meteor.users.find(userId).fetch(),
                username = user[0].username;
            return username;
        }
    });
}
{'fraction_non_alphanumeric': 0.12497254557434659, 'fraction_numerical': 0.0017570832418185812, 'mean_word_length': 1.5370473537604457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1483680', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1184, 'n_words': 302}