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

  angular
    .module('brewKeeper')
    .controller('BrewItController', BrewItController);

  BrewItController.$inject = [
    '$location',
    '$rootScope',
    '$routeParams',
    '$scope',
    'dataService',
    'recipePrep'];

  function BrewItController(
      $location,
      $rootScope,
      $routeParams,
      $scope,
      dataService,
      recipePrep
    ) {
    var vm = this;
    vm.addBrewNote = addBrewNote;
    vm.brewnote = {};
    vm.countdownVal = null;
    vm.detail = {};
    vm.isPublic = ($location.path().indexOf('/public') === 0);
    vm.nextStep = nextStep;
    vm.notes = {};
    vm.ratePublicRecipe = ratePublicRecipe;
    vm.rateRecipe = rateRecipe;
    vm.ratingId = null;
    vm.ratings = null;
    vm.recipeUsername = vm.isPublic ? 'public' : $rootScope.username;
    vm.resetBrew = resetBrew;
    vm.restartBrew = restartBrew;
    vm.showStars = false;
    vm.startBrew = startBrew;
    vm.stepArray = [];
    vm.stepTotal = null;
    vm.steps = {};
    vm.timerRunning = false;
    vm.userRating = null;

    var brewNoteUrl = null;
    var recipeUrl = null;
    var ratingsUrl = null;

    activate();

    ////////////////////////////////////////////////////////////////////////////
    // FUNCTIONS //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////

    /**
     * Prepare the page.
     */
    function activate() {
      if (vm.isPublic) {
        recipeUrl = '/api/users/public/recipes/' + $routeParams.id + '/';
        ratingsUrl = recipeUrl + 'ratings/';
      } else {
        recipeUrl = '/api/users/' + $rootScope.username + '/recipes/' +
          $routeParams.id + '/';
        brewNoteUrl = recipeUrl + 'brewnotes/';
      }

      $(document).scrollTop(0);

      vm.recipe = recipePrep;
      if (vm.recipe) {
        setSemanticVariables(vm.recipe);
      }

      if (vm.isPublic && $rootScope.username) {<commit_msg>Remove now-unnecessary check on presence of `vm.recipes`<commit_after>;(function() {  //IIFE
  'use strict';

  angular
    .module('brewKeeper')
    .controller('BrewItController', BrewItController);

  BrewItController.$inject = [
    '$location',
    '$rootScope',
    '$routeParams',
    '$scope',
    'dataService',
    'recipePrep'];

  function BrewItController(
      $location,
      $rootScope,
      $routeParams,
      $scope,
      dataService,
      recipePrep
    ) {
    var vm = this;
    vm.addBrewNote = addBrewNote;
    vm.brewnote = {};
    vm.countdownVal = null;
    vm.detail = {};
    vm.isPublic = ($location.path().indexOf('/public') === 0);
    vm.nextStep = nextStep;
    vm.notes = {};
    vm.ratePublicRecipe = ratePublicRecipe;
    vm.rateRecipe = rateRecipe;
    vm.ratingId = null;
    vm.ratings = null;
    vm.recipeUsername = vm.isPublic ? 'public' : $rootScope.username;
    vm.resetBrew = resetBrew;
    vm.restartBrew = restartBrew;
    vm.showStars = false;
    vm.startBrew = startBrew;
    vm.stepArray = [];
    vm.stepTotal = null;
    vm.steps = {};
    vm.timerRunning = false;
    vm.userRating = null;

    var brewNoteUrl = null;
    var recipeUrl = null;
    var ratingsUrl = null;

    activate();

    ////////////////////////////////////////////////////////////////////////////
    // FUNCTIONS //////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////

    /**
     * Prepare the page.
     */
    function activate() {
      if (vm.isPublic) {
        recipeUrl = '/api/users/public/recipes/' + $routeParams.id + '/';
        ratingsUrl = recipeUrl + 'ratings/';
      } else {
        recipeUrl = '/api/users/' + $rootScope.username + '/recipes/' +
          $routeParams.id + '/';
        brewNoteUrl = recipeUrl + 'brewnotes/';
      }

      $(document).scrollTop(0);

      vm.recipe = recipePrep;
      setSemanticVariables(vm.recipe);

      if (vm.isPublic && $rootScope.username) {
{'fraction_non_alphanumeric': 0.23580246913580247, 'fraction_numerical': 0.0009876543209876543, 'mean_word_length': 1.6442558746736293, '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': '3933372', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1205, 'n_words': 220}