Total Complexity | 8 |
Complexity/F | 1.14 |
Lines of Code | 27 |
Function Count | 7 |
Duplicated Lines | 27 |
Ratio | 100 % |
Changes | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | View Code Duplication | "use strict"; |
|
2 | app.controller('viewDepartmentController', ['$scope', 'Security', function ($scope, Security, $rootScope) { |
||
3 | function Initialize(){ |
||
4 | var entryForm = {}; |
||
5 | |||
6 | $scope.entryForm = entryForm; |
||
7 | } |
||
8 | Initialize(); |
||
9 | |||
10 | $scope.EventListener = function(scope, iElement, iAttrs, controller){ |
||
11 | iElement.ready(function() { |
||
12 | |||
13 | }) |
||
14 | } |
||
15 | |||
16 | $scope.SetDefaultValue = function(scope, iElement, iAttrs, controller){ |
||
17 | } |
||
18 | |||
19 | $scope.StatusChange = function(fieldName, newValue, newObj, scope, iElement, iAttrs, controller){ |
||
20 | if(fieldName == "DepartmentCode") |
||
21 | newObj.DepartmentCode = newObj.DepartmentCode.toUpperCase(); |
||
22 | } |
||
23 | |||
24 | $scope.ValidateBuffer = function(scope, iElement, iAttrs, controller){ |
||
25 | return true; |
||
26 | } |
||
27 | }]); |
||
28 |