Conditions | 1 |
Paths | 1 |
Total Lines | 79 |
Code Lines | 60 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 | <?php |
||
26 | protected function configure() |
||
27 | { |
||
28 | $this |
||
29 | ->setName('phpmnd') |
||
30 | ->setDefinition( |
||
31 | [ |
||
32 | new InputArgument( |
||
33 | 'directory', |
||
34 | InputArgument::REQUIRED, |
||
35 | 'Directory to analyze' |
||
36 | ) |
||
37 | ] |
||
38 | ) |
||
39 | ->addOption( |
||
40 | 'extensions', |
||
41 | null, |
||
42 | InputOption::VALUE_REQUIRED, |
||
43 | 'A comma-separated list of extensions', |
||
44 | [] |
||
45 | ) |
||
46 | ->addOption( |
||
47 | 'ignore-numbers', |
||
48 | null, |
||
49 | InputOption::VALUE_REQUIRED, |
||
50 | 'A comma-separated list of numbers to ignore', |
||
51 | [0, 1] |
||
52 | ) |
||
53 | ->addOption( |
||
54 | 'ignore-funcs', |
||
55 | null, |
||
56 | InputOption::VALUE_REQUIRED, |
||
57 | 'A comma-separated list of functions to ignore when using "argument" extension', |
||
58 | [] |
||
59 | ) |
||
60 | ->addOption( |
||
61 | 'exclude', |
||
62 | null, |
||
63 | InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
||
64 | 'Exclude a directory from code analysis (must be relative to source)' |
||
65 | ) |
||
66 | ->addOption( |
||
67 | 'exclude-path', |
||
68 | null, |
||
69 | InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
||
70 | 'Exclude a path from code analysis (must be relative to source)' |
||
71 | ) |
||
72 | ->addOption( |
||
73 | 'exclude-file', |
||
74 | null, |
||
75 | InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
||
76 | 'Exclude a file from code analysis (must be relative to source)' |
||
77 | ) |
||
78 | ->addOption( |
||
79 | 'suffixes', |
||
80 | null, |
||
81 | InputOption::VALUE_REQUIRED, |
||
82 | 'Comma-separated string of valid source code filename extensions', |
||
83 | 'php' |
||
84 | ) |
||
85 | ->addOption( |
||
86 | 'progress', |
||
87 | null, |
||
88 | InputOption::VALUE_NONE, |
||
89 | 'Show progress bar' |
||
90 | ) |
||
91 | ->addOption( |
||
92 | 'strings', |
||
93 | null, |
||
94 | InputOption::VALUE_NONE, |
||
95 | 'Include strings literal search in code analysis' |
||
96 | ) |
||
97 | ->addOption( |
||
98 | 'ignore-strings', |
||
99 | null, |
||
100 | InputOption::VALUE_REQUIRED, |
||
101 | 'A comma-separated list of strings to ignore when using "strings" option', |
||
102 | [] |
||
103 | ); |
||
104 | } |
||
105 | |||
209 |