Showing 5,014 of 7,620 total issues
Avoid deeply nested control flow statements. Open
Open
if ($tblTest->isContinues() && $tblGrade->getDate()) {
if (strlen($tblGrade->getDate()) > 6) {
$displayGradeDate = substr($tblGrade->getDate(), 0, 6);
}
} elseif ($tblTest->isContinues() && $tblTest->getFinishDate()) {
Avoid deeply nested control flow statements. Open
Open
if ($tblScoreRuleDivisionSubject) {
if ($tblScoreRuleDivisionSubject->getTblScoreRule()
&& $tblScoreRuleDivisionSubject->getTblScoreRule()->getId() == $tblScoreRule->getId()
) {
$Global->POST['Data'][$tblDivision->getId()][$subject->getId()] = 1;
Avoid deeply nested control flow statements. Open
Open
if ($tblScoreRuleDivisionSubject->getTblScoreRule()
&& $tblScoreRuleDivisionSubject->getTblScoreRule()->getId() != $tblScoreRule->getId()
) {
$isDisabled = true;
$name .= ' ' . new Label($tblScoreRuleDivisionSubject->getTblScoreRule()->getName(),
Avoid deeply nested control flow statements. Open
Open
if (($tblGradeType = $tblScoreConditionGradeTypeList->getTblGradeType())) {
/** @var TblGrade $tblGrade */
foreach ($tblGradeList as $tblGrade) {
if (is_numeric($tblGrade->getGrade())
&& $tblGrade->getTblGradeType()
Avoid deeply nested control flow statements. Open
Open
if ($posStart !== false) {
$posEnd = strpos($average, ')');
if ($posEnd !== false) {
$priority = substr($average, $posStart + 1, $posEnd - ($posStart + 1));
}
Avoid deeply nested control flow statements. Open
Open
if (is_array($average)) {
$average = 'Fehler';
} elseif (is_string($average) && strpos($average, '(')) {
$average = substr($average, 0, strpos($average, '('));
}
Method getSubject
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblCertificate $tblCertificate,
$tblSubjectAll,
$LaneIndex,
$LaneRanking,
$LaneTitle = '',
Avoid deeply nested control flow statements. Open
Open
if ($posEnd !== false) {
$priority = substr($average, $posStart + 1, $posEnd - ($posStart + 1));
}
Avoid deeply nested control flow statements. Open
Open
if ($Relationship->getServiceTblPersonFrom() == $tblPersonSession->getId()) {
$ParentList[] = $Relationship->getServiceTblPersonTo();
} elseif ($Relationship->getServiceTblPersonTo() == $tblPersonSession->getId()) {
$ParentList[] = $Relationship->getServiceTblPersonFrom();
}
Function frontendApproval
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function frontendApproval($Data = null)
{
$Stage = new Stage('Einsellungen', 'Automatische Freigabe');
$Stage = self::setSettingMenue($Stage, 'Approval');
- 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
Avoid deeply nested control flow statements. Open
Open
if ($hasMirror) {
$value = intval(round($value, 0));
$gradeMirror[$value]++;
}
Avoid deeply nested control flow statements. Open
Open
if (isset($itemValue['Value']) && isset($itemValue['Multiplier'])) {
$totalMultiplier += $multiplier;
$average += $multiplier * ($itemValue['Value'] / $itemValue['Multiplier']);
}
Avoid deeply nested control flow statements. Open
Open
if ($tblCommon && ($tblCommonBirthDates = $tblCommon->getTblCommonBirthDates())) {
$Now = new \DateTime();
$Now->modify('-18 year');
Method updateScoreGroup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblScoreGroup $tblScoreGroup,
$Name,
$Round,
$Multiplier,
$IsEveryGradeASingleGroup,
Avoid deeply nested control flow statements. Open
Open
if (($tblTask = $tblTest->getTblTask()) && !$tblTask->isLocked()) {
Evaluation::useService()->setTaskLocked($tblTask);
}
Avoid deeply nested control flow statements. Open
Open
if ($average != '') {
if (isset($averages[$column])) {
$averages[$column]['Count']++;
$averages[$column]['Sum'] += $average;
} else {
Avoid deeply nested control flow statements. Open
Open
if (!$tblDivisionSubject->getTblSubjectGroup()) {
$hasStudentSubject = false;
$tblDivisionSubjectWhereGroup =
Division::useService()->getDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject(
$tblDivision,
Avoid deeply nested control flow statements. Open
Open
if(!in_array($tblSchoolType->getId(), $tblSchoolTypeList)){
// Klassen werden nicht angezeigt, wenn die Schulart nicht freigeben ist.
continue;
}
Avoid deeply nested control flow statements. Open
Open
if ($tblScoreRuleDivisionSubject->getTblScoreType()
&& $tblScoreRuleDivisionSubject->getTblScoreType()->getId() == $tblScoreType->getId()
) {
$Global->POST['Data'][$tblDivision->getId()][$subject->getId()] = 1;
}
Avoid deeply nested control flow statements. Open
Open
if ($tblGrade->getServiceTblPerson()
&& ($tblPrepareStudent = Prepare::useService()->getPrepareStudentBy($tblPrepare,
$tblGrade->getServiceTblPerson()))
&& ($tblCertificate = $tblPrepareStudent->getServiceTblCertificate())
&& !$tblCertificate->isInformation()