Conditions | 2 |
Paths | 2 |
Total Lines | 69 |
Code Lines | 37 |
Lines | 0 |
Ratio | 0 % |
Changes | 5 | ||
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 |
||
50 | protected function initCollectors(bool $addDebugCollector = false): void |
||
51 | { |
||
52 | $this->collectors[] = new DnfPackageCollector(); |
||
53 | |||
54 | // Inventorio |
||
55 | $this->collectors[] = new InventorioCollector( |
||
56 | $this->isRemoteEnabled(), |
||
57 | $this->areLogfilesEnabled(), |
||
58 | $this->isCollectEnabled(), |
||
59 | $this->isSmartCareEnabled(), |
||
60 | $this->config |
||
61 | ); |
||
62 | |||
63 | if ($addDebugCollector) { |
||
64 | // for later |
||
65 | } |
||
66 | |||
67 | $this->collectors[] = new CommandCollector($this->config); |
||
68 | // $this->collectors[] = new RandomCollector(); |
||
69 | |||
70 | // General |
||
71 | $this->collectors[] = new OperatingSystemCollector(); |
||
72 | |||
73 | // Hosting |
||
74 | $this->collectors[] = new ASNCollector(); |
||
75 | |||
76 | // Metrics |
||
77 | $this->collectors[] = new MetricThresholdCollector(); |
||
78 | |||
79 | // System / General |
||
80 | $this->collectors[] = new IpCollector(); |
||
81 | $this->collectors[] = new UptimeCollector(); |
||
82 | $this->collectors[] = new PortsCollector(); |
||
83 | $this->collectors[] = new ConfigurationCollector(); |
||
84 | $this->collectors[] = new CronCollector(); |
||
85 | $this->collectors[] = new UserCollector(); |
||
86 | $this->collectors[] = new LogrotateCollector(); |
||
87 | $this->collectors[] = new DiskCollector(); |
||
88 | $this->collectors[] = new DockerCollector(); |
||
89 | |||
90 | // System / Services |
||
91 | $this->collectors[] = new SystemDCollector(); |
||
92 | |||
93 | // System / Security |
||
94 | $this->collectors[] = new GeneralSecurityCollector(); |
||
95 | $this->collectors[] = new AuthorizedKeysCollector(); |
||
96 | |||
97 | // Package Managers |
||
98 | $this->collectors[] = new BrewPackageCollector(); |
||
99 | $this->collectors[] = new DpkgPackageCollector(); |
||
100 | |||
101 | // Application / Programming Language |
||
102 | $this->collectors[] = new PhpCollector(); |
||
103 | $this->collectors[] = new WebProsMonitoringCollector(); |
||
104 | |||
105 | // Application / WebServer |
||
106 | $this->collectors[] = new ApacheServerNameCollector(); |
||
107 | $this->collectors[] = new ApacheConfigurationCollector(); |
||
108 | |||
109 | $this->collectors[] = new NginxServerNameCollector(); |
||
110 | $this->collectors[] = new NginxConfigurationCollector(); |
||
111 | |||
112 | $this->collectors[] = new HeaderCollector(); |
||
113 | |||
114 | // INVENTORY AWARE |
||
115 | $this->collectors[] = new WordPressCollector(); |
||
116 | $this->collectors[] = new DatabaseCredentialCollector(); |
||
117 | $this->collectors[] = new ResponseCollector(); |
||
118 | $this->collectors[] = new SymfonyCollector(); |
||
119 | } |
||
121 |