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