Application/Api/Document/Custom/Zwickau/Repository/SchoolContract.php
Method buildDocument
has 250 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function buildDocument($pageList = array())
{
return (new Frame())->addDocument((new Document())
->addPage((new Page())
->addSlice((new Slice())
File SchoolContract.php
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace SPHERE\Application\Api\Document\Custom\Zwickau\Repository;
use SPHERE\Application\Api\Document\AbstractDocument;
use SPHERE\Application\Document\Generator\Repository\Document;
Function setFieldValue
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
private function setFieldValue($DataPost)
{
//getPerson
$this->FieldValue['PersonId'] = $PersonId = (isset($DataPost['PersonId']) && $DataPost['PersonId'] != '' ? $DataPost['PersonId'] : 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 setFieldValue
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function setFieldValue($DataPost)
{
//getPerson
$this->FieldValue['PersonId'] = $PersonId = (isset($DataPost['PersonId']) && $DataPost['PersonId'] != '' ? $DataPost['PersonId'] : false);
Avoid deeply nested control flow statements. Open
Open
if (($tblCommonGender = $tblCommonBirthDates->getTblCommonGender())) {
$this->FieldValue['Gender'] = $tblCommonGender->getName();
}