Conditions | 1 |
Paths | 1 |
Total Lines | 71 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | /** |
||
23 | (function () { |
||
24 | 'use strict'; |
||
25 | |||
26 | /** |
||
27 | * @ngdoc overview |
||
28 | * @name passmanApp |
||
29 | * @description |
||
30 | * # passmanApp |
||
31 | * |
||
32 | * Main module of the application. |
||
33 | */ |
||
34 | angular |
||
35 | .module('passmanExtension', [ |
||
36 | 'ngResource', |
||
37 | 'ngRoute', |
||
38 | 'ngSanitize', |
||
39 | 'pascalprecht.translate', |
||
40 | 'angular-steps', |
||
41 | 'cgNotify' |
||
42 | ]) |
||
43 | .config(function ($routeProvider, $locationProvider) { |
||
44 | $routeProvider |
||
45 | .when('/', { |
||
46 | templateUrl: 'views/list.html', |
||
47 | controller: 'ListCtrl' |
||
48 | }) |
||
49 | .when('/search', { |
||
50 | templateUrl: 'views/search.html', |
||
51 | controller: 'SearchCtrl' |
||
52 | }) |
||
53 | .when('/settings/:tab?', { |
||
54 | templateUrl: 'views/settings.html', |
||
55 | controller: 'SettingsCtrl' |
||
56 | }) |
||
57 | .when('/edit/:guid', { |
||
58 | templateUrl: 'views/edit_credential.html', |
||
59 | controller: 'EditCtrl' |
||
60 | }) |
||
61 | .when('/locked', { |
||
62 | templateUrl: 'views/password_prompt.html', |
||
63 | controller: 'PasswordPromptCtrl' |
||
64 | }) |
||
65 | .when('/setup/', { |
||
66 | templateUrl: 'views/setup.html', |
||
67 | controller: 'SetupCtrl' |
||
68 | }) |
||
69 | .when('/accounts/add', { |
||
70 | templateUrl: 'views/account/add.html', |
||
71 | controller: 'AddAccountCtrl' |
||
72 | }) |
||
73 | .otherwise({ |
||
74 | redirectTo: '/' |
||
75 | }); |
||
76 | $locationProvider.hashPrefix('!'); |
||
77 | }).config(function ($translateProvider) { |
||
|
|||
78 | |||
79 | /*$translateProvider.useSanitizeValueStrategy('sanitize'); |
||
80 | $translateProvider.useUrlLoader(OC.generateUrl('/apps/passman/api/v2/language')); |
||
81 | $translateProvider.preferredLanguage('en');*/ |
||
82 | }).config(function ($httpProvider) { |
||
83 | $httpProvider.useApplyAsync(true); |
||
84 | }).config( [ |
||
85 | '$compileProvider', |
||
86 | function( $compileProvider ) |
||
87 | { |
||
88 | $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension|moz-extension):/); |
||
89 | // Angular before v1.2 uses $compileProvider.urlSanitizationWhitelist(...) |
||
90 | } |
||
91 | ]); |
||
92 | |||
93 | }()); |
||
94 |
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.