Test Failed
Branch main (fda838)
by Rafael
50:22
created

Facture   F

Complexity

Total Complexity 938

Size/Duplication

Total Lines 5953
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3298
dl 0
loc 5953
rs 0.8
c 0
b 0
f 0
wmc 938

How to fix   Complexity   

Complex Class

Complex classes like Facture often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Facture, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/* Copyright (C) 2002-2007  Rodolphe Quiedeville    <[email protected]>
4
 * Copyright (C) 2004-2013  Laurent Destailleur     <[email protected]>
5
 * Copyright (C) 2004       Sebastien Di Cintio     <[email protected]>
6
 * Copyright (C) 2004       Benoit Mortier          <[email protected]>
7
 * Copyright (C) 2005       Marc Barilley / Ocebo   <[email protected]>
8
 * Copyright (C) 2005-2014  Regis Houssin           <[email protected]>
9
 * Copyright (C) 2006       Andre Cianfarani        <[email protected]>
10
 * Copyright (C) 2007       Franky Van Liedekerke   <[email protected]>
11
 * Copyright (C) 2010-2020  Juanjo Menent           <[email protected]>
12
 * Copyright (C) 2012-2014  Christophe Battarel     <[email protected]>
13
 * Copyright (C) 2012-2015  Marcos García           <[email protected]>
14
 * Copyright (C) 2012       Cédric Salvador         <[email protected]>
15
 * Copyright (C) 2012-2014  Raphaël Doursenaud      <[email protected]>
16
 * Copyright (C) 2013       Cedric Gross            <[email protected]>
17
 * Copyright (C) 2013       Florian Henry           <[email protected]>
18
 * Copyright (C) 2016-2022  Ferran Marcet           <[email protected]>
19
 * Copyright (C) 2018-2022  Alexandre Spangaro		<[email protected]>
20
 * Copyright (C) 2018       Nicolas ZABOURI         <[email protected]>
21
 * Copyright (C) 2022       Sylvain Legrand         <[email protected]>
22
 * Copyright (C) 2023      	Gauthier VERDOL       	<[email protected]>
23
 * Copyright (C) 2023		Nick Fragoulis
24
 * Copyright (C) 2024		MDW							<[email protected]>
25
 * Copyright (C) 2024       Frédéric France             <[email protected]>
26
 *
27
 * This program is free software; you can redistribute it and/or modify
28
 * it under the terms of the GNU General Public License as published by
29
 * the Free Software Foundation; either version 3 of the License, or
30
 * (at your option) any later version.
31
 *
32
 * This program is distributed in the hope that it will be useful,
33
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
34
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
35
 * GNU General Public License for more details.
36
 *
37
 * You should have received a copy of the GNU General Public License
38
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
39
 */
40
41
/**
42
 *  \file       htdocs/compta/facture/class/facture.class.php
43
 *  \ingroup    facture
44
 *  \brief      File of class to manage invoices
45
 *
46
 * Replaced by Deprecated/Modules/Billing/Model/Invoice.php
47
 * Replaced by Deprecated/Modules/Billing/Model/Facture.php (virtual)
48
 */
49