public/js/angularController.js   A
last analyzed

Complexity

Total Complexity 6
Complexity/F 1

Size

Lines of Code 61
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 8
Bugs 1 Features 4
Metric Value
cc 0
c 8
b 1
f 4
nc 1
dl 0
loc 61
rs 10
wmc 6
mnd 0
bc 6
fnc 6
bpm 1
cpm 1
noi 3

4 Functions

Rating   Name   Duplication   Size   Complexity  
A app.controller(ꞌmainControllerꞌ) 0 12 1
B app.config 0 31 1
A app.controller(ꞌprojectControllerꞌ) 0 3 1
A app.controller(ꞌprojectListControllerꞌ) 0 3 1
1
'use strict';
2
3
var app = angular.module('angularApp', ['ngRoute']);
4
5
var url = 'http://kevin-hwang-website.herokuapp.com';
6
var port = 3000;
7
8
app.config(['$routeProvider', '$locationProvider',
9
    function ($routeProvider, $locationProvider) {
10
11
        $locationProvider.html5Mode({
12
            enabled: true,
13
            requireBase: false
14
        });
15
16
        $routeProvider
17
18
        //load home page
19
            .when('/', {
20
                templateUrl: 'main',
21
                controller: 'mainController'
22
            })
23
24
            //load projectList page
25
            .when('/projectList', {
26
                templateUrl: 'projectList',
27
                controller: 'projectListController'
28
            })
29
30
            //load project page
31
            .when('/project:projectId', {
32
                templateUrl: 'project',
33
                controller: 'projectController'
34
            })
35
36
            .otherwise({
37
                redirectTo: '/'
38
            });
39
    }]);
40
41
42
app.controller('mainController', ['$scope', '$window', '$http', function ($scope, $window, $http) {
43
44
    $scope.resume = function () {
45
        $window.location.href = '/src/Resume.pdf';
46
    };
47
48
    $http.get(url + '/api')
49
        .success(function(data) {
50
            $scope.items = data.Projects;
51
            console.log($scope.items);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
52
        });
53
}]);
54
55
app.controller('projectListController', function ($scope) {
0 ignored issues
show
Unused Code introduced by
The parameter $scope is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
56
57
});
58
59
app.controller('projectController', function ($scope) {
0 ignored issues
show
Unused Code introduced by
The parameter $scope is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
60
61
});
62
63