<commit_before>(function () {
    'use strict';

    angular.module('app.core').config(config);

    /**
     * Route configuration
     *
     * @memberof module:core
     *
     * @param {object} $routeProvider
     * The route provider (ngRoute)
     */
    function config($routeProvider) {
        $routeProvider.
            when('/books', {
                controller: 'BookController',
                templateUrl: 'partials/book-list.html'
            }).
            when('/book/:bookId', {
                controller: 'BookDetailController',
                templateUrl: 'partials/book-detail.html'
            }).
            when('/books/new', {
                controller: 'BookController',
                templateUrl: 'partials/book-detail.html',
                resolve: {
                    factory: checkRouting
                }
            }).
            when('/login', {
                controller: 'LoginController',
                templateUrl: 'partials/login.html'
            }).
            when('/author/:authorId', {
                controller: 'AuthorDetailController',
                templateUrl: 'partials/author-detail.html'
            }).
            when('/author', {
                controller: 'AuthorController',
                templateUrl: 'partials/author-list.html'
            }).
            when('/author/new', {
                controller: 'AuthorController',
                templateUrl: 'partials/author-detail.html', 
                resolve: {
                    factory: checkRouting
                }
            }).     
            when('/user/:userId', {
                controller: 'UserDetailController',
                templateUrl: 'partials/user-detail.html',
                 resolve: {
                    factory: checkRouting
                }
            }).
            when('/users', {
                controller: 'UserController',
                templateUrl: 'partials/user-list.html',
                 resolve: {
                    factory: checkRouting
                }
            }).
            when('/users/new', {
                controller: 'UserController',
                templateUrl: 'partials/user-detail.html', 
                resolve: {
                    factory: checkRouting
                }
            }).     
            otherwise({
                redirectTo: '/books'
            });
    }
}());

var checkRouting= function ($q, $rootScope, $location) {
    if ($rootScope.isAuthenticated && $rootScope.userName) {
        return true;
    } else {
        $location.path("/login");
    }
};<commit_msg>fixing jshint and jscs errors<commit_after>(function () {
    'use strict';

    var checkRouting = function ($q, $rootScope, $location) {
        if ($rootScope.isAuthenticated && $rootScope.userName) {
            return true;
        } else {
            $location.path('/login');
        }
    };

    angular.module('app.core').config(config);

    /**
     * Route configuration
     *
     * @memberof module:core
     *
     * @param {object} $routeProvider
     * The route provider (ngRoute)
     */
    function config($routeProvider) {
        $routeProvider.
            when('/books', {
                controller: 'BookController',
                templateUrl: 'partials/book-list.html'
            }).
            when('/book/:bookId', {
                controller: 'BookDetailController',
                templateUrl: 'partials/book-detail.html'
            }).
            when('/books/new', {
                controller: 'BookController',
                templateUrl: 'partials/book-detail.html',
                resolve: {
                    factory: checkRouting
                }
            }).
            when('/login', {
                controller: 'LoginController',
                templateUrl: 'partials/login.html'
            }).
            when('/author/:authorId', {
                controller: 'AuthorDetailController',
                templateUrl: 'partials/author-detail.html'
            }).
            when('/author', {
                controller: 'AuthorController',
                templateUrl: 'partials/author-list.html'
            }).
            when('/author/new', {
                controller: 'AuthorController',
                templateUrl: 'partials/author-detail.html',
                resolve: {
                    factory: checkRouting
                }
            }).
            when('/user/:userId', {
                controller: 'UserDetailController',
                templateUrl: 'partials/user-detail.html',
                resolve: {
                    factory: checkRouting
                }
            }).
            when('/users', {
                controller: 'UserController',
                templateUrl: 'partials/user-list.html',
                resolve: {
                    factory: checkRouting
                }
            }).
            when('/users/new', {
                controller: 'UserController',
                templateUrl: 'partials/user-detail.html',
                resolve: {
                    factory: checkRouting
                }
            }).
            otherwise({
                redirectTo: '/books'
            });
    }
}());
{'fraction_non_alphanumeric': 0.12011439466158245, 'fraction_numerical': 0.0, 'mean_word_length': 1.198658843252305, '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': '2764469', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1214, 'n_words': 202}