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

AccountancyExport   F

Complexity

Total Complexity 292

Size/Duplication

Total Lines 2585
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 1426
dl 0
loc 2585
rs 0.8
c 0
b 0
f 0
wmc 292

How to fix   Complexity   

Complex Class

Complex classes like AccountancyExport 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 AccountancyExport, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/*
4
 * Copyright (C) 2007-2012  Laurent Destailleur <[email protected]>
5
 * Copyright (C) 2014       Juanjo Menent       <[email protected]>
6
 * Copyright (C) 2015       Florian Henry       <[email protected]>
7
 * Copyright (C) 2015       Raphaël Doursenaud  <[email protected]>
8
 * Copyright (C) 2016       Pierre-Henry Favre  <[email protected]>
9
 * Copyright (C) 2016-2023  Alexandre Spangaro  <[email protected]>
10
 * Copyright (C) 2022  		Lionel Vessiller    <[email protected]>
11
 * Copyright (C) 2013-2017  Olivier Geffroy     <[email protected]>
12
 * Copyright (C) 2017       Elarifr. Ari Elbaz  <[email protected]>
13
 * Copyright (C) 2017-2019  Frédéric France     <[email protected]>
14
 * Copyright (C) 2017       André Schild        <[email protected]>
15
 * Copyright (C) 2020       Guillaume Alexandre <[email protected]>
16
 * Copyright (C) 2022		Joachim Kueter		<[email protected]>
17
 * Copyright (C) 2022  		Progiseize         	<[email protected]>
18
 * Copyright (C) 2024		MDW							<[email protected]>
19
 *
20
 * This program is free software; you can redistribute it and/or modify
21
 * it under the terms of the GNU General Public License as published by
22
 * the Free Software Foundation; either version 3 of the License, or
23
 * (at your option) any later version.
24
 *
25
 * This program is distributed in the hope that it will be useful,
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
 * GNU General Public License for more details.
29
 *
30
 * You should have received a copy of the GNU General Public License
31
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
32
 */
33
34
/**
35
 * \file        htdocs/accountancy/class/accountancyexport.class.php
36
 * \ingroup     Accountancy (Double entries)
37
 * \brief       Class accountancy export
38
 *
39
 * Replaced by Deprecated/Modules/Accounting/Model/AccountancyExport.php
40
 */
41