Showing 41 of 47 total issues
File AcTran.php
has 907 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* registre transactions and get data of transactions
*
* @author Uldis Nelsons
Method filter
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function filter()
{
$query = self::find()
->select([
Function getAcc
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function getAcc(int $accId, int $sysCompanyId, $ref = false)
{
$acc = AcAccount::getValidatedAcc($accId, $ref);
/**
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method periodBalanceTotal
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function periodBalanceTotal(AcPeriod $period): array
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
Method accBalanceFilter
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function accBalanceFilter(
int $accountId,
AcPeriod $period,
array $filter,
bool $addPrevBalance = false
Method safeUp
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function safeUp()
{
$sql = "
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
Method accFilterExtPeriodBalanceByDays
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function accFilterExtPeriodBalanceByDays($accList,
AcPeriod $period)
{
if (!$accList) {
Method saveDimPeriodBalance
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function saveDimPeriodBalance(AcPeriod $period)
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
INSERT INTO ac_period_balance_dim (
Method periodBalanceDimTotal
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function periodBalanceDimTotal(AcPeriod $period, array $accList,int $accDimGroupId): array
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
Method periodBalanceWithDimByCodeTotal
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function periodBalanceWithDimByCodeTotal(AcPeriod $period,int $accountId): array
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
Method getAcc
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getAcc(int $accId, int $sysCompanyId, $ref = false)
{
$acc = AcAccount::getValidatedAcc($accId, $ref);
/**
Method accBalanceFilterOld
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function accBalanceFilterOld($accountId, AcPeriod $period,
$filter, $addPrevPalance = false)
{
$selectSql = '
IFNULL(SUM(
Method periodBalanceTotal1x
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function periodBalanceTotal1x(AcPeriod $period)
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
Method accPeriodTran
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function accPeriodTran(AcRecAcc $acc, AcPeriod $period, $startBalance = true)
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
SELECT
Method periodBalanceByCodeTotal
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function periodBalanceByCodeTotal(AcPeriod $period,int $accountId): array
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
Method periodBalance
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function periodBalance(AcPeriod $period, $addPrevBalance = true)
{
$unionPrevBalanceSql = '';
if($addPrevBalance){
$unionPrevBalanceSql = '
Method setUp
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setUp()
{
if ($accs = AcAccount::findAll(['code' => 'Test'])) {
foreach ($accs as $acc) {
Method close
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function close(int $periodType, int $sysCompanyId): AcPeriod
{
if (!$lastPeriod = AcPeriod::find()
->where([
Method recalculateLabel
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function recalculateLabel(int $recAccId): void
{
$ac_def_models = AcDef::findAll([
'account_id' => $this->account->id,
'sys_company_id' => $this->sysCompanyId,
Method savePeriodBalance
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function savePeriodBalance(AcPeriod $period)
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
INSERT INTO ac_period_balance (