Completed
Push — phpunit ( 7f2080...75f541 )
by Marcos
14:28 queued 10:45
created

js/app/controllers/main.js   B

Complexity

Conditions 1
Paths 3

Size

Total Lines 35

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
nc 3
nop 0
dl 0
loc 35
rs 8.8571
c 1
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B angular.controller(ꞌMainCtrlꞌ) 0 22 4
1
(function () {
2
	'use strict';
3
4
	/**
5
	 * @ngdoc function
6
	 * @name passmanApp.controller:MainCtrl
7
	 * @description
8
	 * # MainCtrl
9
	 * Controller of the passmanApp
10
	 */
11
	angular.module('passmanApp')
12
		.controller('MainCtrl', ['$scope', '$rootScope', '$location', function ($scope, $rootScope, $location) {
13
			$scope.selectedVault = false;
14
15
			$scope.http_warning_hidden = true;
16
			if ($location.$$protocol === 'http' && $location.$$host !== 'localhost' && $location.$host !== '127.0.0.1') {
17
				$scope.using_http = true;
18
				$scope.http_warning_hidden = false;
19
20
			}
21
22
			$rootScope.setHttpWarning = function (state) {
23
				$scope.http_warning_hidden = state;
24
			};
25
26
			$rootScope.$on('app_menu', function (evt, shown) {
27
				$scope.app_sidebar = shown;
28
			});
29
30
			$rootScope.$on('logout', function () {
31
				$scope.selectedVault = false;
32
			});
33
		}]);
34
35
}());