Conditions | 1 |
Paths | 1 |
Total Lines | 62 |
Code Lines | 33 |
Lines | 0 |
Ratio | 0 % |
Tests | 26 |
CRAP Score | 1 |
Changes | 4 | ||
Bugs | 0 | 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 |
||
33 | 19 | public function __construct(array $values = array()) |
|
34 | 19 | { |
|
35 | 19 | parent::__construct($values); |
|
36 | |||
37 | 19 | $this['app_name'] = 'SVN-Buddy'; |
|
38 | 19 | $this['app_version'] = '@git-version@'; |
|
39 | |||
40 | 19 | $this['working_directory_sub_folder'] = '.svn-buddy'; |
|
41 | |||
42 | 19 | $this['config_defaults'] = array( |
|
43 | 19 | 'repository-connector.username' => '', |
|
44 | 19 | 'repository-connector.password' => '', |
|
45 | 19 | 'repository-connector.last-revision-cache-duration' => '10 minutes', |
|
46 | ); |
||
47 | |||
48 | $this->extend('output', function ($output, $c) { |
||
1 ignored issue
–
show
|
|||
49 | /** @var OutputInterface $output */ |
||
50 | 19 | $output->getFormatter()->setStyle('debug', new OutputFormatterStyle('white', 'magenta')); |
|
51 | |||
52 | 5 | return $output; |
|
53 | 19 | }); |
|
54 | |||
55 | $this['process_factory'] = function () { |
||
56 | 3 | return new ProcessFactory(); |
|
57 | }; |
||
58 | |||
59 | $this['merge_source_detector'] = function () { |
||
60 | 1 | $merge_source_detector = new MergeSourceDetectorAggregator(0); |
|
61 | 1 | $merge_source_detector->add(new ClassicMergeSourceDetector(0)); |
|
62 | 1 | $merge_source_detector->add(new InPortalMergeSourceDetector(50)); |
|
63 | |||
64 | 1 | return $merge_source_detector; |
|
65 | }; |
||
66 | |||
67 | $this['repository_url_resolver'] = function ($c) { |
||
68 | return new UrlResolver($c['repository_connector']); |
||
69 | }; |
||
70 | |||
71 | $this['cache_manager'] = function ($c) { |
||
72 | 3 | return new CacheManager($c['working_directory'], $c['io']); |
|
73 | }; |
||
74 | |||
75 | $this['revision_log_factory'] = function ($c) { |
||
76 | 1 | return new RevisionLogFactory($c['repository_connector'], $c['cache_manager']); |
|
77 | }; |
||
78 | |||
79 | $this['revision_list_parser'] = function () { |
||
80 | 1 | return new RevisionListParser(); |
|
81 | }; |
||
82 | |||
83 | $this['repository_connector'] = function ($c) { |
||
84 | 2 | return new Connector($c['config_editor'], $c['process_factory'], $c['io'], $c['cache_manager']); |
|
85 | }; |
||
86 | |||
87 | $this['date_helper'] = function () { |
||
88 | 1 | return new DateHelper(); |
|
89 | }; |
||
90 | |||
91 | 1 | $this['editor'] = function () { |
|
92 | 1 | return new InteractiveEditor(); |
|
93 | }; |
||
94 | 19 | } |
|
95 | |||
97 |