<commit_before>var fileSize = require('filesize');

WWW = (function() {

    function WWW(socket) {
        this.socket = socket;
    }
    
    WWW.prototype.onConnect = function (server) {
        this.server = server;
        this.socket.on('refresh', this.onRefresh.bind(this));
        this.socket.on('disconnect', this.onDisconnect.bind(this));
        this.onRefresh();
    };
    
    WWW.prototype.onDisconnect = function () {};
    
    WWW.prototype.onRefresh = function () {
        var server = this.server;
        var response = {<commit_msg>update to prototype-based oop<commit_after>/**
 * @name WWW
 * @version 1.0
 * @fileoverview Handles some of the WWW-Sockets events
 */

var fileSize = require('filesize');

/**
 * @class WWW
 */
WWW = (function() {

    /**
     * Creates a new WWW Object
     * @method WWW
     * @param {Socket} socket - the WWW socket.
     */
    function WWW(socket) {
        this.socket = socket;
    }
    
    /**
     * Set eventhandlers
     * 
     * @method onConnect
     * @return {Server} server instance of the calling {@link Server}.
     */
    WWW.prototype.onConnect = function (server) {
        this.server = server;
        this.socket.on('refresh', this.onRefresh.bind(this));
        this.socket.on('disconnect', this.onDisconnect.bind(this));
        this.onRefresh();
    };
    
    /**
     * Handle disconnect
     * 
     * @method onDisconnect
     */
    WWW.prototype.onDisconnect = function () {};
    
    /**
     * Handle refresh and update metadata (builds, agents, clients,...)
     * 
     * @method onRefresh
     */
    WWW.prototype.onRefresh = function () {
        var server = this.server;
        var response = {
{'fraction_non_alphanumeric': 0.13849765258215962, 'fraction_numerical': 0.0011737089201877935, 'mean_word_length': 2.1515711645101665, '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': '5728327', 'n_tokens_mistral': 525, 'n_tokens_neox': 516, 'n_words': 113}