<commit_before>
angular.module('codebrag.commits')

    .directive('generalLikes', function(authService, Likes) {

        function GeneralLikesController($scope) {

            var currentUser = authService.loggedInUser;

            $scope.likeOrUnlike = function() {
                if($scope.commit.isUserAuthorOfCommit(currentUser)) {
                    return;
                }
                if($scope.commit.userAlreadyLikedCommit(currentUser)) {
                    unlikeCommit($scope.commit.reactions.likes);
                } else {
                    likeCommit($scope.commit.reactions.likes);
                }
            };

            mix();

            var removeInitialWatcher = $scope.$watch('commit', function(newVal) {
                if(newVal) {
                    $scope.$watch('commit.reactions.likes.length', function(newLength) {
                        if(angular.isUndefined(newLength)) {
                            return;
                        }
                        mix();
                    }, true);
                    removeInitialWatcher();
                }
            });

            function mix() {
                if($scope.commit) {
                    $scope.usersWhoLike = usersWhoLikeText();
                    $scope.likesAvailable = ($scope.usersWhoLike.length > 0);
                    $scope.likesCount = $scope.usersWhoLike.length;
                    $scope.userCannotLike = userCannotLikeCommit();
                    $scope.noLikesYetText = noLikesYetText();
                    $scope.likesLabel = getCorrectLabel();
                }<commit_msg>Cleanup - remove my dummy naming from previous commits<commit_after>
angular.module('codebrag.commits')

    .directive('generalLikes', function(authService, Likes) {

        function GeneralLikesController($scope) {

            var currentUser = authService.loggedInUser;

            $scope.likeOrUnlike = function() {
                if($scope.commit.isUserAuthorOfCommit(currentUser)) {
                    return;
                }
                if($scope.commit.userAlreadyLikedCommit(currentUser)) {
                    unlikeCommit($scope.commit.reactions.likes);
                } else {
                    likeCommit($scope.commit.reactions.likes);
                }
            };

            updateLikesInfo();
            setupWatcherOnLikes();

            function setupWatcherOnLikes() {
                var removeInitialWatcher = $scope.$watch('commit', function (newVal) {
                    if (newVal) {
                        $scope.$watch('commit.reactions.likes.length', function (newLength) {
                            if (angular.isUndefined(newLength)) {
                                return;
                            }
                            updateLikesInfo();
                        }, true);
                        removeInitialWatcher();
                    }
                });
            }

            function updateLikesInfo() {
                if($scope.commit) {
                    $scope.usersWhoLike = usersWhoLikeText();
                    $scope.userCannotLike = userCannotLikeCommit();
                    $scope.likesAvailable = ($scope.usersWhoLike.length > 0);
                    $scope.likesLabel = getCorrectLabel();
                }
{'fraction_non_alphanumeric': 0.10069131349564171, 'fraction_numerical': 0.0006011421701232341, 'mean_word_length': 1.3095072866065232, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3862775', 'n_tokens_mistral': 832, 'n_tokens_neox': 768, 'n_words': 104}