Conditions | 1 |
Total Lines | 100 |
Code Lines | 74 |
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 | export default class SmileyConf { |
||
2 | static getSmileys() { |
||
3 | return [ |
||
4 | { |
||
5 | syntax: '8-)', |
||
6 | icon: 'icon_cool.gif', |
||
7 | }, |
||
8 | { |
||
9 | syntax: '8-O', |
||
10 | icon: 'icon_eek.gif', |
||
11 | }, |
||
12 | { |
||
13 | syntax: '8-o', |
||
14 | icon: 'icon_eek.gif', |
||
15 | }, |
||
16 | { |
||
17 | syntax: ':-(', |
||
18 | icon: 'icon_sad.gif', |
||
19 | }, |
||
20 | { |
||
21 | syntax: ':-)', |
||
22 | icon: 'icon_smile.gif', |
||
23 | }, |
||
24 | { |
||
25 | syntax: '=)', |
||
26 | icon: 'icon_smile2.gif', |
||
27 | }, |
||
28 | { |
||
29 | syntax: ':-/', |
||
30 | icon: 'icon_doubt.gif', |
||
31 | }, |
||
32 | { |
||
33 | syntax: ':-\\', |
||
34 | icon: 'icon_doubt2.gif', |
||
35 | }, |
||
36 | { |
||
37 | syntax: ':-?', |
||
38 | icon: 'icon_confused.gif', |
||
39 | }, |
||
40 | { |
||
41 | syntax: ':-D', |
||
42 | icon: 'icon_biggrin.gif', |
||
43 | }, |
||
44 | { |
||
45 | syntax: ':-P', |
||
46 | icon: 'icon_razz.gif', |
||
47 | }, |
||
48 | { |
||
49 | syntax: ':-o', |
||
50 | icon: 'icon_surprised.gif', |
||
51 | }, |
||
52 | { |
||
53 | syntax: ':-O', |
||
54 | icon: 'icon_surprised.gif', |
||
55 | }, |
||
56 | { |
||
57 | syntax: ':-x', |
||
58 | icon: 'icon_silenced.gif', |
||
59 | }, |
||
60 | { |
||
61 | syntax: ':-X', |
||
62 | icon: 'icon_silenced.gif', |
||
63 | }, |
||
64 | { |
||
65 | syntax: ':-|', |
||
66 | icon: 'icon_neutral.gif', |
||
67 | }, |
||
68 | { |
||
69 | syntax: ';-)', |
||
70 | icon: 'icon_wink.gif', |
||
71 | }, |
||
72 | { |
||
73 | syntax: 'm(', |
||
74 | icon: 'facepalm.gif', |
||
75 | }, |
||
76 | { |
||
77 | syntax: '^_^', |
||
78 | icon: 'icon_fun.gif', |
||
79 | }, |
||
80 | { |
||
81 | syntax: ':?:', |
||
82 | icon: 'icon_question.gif', |
||
83 | }, |
||
84 | { |
||
85 | syntax: ':!:', |
||
86 | icon: 'icon_exclaim.gif', |
||
87 | }, |
||
88 | { |
||
89 | syntax: 'LOL', |
||
90 | icon: 'icon_lol.gif', |
||
91 | }, |
||
92 | { |
||
93 | syntax: 'FIXME', |
||
94 | icon: 'fixme.gif', |
||
95 | }, |
||
96 | { |
||
97 | syntax: 'DELETEME', |
||
98 | icon: 'delete.gif', |
||
99 | }, |
||
100 | ]; |
||
101 | } |
||
102 | |||
124 |