Function setStudentCardContent
has a Cognitive Complexity of 228 (exceeds 5 allowed). Consider refactoring. Open
public function setStudentCardContent(
$Data,
TblPerson $tblPerson,
AbstractDocument $documentClass,
TblType $tblType = null
- 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 setStudentCardContent
has 289 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setStudentCardContent(
$Data,
TblPerson $tblPerson,
AbstractDocument $documentClass,
TblType $tblType = null
File Service.php
has 591 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: Kauschke
* Date: 08.03.2017
Function getCourses
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
private function getCourses(TblPerson $tblPerson, TblDivision $tblDivision, $advancedCourses, $basicCourses)
{
if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectByDivision($tblDivision))) {
foreach ($tblDivisionSubjectList as $tblDivisionSubjectItem) {
- 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 getStudentCardSubjectListByPerson
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function getStudentCardSubjectListByPerson(TblPerson $tblPerson, AbstractDocument $documentClass)
{
$resultList = array();
$list = array();
- 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 getPrepareStudentListForStudentCard
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getPrepareStudentListForStudentCard(TblPerson $tblPerson, TblType $tblType = null)
{
$list = array();
if (($tblDivisionStudentList = Division::useService()->getDivisionStudentAllByPerson($tblPerson))) {
- 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 getStudentCardSubjectListForSekIIByPerson
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getStudentCardSubjectListForSekIIByPerson(TblPerson $tblPerson)
{
$resultList = array();
$list = array();
- 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 createDocumentSubjects
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function createDocumentSubjects(
IFormInterface $Form,
TblDocument $tblDocument,
$Data
) {
- 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 getStudentCardSubjectListForSekIIByPerson
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStudentCardSubjectListForSekIIByPerson(TblPerson $tblPerson)
{
$resultList = array();
$list = array();
Method getStudentCardSubjectListByPerson
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStudentCardSubjectListByPerson(TblPerson $tblPerson, AbstractDocument $documentClass)
{
$resultList = array();
$list = array();
Consider simplifying this complex logical expression. Open
if ($tblPrepare->getServiceTblGenerateCertificate()
&& ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
&& ($tblCertificateType->getIdentifier() == 'HALF_YEAR'
|| $tblCertificateType->getIdentifier() == 'YEAR'
|| $tblCertificateType->getIdentifier() == 'MID_TERM_COURSE'
Consider simplifying this complex logical expression. Open
if ($tblPrepare->getServiceTblGenerateCertificate()
&& ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
&& ($tblCertificateType->getIdentifier() == 'HALF_YEAR'
|| $tblCertificateType->getIdentifier() == 'YEAR'
|| $tblCertificateType->getIdentifier() == 'MID_TERM_COURSE'
Method getPrepareStudentListForStudentCard
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPrepareStudentListForStudentCard(TblPerson $tblPerson, TblType $tblType = null)
{
$list = array();
if (($tblDivisionStudentList = Division::useService()->getDivisionStudentAllByPerson($tblPerson))) {
Method createDocumentSubjects
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createDocumentSubjects(
IFormInterface $Form,
TblDocument $tblDocument,
$Data
) {
Method getCourses
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCourses(TblPerson $tblPerson, TblDivision $tblDivision, $advancedCourses, $basicCourses)
{
if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectByDivision($tblDivision))) {
foreach ($tblDivisionSubjectList as $tblDivisionSubjectItem) {
Consider simplifying this complex logical expression. Open
if ($tblPrepare->getServiceTblGenerateCertificate()
&& ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
&& ($tblCertificateType->getIdentifier() == 'HALF_YEAR' || $tblCertificateType->getIdentifier() == 'YEAR')
&& ($tblPrepareStudent = Prepare::useService()->getPrepareStudentBy($tblPrepare,
$tblPerson))
Consider simplifying this complex logical expression. Open
if (($tblPrepare = $item->getTblPrepareCertificate())
&& ($tblDivision = $tblPrepare->getServiceTblDivision())
&& ($tblLevel = $tblDivision->getTblLevel())
&& ($tblPrepare->getServiceTblGenerateCertificate())
&& ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
Consider simplifying this complex logical expression. Open
if (($tblPrepare = $item->getTblPrepareCertificate())
&& ($tblDivision = $tblPrepare->getServiceTblDivision())
&& ($tblLevel = $tblDivision->getTblLevel())
&& ($tblPrepare->getServiceTblGenerateCertificate())
&& ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
Consider simplifying this complex logical expression. Open
if (($tblAppointedDateTask = $tblPrepare->getServiceTblAppointedDateTask())
&& $tblYear
&& ($tblPeriodList = $tblYear->getTblPeriodAll($tblLevel && $tblLevel->getName() == '12'))
&& ($tblPeriod = $tblAppointedDateTask->getServiceTblPeriodByDivision($tblDivision))
&& ($tblFirstPeriod = current($tblPeriodList))
Avoid deeply nested control flow statements. Open
if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectAllByPersonAndYear($tblPerson, $tblYear))) {
foreach ($tblDivisionSubjectList as $tblDivisionSubject) {
if (($tblSubjectTemp = $tblDivisionSubject->getServiceTblSubject())
&& Subject::useService()->isOrientation($tblSubjectTemp)
) {
Avoid deeply nested control flow statements. Open
if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectAllByPersonAndYear($tblPerson, $tblYear))) {
foreach ($tblDivisionSubjectList as $tblDivisionSubject) {
if (($tblSubjectTemp = $tblDivisionSubject->getServiceTblSubject())
&& Subject::useService()->isProfile($tblSubjectTemp)
) {
Avoid deeply nested control flow statements. Open
if ($value == 'nicht erteilt') {
$value = 'ne';
} elseif ($value == 'teilgenommen') {
$value = 't';
} elseif ($value == 'Keine Benotung') {
Consider simplifying this complex logical expression. Open
if ($tblPrepare->getServiceTblGenerateCertificate()
&& ($tblCertificateType = $tblPrepare->getServiceTblGenerateCertificate()->getServiceTblCertificateType())
&& ($tblCertificateType->getIdentifier() == 'MID_TERM_COURSE')
&& ($tblPrepareStudent = Prepare::useService()->getPrepareStudentBy($tblPrepare,
$tblPerson))
Function getSchoolTypeListForStudentCard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getSchoolTypeListForStudentCard(TblPerson $tblPerson)
{
$list = array();
if (($tblDivisionStudentList = Division::useService()->getDivisionStudentAllByPerson($tblPerson))) {
- 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"