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