<commit_before>var addonsApp = angular.module('addonsApp', ['ngResource', 'AddonsRest', 'angularUtils.directives.dirPagination']);

addonsApp.controller('addonsCtrl', function ($scope, AddonsRest, $filter) {

	// ------------------------------------------------------------------------
	// Solution Infos
	// ------------------------------------------------------------------------
	solutionName = studio.currentSolution.getSolutionName();
	solutionFile = studio.currentSolution.getSolutionFile();
	solutionPath = solutionFile != null ? solutionFile.parent.path : {};
	solutionFilePath = solutionFile != null ? solutionFile.path : {};

	// Getting projects from solution XML
	function getProjectsFromXML() {

		solutionXml = studio.loadText(solutionFilePath);
		solutionJson = x2js.xml_str2json(solutionXml);

		var projects = [];

		angular.forEach(solutionJson.solution.project_asArray, function (value, key) {

			projects.push(studio.File(studio.currentSolution.getSolutionFile().parent.path + value._path));
		});

		return projects;
	}

	$scope.solutionInfos = {
		"solution" : {
			"name" : solutionName,
			"path" : solutionPath,
			"file" : {
				"path" : solutionFilePath
			},
			"projects" : solutionName ? getProjectsFromXML() : '' // if there is an opened solution
		},
		"studio" : {
			"version" : studio.version.split(' ')[0],
			"isEnterprise" : studio.isEnterprise
		}
	};
	$scope.branch = $scope.solutionInfos.studio.version == "Dev" ? "master" : "WAK" + $scope.solutionInfos.studio.version;
	console.group('Solution Infos');
	console.log($scope.solutionInfos);
	console.groupEnd();

	studio.extension.storage.setItem('ERROR', '');
	

    $scope.searchTerm = "";
	// ------------------------------------------------------------------------
	// > TABS NAVIGATION (and main filter for the repeater)
	// ------------------------------------------------------------------------

	// Tab default if have projects else defaultTab = 'wakanda-extensions'
	if ($scope.solutionInfos.solution.projects.length > 0) {
		$scope.tabNav = studio.extension.storage.getItem('defaultTab');
	} else {
		$scope.tabNav = 'wakanda-extensions';
	}

	// Get category name from tab (wakanda-widgets -> widgets)
	$scope.$watch('tabNav', function (newVal, oldValue) {
		$scope.tabNavName = newVal.replace('wakanda-', '');
		// $scope.currentProject = $scope.projectsList[0];
		// studio.extension.storage.setItem('projectpath', $scope.projectsList[0].path);
		if (newVal == 'wakanda-modules') {
			$scope.projectsList.splice($scope.projectsList.length - 2, 2);
			if ($scope.currentProject.path == "Favorites")
				studio.extension.storage.setItem('projectpath', $scope.projectsList[0].path);
		}
		if (oldValue == 'wakanda-modules') {
			$scope.projectsList.push({
				"nameNoExt" : '- - - - - - - - - - - - - -',
				"path" : 'line',
				"disable" : true
			}, {
				"nameNoExt" : 'Favorites',
				"path" : 'Favorites',
				"disable" : false
			});

		}
	});

	// ------------------------------------------------------------------------
	// > SORT FILTER DEFAULT
	// ------------------------------------------------------------------------
	$scope.sortFilter = 'name';
	$scope.sortOrder = false;
	
	
	$scope.$watch('sortFilter', function (criteria) {
			
			if( criteria == "name" || criteria == "owner") 
			       $scope.sortOrder = false;
		    else 
			       $scope.sortOrder = true;
<commit_msg>update addons statuts for a special case <commit_after>var addonsApp = angular.module('addonsApp', ['ngResource', 'AddonsRest', 'angularUtils.directives.dirPagination']);

addonsApp.controller('addonsCtrl', function ($scope, AddonsRest, $filter) {

	// ------------------------------------------------------------------------
	// Solution Infos
	// ------------------------------------------------------------------------
	solutionName = studio.currentSolution.getSolutionName();
	solutionFile = studio.currentSolution.getSolutionFile();
	solutionPath = solutionFile != null ? solutionFile.parent.path : {};
	solutionFilePath = solutionFile != null ? solutionFile.path : {};

	// Getting projects from solution XML
	function getProjectsFromXML() {

		solutionXml = studio.loadText(solutionFilePath);
		solutionJson = x2js.xml_str2json(solutionXml);

		var projects = [];

		angular.forEach(solutionJson.solution.project_asArray, function (value, key) {

			projects.push(studio.File(studio.currentSolution.getSolutionFile().parent.path + value._path));
		});

		return projects;
	}

	$scope.solutionInfos = {
		"solution" : {
			"name" : solutionName,
			"path" : solutionPath,
			"file" : {
				"path" : solutionFilePath
			},
			"projects" : solutionName ? getProjectsFromXML() : '' // if there is an opened solution
		},
		"studio" : {
			"version" : studio.version.split(' ')[0],
			"isEnterprise" : studio.isEnterprise
		}
	};
	$scope.branch = $scope.solutionInfos.studio.version == "Dev" ? "master" : "WAK" + $scope.solutionInfos.studio.version;
	console.group('Solution Infos');
	console.log($scope.solutionInfos);
	console.groupEnd();

	studio.extension.storage.setItem('ERROR', '');
	

    $scope.searchTerm = "";
	// ------------------------------------------------------------------------
	// > TABS NAVIGATION (and main filter for the repeater)
	// ------------------------------------------------------------------------

	// Tab default if have projects else defaultTab = 'wakanda-extensions'
	if ($scope.solutionInfos.solution.projects.length > 0) {
		$scope.tabNav = studio.extension.storage.getItem('defaultTab');
	} else {
		$scope.tabNav = 'wakanda-extensions';
	}

	// Get category name from tab (wakanda-widgets -> widgets)
	$scope.$watch('tabNav', function (newVal, oldValue) {
		$scope.tabNavName = newVal.replace('wakanda-', '');
		// $scope.currentProject = $scope.projectsList[0];
		// studio.extension.storage.setItem('projectpath', $scope.projectsList[0].path);
		if (newVal == 'wakanda-modules') {
			$scope.projectsList.splice($scope.projectsList.length - 2, 2);
			if ($scope.currentProject.path == "Favorites"){
				$scope.currentProject = $scope.projectsList[0].path;
				$scope.changeCurrentProject($scope.currentProject);
			}
		}
		if (oldValue == 'wakanda-modules') {
			$scope.projectsList.push({
				"nameNoExt" : '- - - - - - - - - - - - - -',
				"path" : 'line',
				"disable" : true
			}, {
				"nameNoExt" : 'Favorites',
				"path" : 'Favorites',
				"disable" : false
			});

		}
	});

	// ------------------------------------------------------------------------
	// > SORT FILTER DEFAULT
	// ------------------------------------------------------------------------
	$scope.sortFilter = 'name';
	$scope.sortOrder = false;
	
	
	$scope.$watch('sortFilter', function (criteria) {
			
			if( criteria == "name" || criteria == "owner") 
			       $scope.sortOrder = false;
		    else 
			       $scope.sortOrder = true;

{'fraction_non_alphanumeric': 0.2713347921225383, 'fraction_numerical': 0.00262582056892779, 'mean_word_length': 2.200746965452848, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1393077', 'n_tokens_mistral': 2231, 'n_tokens_neox': 1968, 'n_words': 346}