<commit_before>var services = angular.module('smlBootstrap.services', ['ngResource']);

var dontBlockOnAjaxHeader = { "dontBlockPageOnAjax": "true" };
var nonArrayGetWithoutBlockOnAjax = { method: "GET", isArray: false, headers: dontBlockOnAjaxHeader };



services.factory('EntriesService', function ($resource) {

    var entriesService = {};

    entriesService.crudService = $resource('rest/entries/:id', { }, {
        insert: { method: "PUT"},
        query: nonArrayGetWithoutBlockOnAjax
    });

    entriesService.counter = $resource("/rest/entries/count", { }, {
        get: nonArrayGetWithoutBlockOnAjax
    });

    entriesService.newEntriesCounter = $resource("/rest/entries/count-newer/:time", { }, {
        get: nonArrayGetWithoutBlockOnAjax
    });

    entriesService.loadAll = function (successFunction) {
        entriesService.crudService.query(null, successFunction);
    };

    entriesService.addNew = function (entryText, successFunction) {
        var json = {};
        json.text = entryText;
        entriesService.crudService.save(angular.toJson(json), successFunction);
    };

    entriesService.load = function (logObjectId, successFunction) {
        entriesService.crudService.get({id: logObjectId}, successFunction);
    };

    entriesService.update = function (logObject) {
        var json = {};
        json.text = logObject.text;
        json.id = logObject.id;
        entriesService.crudService.insert(angular.toJson(json));
    };

    entriesService.deleteEntry = function (logObjectId, successFunction) {
        entriesService.crudService.remove({id: logObjectId}, successFunction);
    };

    entriesService.count = function (successFunction) {
        entriesService.counter.get(successFunction);
    };

    entriesService.countNewEntries = function(timestamp, successFunction) {
        entriesService.newEntriesCounter.get({time: timestamp}, successFunction)
    }

    return entriesService;
});
<commit_msg>Small refactoring in EntriesService<commit_after>var services = angular.module('smlBootstrap.services', ['ngResource']);

var dontBlockOnAjaxHeader = { "dontBlockPageOnAjax": "true" };
var nonArrayGetWithoutBlockOnAjax = { method: "GET", isArray: false, headers: dontBlockOnAjaxHeader };



services.factory('EntriesService', function ($resource) {

    var self = this;

    self.entriesCrudResource = $resource('rest/entries/:id', { }, {
        insert: { method: "PUT"},
        query: nonArrayGetWithoutBlockOnAjax
    });

    self.counterResource = $resource("/rest/entries/count", { }, {
        get: nonArrayGetWithoutBlockOnAjax
    });

    self.newEntriesCounterResource = $resource("/rest/entries/count-newer/:time", { }, {
        get: nonArrayGetWithoutBlockOnAjax
    });

    var entriesService = {};

    entriesService.loadAll = function (successFunction) {
        self.entriesCrudResource.query(null, successFunction);
    };

    entriesService.addNew = function (entryText, successFunction) {
        var json = {};
        json.text = entryText;
        self.entriesCrudResource.save(angular.toJson(json), successFunction);
    };

    entriesService.load = function (logObjectId, successFunction) {
        self.entriesCrudResource.get({id: logObjectId}, successFunction);
    };

    entriesService.update = function (logObject) {
        var json = {};
        json.text = logObject.text;
        json.id = logObject.id;
        self.entriesCrudResource.insert(angular.toJson(json));
    };

    entriesService.deleteEntry = function (logObjectId, successFunction) {
        self.entriesCrudResource.remove({id: logObjectId}, successFunction);
    };

    entriesService.count = function (successFunction) {
        self.counterResource.get(successFunction);
    };

    entriesService.countNewEntries = function(timestamp, successFunction) {
        self.newEntriesCounterResource.get({time: timestamp}, successFunction)
    }

    return entriesService;
});

{'fraction_non_alphanumeric': 0.12310030395136778, 'fraction_numerical': 0.0, 'mean_word_length': 3.651354534746761, 'pattern_counts': {'":': 2, '<': 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': '3390501', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1078, 'n_words': 180}