Conditions | 9 |
Paths | 256 |
Total Lines | 76 |
Code Lines | 44 |
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 |
||
132 | protected static function defineAliases() |
||
133 | { |
||
134 | // PHPUnit Compat. |
||
135 | if ( \class_exists('\PHPUnit_Framework_IncompleteTestError') ) { |
||
136 | \class_alias( |
||
137 | '\PHPUnit_Framework_IncompleteTestError', |
||
138 | '\ConsoleHelpers\PHPUnitCompat\Framework\IncompleteTestError' |
||
139 | ); |
||
140 | } |
||
141 | else { |
||
142 | \class_alias( |
||
143 | '\PHPUnit\Framework\IncompleteTestError', |
||
144 | '\ConsoleHelpers\PHPUnitCompat\Framework\IncompleteTestError' |
||
145 | ); |
||
146 | } |
||
147 | |||
148 | if ( class_exists('\PHPUnit_Framework_SkippedTestError') ) { |
||
149 | \class_alias('\PHPUnit_Framework_SkippedTestError', '\ConsoleHelpers\PHPUnitCompat\Framework\SkippedTestError'); |
||
150 | } |
||
151 | else { |
||
152 | \class_alias('\PHPUnit\Framework\SkippedTestError', '\ConsoleHelpers\PHPUnitCompat\Framework\SkippedTestError'); |
||
153 | } |
||
154 | |||
155 | if ( class_exists('\PHPUnit_Framework_TestSuite_DataProvider') ) { |
||
156 | \class_alias( |
||
157 | '\PHPUnit_Framework_TestSuite_DataProvider', |
||
158 | '\ConsoleHelpers\PHPUnitCompat\Framework\DataProviderTestSuite' |
||
159 | ); |
||
160 | } |
||
161 | else { |
||
162 | \class_alias( |
||
163 | '\PHPUnit\Framework\DataProviderTestSuite', |
||
164 | '\ConsoleHelpers\PHPUnitCompat\Framework\DataProviderTestSuite' |
||
165 | ); |
||
166 | } |
||
167 | |||
168 | if ( class_exists('\PHPUnit_Framework_TestResult') ) { |
||
169 | \class_alias('\PHPUnit_Framework_TestResult', '\ConsoleHelpers\PHPUnitCompat\Framework\TestResult'); |
||
170 | } |
||
171 | else { |
||
172 | \class_alias('\PHPUnit\Framework\TestResult', '\ConsoleHelpers\PHPUnitCompat\Framework\TestResult'); |
||
173 | } |
||
174 | |||
175 | if ( class_exists('\PHPUnit_Framework_Test') ) { |
||
176 | \class_alias('\PHPUnit_Framework_Test', '\ConsoleHelpers\PHPUnitCompat\Framework\Test'); |
||
177 | } |
||
178 | else { |
||
179 | \class_alias('\PHPUnit\Framework\Test', '\ConsoleHelpers\PHPUnitCompat\Framework\Test'); |
||
180 | } |
||
181 | |||
182 | // CodeCoverage Compat. |
||
183 | if ( class_exists('\PHP_CodeCoverage') ) { |
||
184 | \class_alias('\PHP_CodeCoverage', '\ConsoleHelpers\CodeCoverageCompat\CodeCoverage'); |
||
185 | } |
||
186 | else { |
||
187 | \class_alias( |
||
188 | '\SebastianBergmann\CodeCoverage\CodeCoverage', |
||
189 | '\ConsoleHelpers\CodeCoverageCompat\CodeCoverage' |
||
190 | ); |
||
191 | } |
||
192 | |||
193 | if ( \interface_exists('\PHP_CodeCoverage_Driver') ) { |
||
194 | \class_alias('\PHP_CodeCoverage_Driver', '\ConsoleHelpers\CodeCoverageCompat\Driver\Driver'); |
||
195 | } |
||
196 | else { |
||
197 | \class_alias( |
||
198 | '\SebastianBergmann\CodeCoverage\Driver\Driver', |
||
199 | '\ConsoleHelpers\CodeCoverageCompat\Driver\Driver' |
||
200 | ); |
||
201 | } |
||
202 | |||
203 | if ( class_exists('\PHP_CodeCoverage_Filter') ) { |
||
204 | \class_alias('\PHP_CodeCoverage_Filter', '\ConsoleHelpers\CodeCoverageCompat\Filter'); |
||
205 | } |
||
206 | else { |
||
207 | \class_alias('\SebastianBergmann\CodeCoverage\Filter', '\ConsoleHelpers\CodeCoverageCompat\Filter'); |
||
208 | } |
||
215 |
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