GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Branch master (b17032)
by Keith
68:36
created

doc/v3/js/controller/install01-getting-started.js   A

Complexity

Total Complexity 15
Complexity/F 1.15

Size

Lines of Code 85
Function Count 13

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 57
dl 0
loc 85
rs 10
c 0
b 0
f 0
wmc 15
mnd 2
bc 2
fnc 13
bpm 0.1538
cpm 1.1538
noi 3

3 Functions

Rating   Name   Duplication   Size   Complexity  
A install01-getting-started.js ➔ myError 0 3 1
C install01-getting-started.js ➔ mySuccess 0 9 11
A install01-getting-started.js ➔ start_milestones 0 20 3
1
"use strict";
2
3
app.controller('install01Controller', ['$scope', '$q', '$http', '$interval', '$rootScope', function ($scope, $q, $http, $interval, $rootScope) {
4
	$("#download_button").hide();
5
	
6
	$scope.mergeContent = function(){
7
		if($scope.releaseInfoStack.length > 0){
8
			var latestRelease = $scope.releaseInfoStack[0];
9
			console.dir(latestRelease)
10
			var tag_name = latestRelease.tag_name;
11
			var releaseZipDownloadURL = latestRelease.zipball_url;
12
			var releaseTarDownloadURL = latestRelease.tarball_url;
13
			
14
			$("#latest_release_zip").text(tag_name).parent("a").attr("href", releaseZipDownloadURL);
15
			$("#latest_release_tar").text(tag_name).parent("a").attr("href", releaseTarDownloadURL);
16
			
17
			$("#loading_info").hide();
18
			$("#download_button").show();
19
		}
20
	}
21
	
22
	$scope.get_information = function(){
23
		$scope.initial_variable();
24
		
25
		var getReleaseInfoResule = $scope.get_github_release_info();
26
		getReleaseInfoResule.then(function(infoObjList) {
27
			$scope.releaseInfoStack = infoObjList;
28
		}, function(reason) {
29
		});
30
		
31
		$q.all([getReleaseInfoResule]).then(function() {
32
			$scope.mergeContent();
33
		});
34
	}
35
	$scope.get_github_release_info = function(){
36
		var arrayList = [];
37
        
38
		var promise = $q(function(resolve, reject) {
39
			var array = {text:"commits", amt:"10101", options};
0 ignored issues
show
Unused Code introduced by
The variable array seems to be never used. Consider removing it.
Loading history...
40
			
41
			$http({
42
				method : "GET",
43
				url : "https://api.github.com/repos/Otaku-Projects/AngularJS-CRUD-PHP/releases"
44
			}).then(function mySuccess(response) {
45
				var returnData = response.data;
46
				var totalReleasesCount = 0;
0 ignored issues
show
Unused Code introduced by
The variable totalReleasesCount seems to be never used. Consider removing it.
Loading history...
47
				returnData.forEach(function(releasesObj){
48
					arrayList.push(releasesObj);
49
				});
50
				
51
				resolve(arrayList);
52
			}, function myError(response) {
53
				reject(new Error('get project release info error'));
54
			});
55
			
56
		});
57
		
58
		return promise;
59
	}
60
    $scope.initial_variable = function(){
61
        $scope.releaseInfoStack = [];
62
    }
63
	function start_milestones(stackObjectList){
0 ignored issues
show
introduced by
The function start_milestones does not seem to be used and can be removed.
Loading history...
64
        $("#milestones").html("");
65
        
66
        var infoObj = stackObjectList.shift();
67
        var elementContent = infoObj.text;
68
        var countUpAmt = infoObj.amt;
69
        var options = infoObj.options;
70
        $("#milestones").html("<div class='animated'>"+elementContent+"</div>");
71
        $("#milestones div").addClass("fadeInUp");
72
        
73
		if(!$scope.countUp){
74
			$scope.countUp = new CountUp("count_up_amt", 0, options);
75
			$scope.countUp.start();
76
			$("#count_up_amt").hide();
77
		}
78
		$("#count_up_amt").show();
79
		$scope.countUp.update(countUpAmt);
80
		
81
        stackObjectList.push(infoObj);
82
	}
83
	
84
	$scope.get_information();
85
}]);