Conditions | 3 |
Paths | 4 |
Total Lines | 53 |
Code Lines | 41 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
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 |
||
33 | protected function getFields(): array |
||
34 | { |
||
35 | $dateFormat = (FS_DB_TYPE === 'postgresql') ? "to_char" : "date_format"; |
||
36 | $dateFormatString = (FS_DB_TYPE === 'postgresql') ? "YYYYMMDD" : "%Y%m%d"; |
||
37 | |||
38 | $data = [ |
||
39 | 'itemrow' => static::MAIN_TABLE.'.idfactura', |
||
40 | 'idempresa' => static::MAIN_TABLE.'.idempresa', |
||
41 | 'codalmacen' => static::MAIN_TABLE.'.codalmacen', |
||
42 | 'cifnif' => 'CASE WHEN length('.static::MAIN_TABLE.'.cifnif)=9 THEN ' |
||
43 | . static::MAIN_TABLE.'.cifnif WHEN length('.static::MAIN_TABLE.'.cifnif)=11 THEN ' |
||
44 | . static::MAIN_TABLE.'.cifnif ELSE NULL END', |
||
45 | 'tipoid' => 'CASE WHEN length('.static::MAIN_TABLE.'.cifnif)=9 THEN 1 WHEN length(' |
||
46 | . static::MAIN_TABLE.'.cifnif)=11 THEN 2 ELSE 3 END', |
||
47 | 'ncf' => static::MAIN_TABLE.'.numeroncf', |
||
48 | 'ncfmodifica' => static::SECONDARY_TABLE_ALIAS.'.numeroncf', |
||
49 | 'tipoingreso' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipomovimiento is null THEN \'1\' ELSE ' |
||
50 | . static::MAIN_TABLE.'.ncftipomovimiento END', |
||
51 | 'fecha' => $dateFormat.'('.static::MAIN_TABLE.'.fecha,\''.$dateFormatString.'\')', |
||
52 | // 'fecharetencion' => '\'\'', |
||
53 | 'base' => 'CASE WHEN '.static::ESTADOSDOC_TABLE.'.nombre = \'Anulada\' THEN 0 WHEN ' |
||
54 | . static::ESTADOSDOC_TABLE.'.nombre = \'Emitida\' AND '.static::MAIN_TABLE.'.neto < 0 THEN ' |
||
55 | . static::MAIN_TABLE.'.neto*-1 ELSE '.static::MAIN_TABLE.'.neto END', |
||
56 | 'itbis' => 'CASE WHEN '.static::ESTADOSDOC_TABLE.'.nombre = \'Anulada\' THEN 0 WHEN ' |
||
57 | . static::ESTADOSDOC_TABLE.'.nombre = \'Emitida\' AND '.static::MAIN_TABLE.'.totaliva < 0 THEN ' |
||
58 | . static::MAIN_TABLE.'.totaliva*-1 ELSE '.static::MAIN_TABLE.'.totaliva END', |
||
59 | // 'itbisretenido' => '0', |
||
60 | // 'itbispercibido' => '0', |
||
61 | // 'rentaretenido' => '0', |
||
62 | // 'rentapercibido' => '0', |
||
63 | // 'isc' => '0', |
||
64 | // 'otrosimpuestos' => '0', |
||
65 | // 'propinalegal' => '0', |
||
66 | 'totalefectivo' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipopago IS NULL OR ' |
||
67 | . static::MAIN_TABLE.'.ncftipopago = \'\' OR ' |
||
68 | . static::MAIN_TABLE.'.ncftipopago = \'17\' THEN ' |
||
69 | . static::MAIN_TABLE.'.total else 0 END', |
||
70 | 'totalcheque' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipopago = \'18\' THEN ' |
||
71 | . static::MAIN_TABLE.'.total else 0 END', |
||
72 | 'totaltarjeta' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipopago = \'19\' THEN ' |
||
73 | . static::MAIN_TABLE.'.total else 0 END', |
||
74 | 'totalcredito' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipopago = \'20\' THEN ' |
||
75 | . static::MAIN_TABLE.'.total else 0 END', |
||
76 | 'totalbonos' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipopago = \'21\' THEN ' |
||
77 | . static::MAIN_TABLE.'.total else 0 END', |
||
78 | 'totalpermuta' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipopago = \'22\' THEN ' |
||
79 | . static::MAIN_TABLE.'.total else 0 END', |
||
80 | 'totalotrasformas' => 'CASE WHEN '.static::MAIN_TABLE.'.ncftipopago = \'23\' THEN ' |
||
81 | . static::MAIN_TABLE.'.total else 0 END', |
||
82 | 'estado' => 'CASE WHEN '.static::ESTADOSDOC_TABLE |
||
83 | . '.nombre = \'Emitida\' THEN \'Activo\' ELSE \'Anulado\' END', |
||
84 | ]; |
||
85 | return $data; |
||
86 | } |
||
114 |
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