<commit_before>(function($m) {

    "use strict";

    /**
     * @controller ProductsController
     * @contributors <NAME>
     */
    $m.controller('ProductsController',

        ['$rootScope', '$scope', '$http', '$productHelper', '$routeParams',

        function ProductsController($rootScope, $scope, $http, $productHelper, $routeParams) {

        /**
         * @method _getPageNumber
         * @param params {Object}
         * @return {Number}
         * @private
         */
        $scope._getPageNumber = function _getPageNumber(params) {

            if (!params.pageNumber && !params.subCategory) {
                return 1;
            }

            if (params.pageNumber) {

                // If the page number has been set then it's probably fine, because we're
                // more than likely on the subCategory page.
                return params.pageNumber;

            }

            var pageNumber  = 1,
                isNumber    = (params.subCategory) && params.subCategory.match(/^\d+$/);

            if (isNumber) {

                // Because the Angular routing isn't so great as to distinguish between
                // different types of URL params, we'll have to detect if the subCategory
                // is in fact the page number for the category page.
                pageNumber = params.subCategory;
                delete params.subCategory;

            }

            return pageNumber;

        };

        /**
         * @property products
         * @type {Array}
         */
        $scope.products = [];

        /**
         * @property perPage
         * @type {Number}
         */
        $scope.perPage = 100000;

        /**
         * @property currentPage
         * @type {Number}
         */
        $scope.currentPage = $scope._getPageNumber($routeParams);<commit_msg>Reset pagination perPage constant<commit_after>(function($m) {

    "use strict";

    /**
     * @controller ProductsController
     * @contributors <NAME>
     */
    $m.controller('ProductsController',

        ['$rootScope', '$scope', '$http', '$productHelper', '$routeParams',

        function ProductsController($rootScope, $scope, $http, $productHelper, $routeParams) {

        /**
         * @method _getPageNumber
         * @param params {Object}
         * @return {Number}
         * @private
         */
        $scope._getPageNumber = function _getPageNumber(params) {

            if (!params.pageNumber && !params.subCategory) {
                return 1;
            }

            if (params.pageNumber) {

                // If the page number has been set then it's probably fine, because we're
                // more than likely on the subCategory page.
                return params.pageNumber;

            }

            var pageNumber  = 1,
                isNumber    = (params.subCategory) && params.subCategory.match(/^\d+$/);

            if (isNumber) {

                // Because the Angular routing isn't so great as to distinguish between
                // different types of URL params, we'll have to detect if the subCategory
                // is in fact the page number for the category page.
                pageNumber = params.subCategory;
                delete params.subCategory;

            }

            return pageNumber;

        };

        /**
         * @property products
         * @type {Array}
         */
        $scope.products = [];

        /**
         * @property perPage
         * @type {Number}
         */
        $scope.perPage = 10;

        /**
         * @property currentPage
         * @type {Number}
         */
        $scope.currentPage = $scope._getPageNumber($routeParams);
{'fraction_non_alphanumeric': 0.11002710027100271, 'fraction_numerical': 0.0032520325203252032, 'mean_word_length': 1.5280821917808218, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5617857', 'n_tokens_mistral': 980, 'n_tokens_neox': 893, 'n_words': 248}