Showing 41 of 47 total issues
Method accFilterAccPeriodBalanceByDays
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function accFilterAccPeriodBalanceByDays(AcRecAcc $acc,
$accFilter,
AcPeriod $period)
{
if (!is_array($accFilter)) {
Method accByDaysFilter
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function accByDaysFilter($accountId, AcPeriod $period, $filter)
{
$join = $where = $broupBy = [];
foreach (AcAccount::findOne($accountId)->getAcDefs()->all() as $acDef) {
Method accPeriodBalanceByDays
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function accPeriodBalanceByDays(AcRecAcc $acc, AcPeriod $period, $addPrevToFirstDay = true)
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
SELECT
Method safeUp
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeUp() {
$this->execute('
ALTER TABLE `ac_account`
ADD COLUMN `sys_company_id` SMALLINT UNSIGNED DEFAULT 0 NOT NULL AFTER `id`;
Method testAcRecAccGetValidatedAccc
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAcRecAccGetValidatedAccc()
{
/**
* get accounts
*/
Method registre2
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function registre2(
AcRecAcc $debitAcc,
AcRecAcc $creditAcc,
float $amt,
string $date,
Function recalculateLabel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function recalculateLabel(int $recAccId): void
{
$ac_def_models = AcDef::findAll([
'account_id' => $this->account->id,
'sys_company_id' => $this->sysCompanyId,
- 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 accBalanceFilter
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function accBalanceFilter($accountId, AcPeriod $period,
$filter)
{
$select = $join = [];
Method safeUp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. 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 addNewPeriod
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function addNewPeriod(int $periodType, int $sysCompanyId): AcPeriod
{
if (!$lastPeriod = AcPeriod::find()
->where([
'sys_company_id' => $sysCompanyId,
Function save
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
$dimAmt = 0;
$dimGroup = false;
- 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 accPeriodBalanceGroupedByCode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function accPeriodBalanceGroupedByCode($accountId, AcPeriod $period)
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
SELECT
Method accPeriodBalance
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function accPeriodBalance(AcRecAcc $acc, AcPeriod $period,
$addPrevBalance = true)
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
Method registre2
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
AcRecAcc $debitAcc,
AcRecAcc $creditAcc,
float $amt,
string $date,
AcPeriod $period,
Function deleteAcc
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function deleteAcc($acc)
{
if (!$acc) {
return;
}
- 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
Function getValidatedAcc
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function getValidatedAcc($accId, $ref = false)
{
if(!$model = self::findOne($accId)){
throw new Exception('Undefined accId: ' . $accId);
- 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
Function registre2
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function registre2(
AcRecAcc $debitAcc,
AcRecAcc $creditAcc,
float $amt,
string $date,
- 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
Function close
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function close(int $periodType, int $sysCompanyId): AcPeriod
{
if (!$lastPeriod = AcPeriod::find()
->where([
- 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
Function periodBalanceTotal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function periodBalanceTotal(AcPeriod $period): array
{
$connection = Yii::$app->getDb();
$command = $connection->createCommand('
- 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
Function filter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function filter()
{
$query = self::find()
->select([
- 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"