Showing 5,014 of 7,620 total issues
Avoid deeply nested control flow statements. Open
Open
if ($tblSubjectStudentAllByDivisionSubject) {
foreach ($tblSubjectStudentAllByDivisionSubject as $tblSubjectStudent) {
$tblPerson = $tblSubjectStudent->getServiceTblPerson();
if ($tblPerson) {
Method getGradesFromAnotherDivisionByStudent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblDivision $tblDivision,
TblSubject $tblSubject,
TblYear $tblYear,
TblPerson $tblPerson,
TblTestType $tblTestType,
Function getDisplayGrade
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getDisplayGrade($WithTrend = true)
{
$gradeValue = $this->getGrade();
if ($gradeValue !== null && $gradeValue !== '') {
- 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 getGradesByStudent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblPerson $tblPerson,
TblDivision $tblDivision,
TblSubject $tblSubject,
TblTestType $tblTestType,
TblPeriod $tblPeriod = null,
Avoid deeply nested control flow statements. Open
Open
if ($this->checkIsPersonInActive($tblDivision, $tblPerson, $taskDate)) {
continue;
}
Avoid deeply nested control flow statements. Open
Open
if ($taskDate->format('Y-m-d') >= $testDate->format('Y-m-d')) {
$count++;
$date = $tblTestTemp->getDate();
if (strlen($date) > 6) {
$date = substr($date, 0, 6);
Avoid deeply nested control flow statements. Open
Open
if ($Data == null) {
$Global = $this->getGlobal();
/** @var TblSubject $subject */
foreach ($subjectList as $subject) {
$tblScoreRuleSubjectGroup = Gradebook::useService()->getScoreRuleSubjectGroupByDivisionAndSubjectAndGroup(
Avoid deeply nested control flow statements. Open
Open
if ($tblTest->getDate()
&& ($testDate = (new \DateTime($tblTest->getDate())))
&& ($toDateTimeTask = new \DateTime($appointedDateTask->getToDate()))
&& ($nowDateTime = (new \DateTime('now')))
&& $testDate <= $toDateTimeTask
Avoid deeply nested control flow statements. Open
Open
if (($tblGrade = $this->getGradeById($gradeId))) {
$tblGradeList[] = $tblGrade;
}
Avoid deeply nested control flow statements. Open
Open
if (($tblScoreGroup = $tblScoreConditionGroupRequirement->getTblScoreGroup())
&& ($tblGradeTypeList = Gradebook::useService()->getScoreGroupGradeTypeListByGroup($tblScoreGroup))
) {
$gradeTypeList = array();
foreach ($tblGradeTypeList as $tblGradeTypeItem) {
Avoid deeply nested control flow statements. Open
Open
if ($tblPeriodList) {
$tableHeaderList['Subject'] = 'Fach';
foreach ($tblPeriodList as $tblPeriod) {
$tableHeaderList['Period' . $tblPeriod->getId()] = new Bold($tblPeriod->getDisplayName());
}
Function updateScoreGroup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function updateScoreGroup(IFormInterface $Stage = null, $Id, $ScoreGroup)
{
/**
* Skip to Frontend
- 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 ($tblGrade->getGrade() !== null && $tblGrade->getGrade() !== '' && is_numeric($tblGrade->getGrade())) {
// für Teilnoten Extra-Liste
if (($tblGradeType = $tblGrade->getTblGradeType())
&& $tblGradeType->isPartGrade()
) {
Avoid deeply nested control flow statements. Open
Open
if (count($columnList[$schoolTypeId]) == 4) {
$rowList[$schoolTypeId][] = new FormRow($columnList[$schoolTypeId]);
$columnList[$schoolTypeId] = array();
}
Avoid deeply nested control flow statements. Open
Open
if (($tblPeriodList = Term::useService()->getPeriodAllByYear($tblYear, $isLevel12))) {
$firstPeriod = reset($tblPeriodList);
if ($period == TblScoreCondition::PERIOD_FIRST_PERIOD) {
if ($tblPeriod && $firstPeriod->getId() == $tblPeriod->getId()) {
Avoid deeply nested control flow statements. Open
Open
if (isset($group['Value']) && isset($group['Multiplier'])) {
$totalMultiplier += $multiplier;
$average += $multiplier * ($group['Value'] / $group['Multiplier']);
}
Method addTest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function addTest(TblTest $tblTest,TblGrade $tblGrade = null, &$subTableHeaderList, &$subTableDataList, $hasScore, $showDivisionInToolTip)
Method setStudentOverviewStage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$DivisionId,
$GroupId,
$PersonId,
Stage $Stage,
$Route,
Avoid deeply nested control flow statements. Open
Open
if (($tblPersonItem = $tblGradeItem->getServiceTblPerson())
&& !isset($studentArray[$tblPersonItem->getId()])
) {
$addStudentList[$tblPersonItem->getId()] = $tblPersonItem;
}
Method updateScoreCondition
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
TblScoreCondition $tblScoreCondition,
$Name,
$Round,
$Priority,
$IsActive,