mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-27 08:46:40 -06:00
Code clean up. [skip ci]
This commit is contained in:
parent
d551333fa2
commit
dfbe6e5b6e
@ -1,36 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
command line:
|
||||
|
||||
phpmd app html ./_development/phpmd/phpmd.xml > ./public/result.html
|
||||
|
||||
-->
|
||||
<ruleset name="pcsg-generated-ruleset"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/
|
||||
</description>
|
||||
<description>Bla bla</description>
|
||||
|
||||
<!-- Import the entire controversial code rule set, except one -->
|
||||
<rule ref="rulesets/controversial.xml">
|
||||
<exclude name="CamelCasePropertyName" />
|
||||
</rule>
|
||||
|
||||
<!-- clean code -->
|
||||
<!-- <rule ref="rulesets/cleancode.xml" /> -->
|
||||
<rule ref="rulesets/codesize.xml" />
|
||||
<rule ref="rulesets/design.xml" />
|
||||
<rule ref="rulesets/naming.xml" />
|
||||
<rule ref="rulesets/unusedcode.xml" />
|
||||
|
||||
<!-- clean code static calling rule can be a little more lax: -->
|
||||
<rule ref="rulesets/cleancode.xml">
|
||||
<exclude name="StaticAccess" />
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- report level 5 for cyclomatic complexity -->
|
||||
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="reportLevel" value="5"/>
|
||||
</properties>
|
||||
<properties>
|
||||
<property name="reportLevel" value="5"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/NPathComplexity">
|
||||
<properties>
|
||||
<property name="minimum" value="128"/>
|
||||
</properties>
|
||||
<properties>
|
||||
<property name="minimum" value="128"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
|
||||
<properties>
|
||||
<property name="minimum" value="40"/>
|
||||
</properties>
|
||||
<properties>
|
||||
<property name="minimum" value="40"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
|
||||
<properties>
|
||||
<property name="minimum" value="5"/>
|
||||
</properties>
|
||||
<properties>
|
||||
<property name="minimum" value="5"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- Import rule set and exclude rules -->
|
||||
<rule ref="rulesets/controversial.xml">
|
||||
<exclude name="CamelCasePropertyName" />
|
||||
</rule>
|
||||
|
||||
|
||||
</ruleset>
|
||||
</ruleset>
|
@ -61,7 +61,6 @@ class Kernel extends ConsoleKernel
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameters)
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
|
@ -10,6 +10,7 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Export;
|
||||
|
||||
use FireflyIII\Export\Entry\Entry;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use Log;
|
||||
use Storage;
|
||||
|
@ -8,7 +8,7 @@ declare(strict_types = 1);
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Export;
|
||||
namespace FireflyIII\Export\Entry;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Budget;
|
||||
@ -30,7 +30,7 @@ use FireflyIII\Models\TransactionJournal;
|
||||
*
|
||||
* Class Entry
|
||||
*
|
||||
* @package FireflyIII\Export
|
||||
* @package FireflyIII\Export\Entry
|
||||
*/
|
||||
class Entry
|
||||
{
|
@ -10,7 +10,7 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Export\Exporter;
|
||||
|
||||
use FireflyIII\Export\Entry;
|
||||
use FireflyIII\Export\Entry\Entry;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use League\Csv\Writer;
|
||||
use SplFileObject;
|
||||
|
@ -13,6 +13,7 @@ namespace FireflyIII\Export;
|
||||
use Auth;
|
||||
use Config;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Export\Entry\Entry;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Journal\JournalCollector;
|
||||
|
@ -178,7 +178,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*
|
||||
*
|
||||
* @return BalanceLine
|
||||
*/
|
||||
|
@ -232,7 +232,6 @@ class BudgetController extends Controller
|
||||
* @param Collection $accounts
|
||||
* @param Collection $budgets
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveParameterList) // need all parameters
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
|
@ -49,8 +49,6 @@ class CategoryController extends Controller
|
||||
* @param SCRI $repository
|
||||
* @param Category $category
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function all(SCRI $repository, Category $category)
|
||||
@ -115,10 +113,6 @@ class CategoryController extends Controller
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveParameterList) // cant avoid it.
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // it's long but ok.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function earnedInPeriod(CRI $repository, string $reportType, Carbon $start, Carbon $end, Collection $accounts)
|
||||
@ -307,8 +301,6 @@ class CategoryController extends Controller
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveParameterList) // need all parameters
|
||||
* @SuppressWarnings(PHPMD.ExcessuveMethodLength) // need the length
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
|
@ -88,7 +88,6 @@ class ReportController extends Controller
|
||||
* @param Carbon $end
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveParameterList) // cant avoid it.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
|
@ -337,7 +337,6 @@ class CsvController extends Controller
|
||||
*
|
||||
* STEP SIX
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) it's 6, but it's allright.
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
@ -383,9 +382,6 @@ class CsvController extends Controller
|
||||
*
|
||||
* STEP TWO
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // need the length.
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // its exactly 5, its ok
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
|
@ -566,8 +566,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
* @param Account $account
|
||||
* @param array $data
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // need the complexity.
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public function update(Account $account, array $data): Account
|
||||
|
@ -310,8 +310,6 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // it's a query.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array
|
||||
|
@ -388,7 +388,6 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
protected function storeAccounts(TransactionType $type, array $data): array
|
||||
{
|
||||
|
@ -36,8 +36,6 @@ class TagRepository implements TagRepositoryInterface
|
||||
* @param TransactionJournal $journal
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function connect(TransactionJournal $journal, Tag $tag): bool
|
||||
@ -139,8 +137,6 @@ class TagRepository implements TagRepositoryInterface
|
||||
* @param TransactionJournal $journal
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag): bool
|
||||
@ -222,7 +218,6 @@ class TagRepository implements TagRepositoryInterface
|
||||
* @param TransactionJournal $journal
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's complex but nothing can be done.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -237,7 +237,6 @@ class TestData
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return TransactionJournal
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public static function createCar(User $user, Carbon $date): TransactionJournal
|
||||
{
|
||||
@ -283,7 +282,6 @@ class TestData
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public static function createDrinksAndOthers(User $user, Carbon $date): bool
|
||||
{
|
||||
@ -350,7 +348,6 @@ class TestData
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public static function createGroceries(User $user, Carbon $date): bool
|
||||
{
|
||||
@ -453,7 +450,6 @@ class TestData
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public static function createPiggybanks(User $user): bool
|
||||
{
|
||||
|
@ -38,7 +38,6 @@ class FireflyValidator extends Validator
|
||||
* @param array $messages
|
||||
* @param array $customAttributes
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveParameterList) // inherited from Laravel.
|
||||
*/
|
||||
public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [])
|
||||
{
|
||||
@ -50,7 +49,6 @@ class FireflyValidator extends Validator
|
||||
* @param $value
|
||||
* @param $parameters
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@ -92,7 +90,6 @@ class FireflyValidator extends Validator
|
||||
* @param $attribute
|
||||
* @param $value
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@ -214,7 +211,6 @@ class FireflyValidator extends Validator
|
||||
* @param $value
|
||||
* @param $parameters
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@ -279,7 +275,6 @@ class FireflyValidator extends Validator
|
||||
* @param $value
|
||||
* @param $parameters
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@ -310,7 +305,6 @@ class FireflyValidator extends Validator
|
||||
* @param $value
|
||||
* @param $parameters
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@ -342,9 +336,6 @@ class FireflyValidator extends Validator
|
||||
* @param $value
|
||||
* @param $parameters
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) // cant remove it
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // its as simple as I can get it.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validateUniquePiggyBankForUser($attribute, $value, $parameters): bool
|
||||
|
Loading…
Reference in New Issue
Block a user