Conditions | 1 |
Paths | 1 |
Total Lines | 106 |
Code Lines | 62 |
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 |
||
60 | public function __construct() |
||
61 | { |
||
62 | parent::__construct(self::APP_ID); |
||
63 | |||
64 | $container = $this->getContainer(); |
||
65 | |||
66 | // mapper |
||
67 | $container->registerService('FileOperationMapper', function ($c) { |
||
68 | return new FileOperationMapper( |
||
69 | $c->query('ServerContainer')->getDb() |
||
70 | ); |
||
71 | }); |
||
72 | |||
73 | // services |
||
74 | $container->registerService('FileOperationService', function ($c) { |
||
75 | return new FileOperationService( |
||
76 | $c->query(FileOperationMapper::class), |
||
77 | $c->query('ServerContainer')->getUserSession()->getUser()->getUID() |
||
78 | ); |
||
79 | }); |
||
80 | |||
81 | // classifier |
||
82 | $container->registerService('Classifier', function ($c) { |
||
83 | return new Classifier( |
||
84 | $c->query(ILogger::class), |
||
85 | $c->query(FileOperationMapper::class), |
||
86 | $c->query(FileOperationService::class) |
||
87 | ); |
||
88 | }); |
||
89 | |||
90 | // entropy |
||
91 | $container->registerService('Entropy', function ($c) { |
||
92 | return new Entropy( |
||
93 | $c->query(ILogger::class) |
||
94 | ); |
||
95 | }); |
||
96 | |||
97 | // analyzer |
||
98 | $container->registerService('SequenceSizeAnalyzer', function ($c) { |
||
99 | return new SequenceSizeAnalyzer(); |
||
100 | }); |
||
101 | |||
102 | $container->registerService('FileTypeFunnellingAnalyzer', function ($c) { |
||
103 | return new FileTypeFunnellingAnalyzer(); |
||
104 | }); |
||
105 | |||
106 | $container->registerService('EntropyFunnellingAnalyzer', function ($c) { |
||
107 | return new EntropyFunnellingAnalyzer( |
||
108 | $c->query(ILogger::class) |
||
109 | ); |
||
110 | }); |
||
111 | |||
112 | $container->registerService('FileExtensionAnalyzer', function ($c) { |
||
113 | return new FileExtensionAnalyzer( |
||
114 | $c->query(ILogger::class), |
||
115 | $c->query(Entropy::class) |
||
116 | |||
117 | ); |
||
118 | }); |
||
119 | |||
120 | $container->registerService('SequenceAnalyzer', function ($c) { |
||
121 | return new SequenceAnalyzer( |
||
122 | $c->query(SequenceSizeAnalyzer::class), |
||
123 | $c->query(FileTypeFunnellingAnalyzer::class), |
||
124 | $c->query(EntropyFunnellingAnalyzer::class) |
||
125 | ); |
||
126 | }); |
||
127 | |||
128 | $container->registerService('EntropyAnalyzer', function ($c) { |
||
129 | return new EntropyAnalyzer( |
||
130 | $c->query(ILogger::class), |
||
131 | $c->query(IRootFolder::class), |
||
132 | $c->query(Entropy::class), |
||
133 | $c->query('ServerContainer')->getUserSession()->getUser()->getUID() |
||
134 | ); |
||
135 | }); |
||
136 | |||
137 | $container->registerService('FileCorruptionAnalyzer', function ($c) { |
||
138 | return new FileCorruptionAnalyzer( |
||
139 | $c->query(ILogger::class), |
||
140 | $c->query(IRootFolder::class), |
||
141 | $c->query('ServerContainer')->getUserSession()->getUser()->getUID() |
||
142 | ); |
||
143 | }); |
||
144 | |||
145 | $container->registerService('Monitor', function ($c) { |
||
146 | return new Monitor( |
||
147 | $c->query(IRequest::class), |
||
148 | $c->query(IConfig::class), |
||
149 | $c->query(ITimeFactory::class), |
||
150 | $c->query(IAppManager::class), |
||
151 | $c->query(ILogger::class), |
||
152 | $c->query(IRootFolder::class), |
||
153 | $c->query(EntropyAnalyzer::class), |
||
154 | $c->query(FileOperationMapper::class), |
||
155 | $c->query(FileExtensionAnalyzer::class), |
||
156 | $c->query(FileCorruptionAnalyzer::class), |
||
157 | $c->query('ServerContainer')->getUserSession()->getUser()->getUID() |
||
158 | ); |
||
159 | }); |
||
160 | |||
161 | $container->registerService('FilesEvents', function ($c) { |
||
162 | return new FilesEvents( |
||
163 | $c->query(ILogger::class), |
||
164 | $c->query(Monitor::class), |
||
165 | $c->query('ServerContainer')->getUserSession()->getUser()->getUID() |
||
166 | ); |
||
203 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths