Passed
Push — master ( 8f169b...36019d )
by Rafael
01:27
created

padding.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 52

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
nc 1
dl 0
loc 52
rs 9.4929
cc 1
nop 1

How to fix   Long Method   

Long Method

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:

1
import { MultiSlider } from '../multi-slider';
2
3
export class Padding extends MultiSlider {
4
	constructor( options ) {
5
		super( options );
6
7
		this.controlOptions = {
8
			control: {
9
				title: 'Padding',
10
				name: 'padding',
11
				units: {
12
					enabled: [ 'px', 'em', '%' ]
13
				},
14
				sliders: [
15
					{ name: 'top', label: 'Top', cssProperty: 'padding-top' },
16
					{ name: 'right', label: 'Right', cssProperty: 'padding-right' },
17
					{ name: 'bottom', label: 'Bottom', cssProperty: 'padding-bottom' },
18
					{ name: 'left', label: 'Left', cssProperty: 'padding-left' }
19
				]
20
			},
21
			setting: {
22
				css: '',
23
				settings: [
24
					{
25
						media: [ 'base', 'phone', 'tablet', 'desktop', 'large' ],
26
						unit: 'em',
27
						isLinked: false,
28
						values: {
29
							top: 0,
30
							right: 0,
31
							bottom: 0,
32
							left: 0
33
						}
34
					}
35
				]
36
			},
37
			slider: {
38
				px: {
39
					min: 0,
40
					max: 100,
41
					step: 1
42
				},
43
				'%': {
44
					min: 0,
45
					max: 20,
46
					step: 0.1
47
				},
48
				em: {
49
					min: 0,
50
					max: 5,
51
					step: 0.1
52
				}
53
			}
54
		};
55
	}
56
}
57
58
export { Padding as default };
59