| Conditions | 1 |
| Paths | 1 |
| Total Lines | 58 |
| Code Lines | 38 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 1 |
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 |
||
| 32 | protected function configure() |
||
| 33 | { |
||
| 34 | $this |
||
| 35 | ->setName('metrics') |
||
| 36 | ->setDescription('Run analysis') |
||
| 37 | ->addArgument( |
||
| 38 | 'path', InputArgument::OPTIONAL, 'Path to explore' |
||
| 39 | ) |
||
| 40 | ->addOption( |
||
| 41 | 'report-html',null, InputOption::VALUE_REQUIRED, 'Path to save report in HTML format. Example: /tmp/report.html' |
||
| 42 | ) |
||
| 43 | ->addOption( |
||
| 44 | 'report-xml', null, InputOption::VALUE_REQUIRED, 'Path to save summary report in XML format. Example: /tmp/report.xml' |
||
| 45 | ) |
||
| 46 | ->addOption( |
||
| 47 | 'report-cli', null, InputOption::VALUE_NONE, 'Enable report in terminal' |
||
| 48 | ) |
||
| 49 | ->addOption( |
||
| 50 | 'violations-xml', null, InputOption::VALUE_REQUIRED, 'Path to save violations in XML format. Example: /tmp/report.xml' |
||
| 51 | ) |
||
| 52 | ->addOption( |
||
| 53 | 'report-csv', null, InputOption::VALUE_REQUIRED, 'Path to save summary report in CSV format. Example: /tmp/report.csv' |
||
| 54 | ) |
||
| 55 | ->addOption( |
||
| 56 | 'report-json', null, InputOption::VALUE_REQUIRED, 'Path to save detailed report in JSON format. Example: /tmp/report.json' |
||
| 57 | ) |
||
| 58 | ->addOption( |
||
| 59 | 'chart-bubbles', null, InputOption::VALUE_REQUIRED, 'Path to save Bubbles chart, in SVG format. Example: /tmp/chart.svg. Graphviz **IS** required' |
||
| 60 | ) |
||
| 61 | ->addOption( |
||
| 62 | 'level', null, InputOption::VALUE_REQUIRED, 'Depth of summary report', 0 |
||
| 63 | ) |
||
| 64 | ->addOption( |
||
| 65 | 'extensions', null, InputOption::VALUE_REQUIRED, 'Regex of extensions to include', null |
||
| 66 | ) |
||
| 67 | ->addOption( |
||
| 68 | 'excluded-dirs', null, InputOption::VALUE_REQUIRED, 'Regex of subdirectories to exclude', null |
||
| 69 | ) |
||
| 70 | ->addOption( |
||
| 71 | 'symlinks', null, InputOption::VALUE_NONE, 'Enable following symlinks' |
||
| 72 | ) |
||
| 73 | ->addOption( |
||
| 74 | 'without-oop', null, InputOption::VALUE_NONE, 'If provided, tool will not extract any information about OOP model (faster)' |
||
| 75 | ) |
||
| 76 | ->addOption( |
||
| 77 | 'ignore-errors', null, InputOption::VALUE_NONE, 'If provided, files will be analyzed even with syntax errors' |
||
| 78 | ) |
||
| 79 | ->addOption( |
||
| 80 | 'failure-condition', null, InputOption::VALUE_REQUIRED, 'Optional failure condition, in english. For example: average.maintainabilityIndex < 50 or sum.loc > 10000', null |
||
| 81 | ) |
||
| 82 | ->addOption( |
||
| 83 | 'config', null, InputOption::VALUE_REQUIRED, 'Config file (YAML)', null |
||
| 84 | ) |
||
| 85 | ->addOption( |
||
| 86 | 'template-title', null, InputOption::VALUE_REQUIRED, 'Title for the HTML summary report', null |
||
| 87 | ) |
||
| 88 | ; |
||
| 89 | } |
||
| 90 | |||
| 143 |