File Frontend.php
has 3951 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Education\Graduation\Evaluation;
use DateTime;
use SPHERE\Application\Api\Education\Graduation\Evaluation\ApiEvaluation;
Function contentEditTestGrade
has a Cognitive Complexity of 369 (exceeds 5 allowed). Consider refactoring. Open
private function contentEditTestGrade(Stage $Stage, TblTest $tblTest, $Grade, $BasicRoute, $IsEdit = false)
{
if (!$tblTest->getServiceTblDivision()) {
return new Danger(new Ban() . ' Klasse nicht gefunden')
- 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 setGradeOverviewForTask
has a Cognitive Complexity of 350 (exceeds 5 allowed). Consider refactoring. Open
private function setGradeOverviewForTask(
TblTask $tblTask,
$divisionList,
$tableHeaderList,
$studentList,
- 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 contentTestSelected
has a Cognitive Complexity of 169 (exceeds 5 allowed). Consider refactoring. Open
private function contentTestSelected($DivisionSubjectId, $Test, Stage $Stage, $BasicRoute)
{
$Stage->addButton(new Standard('Zurück', $BasicRoute, new ChevronLeft()));
- 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 contentEditTestGrade
has 615 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function contentEditTestGrade(Stage $Stage, TblTest $tblTest, $Grade, $BasicRoute, $IsEdit = false)
{
if (!$tblTest->getServiceTblDivision()) {
return new Danger(new Ban() . ' Klasse nicht gefunden')
Function frontendEditProposalTestGrade
has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring. Open
public function frontendEditProposalTestGrade($DivisionId = null, $TaskId = null, $GradeTypeId = null, $Grade = null)
{
$stage = new Stage('Kopfnotenvorschlag des Klassenlehrers', 'Zensuren eintragen');
if (!($tblDivision = Division::useService()->getDivisionById($DivisionId))) {
- 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 frontendTestTeacher
has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring. Open
public function frontendTestTeacher($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Leistungsüberprüfung', 'Auswahl');
$Stage->setMessage(
- 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 frontendHeadmasterTaskDivision
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
public function frontendHeadmasterTaskDivision($Id = null, $Data = null)
{
$Stage = new Stage('Notenauftrag', 'Klassen zuordnen');
$Stage->setMessage(new Bold(new Exclamation() . ' Hinweis: ') . 'Bei der Auswahl vieler Klassen kann das Speichern einige Zeit dauern.');
- 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 contentTestSelected
has 370 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function contentTestSelected($DivisionSubjectId, $Test, Stage $Stage, $BasicRoute)
{
$Stage->addButton(new Standard('Zurück', $BasicRoute, new ChevronLeft()));
Method frontendEditProposalTestGrade
has 301 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendEditProposalTestGrade($DivisionId = null, $TaskId = null, $GradeTypeId = null, $Grade = null)
{
$stage = new Stage('Kopfnotenvorschlag des Klassenlehrers', 'Zensuren eintragen');
if (!($tblDivision = Division::useService()->getDivisionById($DivisionId))) {
Function frontendHeadmasterTest
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
public function frontendHeadmasterTest($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Leistungsüberprüfung', 'Auswahl');
$Stage->setMessage(
- 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 countGradesAndStudentsByTest
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
private function countGradesAndStudentsByTest(TblTest $tblTest, &$countGrades, &$countStudents)
{
$tblDivision = $tblTest->getServiceTblDivision();
$tblSubject = $tblTest->getServiceTblSubject();
$tblSubjectGroup = $tblTest->getServiceTblSubjectGroup();
- 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 setGradeOverviewForTask
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setGradeOverviewForTask(
TblTask $tblTask,
$divisionList,
$tableHeaderList,
$studentList,
Function setContentForBehaviorTask
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
private function setContentForBehaviorTask(
TblTest $tblTest,
TblTask $tblTask = null,
TblDivision $tblDivision,
TblSubject $tblSubject,
- 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 frontendTestTeacher
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendTestTeacher($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Leistungsüberprüfung', 'Auswahl');
$Stage->setMessage(
Function setGradeMirror
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
private function setGradeMirror(TblScoreType $tblScoreType = null, $gradeList, $Grade)
{
$minRange = null;
$maxRange = null;
if ($tblScoreType) {
- 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 frontendHeadmasterTaskDivision
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterTaskDivision($Id = null, $Data = null)
{
$Stage = new Stage('Notenauftrag', 'Klassen zuordnen');
$Stage->setMessage(new Bold(new Exclamation() . ' Hinweis: ') . 'Bei der Auswahl vieler Klassen kann das Speichern einige Zeit dauern.');
Function frontendDivisionTeacherTaskGrades
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
public function frontendDivisionTeacherTaskGrades($Id = null, $DivisionId = null)
{
$Stage = new Stage('Notenauftrag', 'Zensurenübersicht');
- 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 frontendDivisionTeacherTask
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public function frontendDivisionTeacherTask($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenaufträge', 'Übersicht');
$Stage->setMessage(
- 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 contentEditTest
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function contentEditTest(Stage $Stage, $Id, $Test, $BasicRoute)
{
$tblTest = Evaluation::useService()->getTestById($Id);
if ($tblTest) {
Method frontendHeadmasterTest
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterTest($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Leistungsüberprüfung', 'Auswahl');
$Stage->setMessage(
Frontend
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class Frontend extends Extension implements IFrontendInterface
{
/**
* @return Stage
Function setStudentList
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private function setStudentList(
TblDivisionSubject $tblDivisionSubject,
TblTest $tblTest,
$studentList,
&$studentTestList,
- 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 contentEditTest
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private function contentEditTest(Stage $Stage, $Id, $Test, $BasicRoute)
{
$tblTest = Evaluation::useService()->getTestById($Id);
if ($tblTest) {
- 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 frontendDivisionTeacherTaskGrades
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendDivisionTeacherTaskGrades($Id = null, $DivisionId = null)
{
$Stage = new Stage('Notenauftrag', 'Zensurenübersicht');
Method frontendDivisionTeacherTask
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendDivisionTeacherTask($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenaufträge', 'Übersicht');
$Stage->setMessage(
Method frontendHeadmasterTask
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterTask($Task = null, $IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenaufträge', 'Übersicht');
$Stage->setMessage(
Function setTableContentForAppointedDateTask
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function setTableContentForAppointedDateTask(
TblDivision $tblDivision,
TblTest $tblTest,
TblSubject $tblSubject,
TblPerson $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 frontendProposalTestSelected
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function frontendProposalTestSelected($DivisionId = null)
{
$stage = new Stage('Kopfnotenvorschlag des Klassenlehrers', 'Übersicht');
if (($tblDivision = Division::useService()->getDivisionById($DivisionId))) {
- 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 frontendHeadmasterTaskGrades
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterTaskGrades($Id = null, $DivisionId = null)
{
$Stage = new Stage('Notenauftrag', 'Zensurenübersicht');
$tblTask = false;
Function contentDestroyTest
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function contentDestroyTest(Stage $Stage, $Id, $Confirm, $BasicRoute)
{
$tblTest = Evaluation::useService()->getTestById($Id);
if ($tblTest) {
- 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 setContentForBehaviorTask
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setContentForBehaviorTask(
TblTest $tblTest,
TblTask $tblTask = null,
TblDivision $tblDivision,
TblSubject $tblSubject,
Function frontendHeadmasterTaskGrades
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function frontendHeadmasterTaskGrades($Id = null, $DivisionId = null)
{
$Stage = new Stage('Notenauftrag', 'Zensurenübersicht');
$tblTask = 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
Consider simplifying this complex logical expression. Open
if (!$tblTestTemp->isContinues() // Testdatum
|| ($tblTestTemp->isContinues() // Notendatum
&& $tblGrade->getDate() && $tblTask->getDate()
&& ($taskDate = new \DateTime($tblTask->getDate()))
&& ($gradeDate = new \DateTime($tblGrade->getDate()))
Method contentDestroyTest
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function contentDestroyTest(Stage $Stage, $Id, $Confirm, $BasicRoute)
{
$tblTest = Evaluation::useService()->getTestById($Id);
if ($tblTest) {
Function setTableContentForBehaviourTask
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function setTableContentForBehaviourTask(
TblDivision $tblDivision,
TblTest $tblTest,
TblPerson $tblPerson,
$studentList,
- 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 formTest
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formTest(
TblDivision $tblDivision,
TblYear $tblYear,
TblScoreRule $tblScoreRule = null,
TblDivisionSubject $tblDivisionSubjectSelected = null
Method countGradesAndStudentsByTest
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function countGradesAndStudentsByTest(TblTest $tblTest, &$countGrades, &$countStudents)
{
$tblDivision = $tblTest->getServiceTblDivision();
$tblSubject = $tblTest->getServiceTblSubject();
$tblSubjectGroup = $tblTest->getServiceTblSubjectGroup();
Method setHighlightedTestsOverview
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setHighlightedTestsOverview($Data, $IsDivisionTeacher, $PersonId = null)
{
$stage = new Stage('Leistungsüberprüfung', 'Planungsübersicht');
$stage->addButton(new Standard(
'Zurück',
Method setStudentList
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setStudentList(
TblDivisionSubject $tblDivisionSubject,
TblTest $tblTest,
$studentList,
&$studentTestList,
Method frontendProposalTestSelected
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendProposalTestSelected($DivisionId = null)
{
$stage = new Stage('Kopfnotenvorschlag des Klassenlehrers', 'Übersicht');
if (($tblDivision = Division::useService()->getDivisionById($DivisionId))) {
Function contentEditTestGradeTableRow
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function contentEditTestGradeTableRow(
TblPerson $tblPerson,
$tblGrade,
$IsEdit,
$student,
- 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 setTableContentForAppointedDateTask
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setTableContentForAppointedDateTask(
TblDivision $tblDivision,
TblTest $tblTest,
TblSubject $tblSubject,
TblPerson $tblPerson,
Method setGradeMirror
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setGradeMirror(TblScoreType $tblScoreType = null, $gradeList, $Grade)
{
$minRange = null;
$maxRange = null;
if ($tblScoreType) {
Method frontendHeadmasterTaskEdit
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterTaskEdit($Id = null, $Task = null)
{
$Stage = new Stage('Notenauftrag', 'Bearbeiten');
Function setYearButtonList
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function setYearButtonList($Route, $IsAllYears, $YearId, &$tblYear, $HasAllYears = true)
{
$tblYear = false;
$tblYearList = Term::useService()->getYearByNow();
- 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 frontendHeadmasterTaskDestroy
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterTaskDestroy(
$Id = null,
$Confirm = false
) {
Method contentEditTestGradeTableRow
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function contentEditTestGradeTableRow(
TblPerson $tblPerson,
$tblGrade,
$IsEdit,
$student,
Function formTest
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function formTest(
TblDivision $tblDivision,
TblYear $tblYear,
TblScoreRule $tblScoreRule = null,
TblDivisionSubject $tblDivisionSubjectSelected = 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 formTask
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formTask()
{
$tblTestTypeAllWhereTask = Evaluation::useService()->getTestTypeAllWhereTask();
Method setTableContentForBehaviourTask
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setTableContentForBehaviourTask(
TblDivision $tblDivision,
TblTest $tblTest,
TblPerson $tblPerson,
$studentList,
Consider simplifying this complex logical expression. Open
if ($tblSubject && $tblTestItem->getServiceTblSubject()
&& $tblSubject->getId() == $tblTestItem->getServiceTblSubject()->getId()
&& (!$tblTest->getServiceTblSubjectGroup()
|| ($tblTest->getServiceTblSubjectGroup() && $tblTestItem->getServiceTblSubjectGroup()
&& $tblTest->getServiceTblSubjectGroup()->getId() == $tblTestItem->getServiceTblSubjectGroup()->getId())
Function frontendHeadmasterTask
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function frontendHeadmasterTask($Task = null, $IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenaufträge', 'Übersicht');
$Stage->setMessage(
- 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 setYearButtonList
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setYearButtonList($Route, $IsAllYears, $YearId, &$tblYear, $HasAllYears = true)
{
$tblYear = false;
$tblYearList = Term::useService()->getYearByNow();
Method setContentForBehaviorTask
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
TblTest $tblTest,
TblTask $tblTask = null,
TblDivision $tblDivision,
TblSubject $tblSubject,
TblTest &$tblNextTest = null,
Method contentEditTestGradeTableRow
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
TblPerson $tblPerson,
$tblGrade,
$IsEdit,
$student,
&$tabIndex,
Method setTableContentForAppointedDateTask
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
TblDivision $tblDivision,
TblTest $tblTest,
TblSubject $tblSubject,
TblPerson $tblPerson,
$studentList,
Avoid deeply nested control flow statements. Open
if ($tblYear
&& $tblYearItem->getId() != $tblYear->getId()
) {
continue;
}
Avoid deeply nested control flow statements. Open
if (isset($grades[$personId][$gradeTypeId]) && $grades[$personId][$gradeTypeId]['Count'] > 0) {
$studentList[$tblDivision->getId()][$personId]['Type' . $gradeTypeId] =
new Bold('Ø ' .
round(floatval($grades[$personId][$gradeTypeId]['Sum']) / floatval($grades[$personId][$gradeTypeId]['Count']),
2) . ' | ') . $studentListByDivision['Type' . $gradeTypeId];
Avoid deeply nested control flow statements. Open
if ($showProposalBehaviorGrade) {
$proposalGrade = new Warning(new Bold('f'));
if (($tblProposalBehaviorGrade = Gradebook::useService()->getProposalBehaviorGrade(
$tblDivision, $tblTask, $tblGradeType, $tblPerson
)) && $tblProposalBehaviorGrade->getDisplayGrade() !== ''
Avoid deeply nested control flow statements. Open
if ($tblDivisionStudentAll) {
foreach ($tblDivisionStudentAll as $tblPerson) {
if ($this->checkIsPersonInActive($tblDivision, $tblPerson, $taskDate)) {
continue;
}
Avoid deeply nested control flow statements. Open
if ($tblGrade) {
if (!$tblTestTemp->isContinues() // Testdatum
|| ($tblTestTemp->isContinues() // Notendatum
&& $tblGrade->getDate() && $tblTask->getDate()
&& ($taskDate = new \DateTime($tblTask->getDate()))
Avoid deeply nested control flow statements. Open
if ($posStart !== false) {
$average = substr($average, 0, $posStart);
}
Avoid deeply nested control flow statements. Open
if ($tblPerson) {
if ($this->checkIsPersonInActive($tblDivision, $tblPerson, $taskDate)) {
continue;
}
Avoid deeply nested control flow statements. Open
if ($tblSubjectStudentAllByDivisionSubject) {
foreach ($tblSubjectStudentAllByDivisionSubject as $tblSubjectStudent) {
$tblPerson = $tblSubjectStudent->getServiceTblPerson();
if ($tblPerson) {
Avoid deeply nested control flow statements. Open
if ($this->checkIsPersonInActive($tblDivision, $tblPerson, $taskDate)) {
continue;
}
Avoid deeply nested control flow statements. 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
if ($tblTest->getDate()
&& ($testDate = (new \DateTime($tblTest->getDate())))
&& ($toDateTimeTask = new \DateTime($appointedDateTask->getToDate()))
&& ($nowDateTime = (new \DateTime('now')))
&& $testDate <= $toDateTimeTask
Consider simplifying this complex logical expression. Open
if ($tblDivisionSubject && $tblDivisionSubject->getServiceTblSubject()
&& $tblDivisionSubject->getTblDivision()
&& ($tblDivisionSubject->getHasGrading() || (($tblSetting = Consumer::useService()->getSetting(
'Education', 'Graduation', 'Evaluation', 'HasBehaviorGradesForSubjectsWithNoGrading'
))
Consider simplifying this complex logical expression. Open
if ($tblTest->getDate()
&& ($testDate = (new \DateTime($tblTest->getDate())))
&& ($toDateTimeTask = new \DateTime($appointedDateTask->getToDate()))
&& ($nowDateTime = (new \DateTime('now')))
&& $testDate <= $toDateTimeTask
Consider simplifying this complex logical expression. Open
if (($date = $tblTaskItem->getDate())
&& ($tblPeriod = $tblTest->getServiceTblPeriod())
&& ($toDatePeriod = $tblPeriod->getToDate())
&& ($dateTimeTask = new \DateTime($date))
&& ($toDateTimePeriod = new \DateTime($toDatePeriod))
Method contentEditTestGrade
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function contentEditTestGrade(Stage $Stage, TblTest $tblTest, $Grade, $BasicRoute, $IsEdit = false)
Method setStudentList
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblDivisionSubject $tblDivisionSubject,
TblTest $tblTest,
$studentList,
&$studentTestList,
$isDivisionSubjectNamed = false
Method setYearButtonList
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setYearButtonList($Route, $IsAllYears, $YearId, &$tblYear, $HasAllYears = true)
Method setTableContentForBehaviourTask
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblDivision $tblDivision,
TblTest $tblTest,
TblPerson $tblPerson,
$studentList,
$grades
Method setGradeOverviewForTask
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblTask $tblTask,
$divisionList,
$tableHeaderList,
$studentList,
$tableList
Function frontendHeadmasterTaskDestroy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function frontendHeadmasterTaskDestroy(
$Id = null,
$Confirm = 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($divisionSubjectList)) {
foreach ($divisionSubjectList as $divisionId => $subjectList) {
$tblDivision = Division::useService()->getDivisionById($divisionId);
if ($tblDivision) {
foreach ($subjectList as $subjectId => $value) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 298.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!empty($divisionSubjectList)) {
foreach ($divisionSubjectList as $divisionId => $subjectList) {
$tblDivision = Division::useService()->getDivisionById($divisionId);
if ($tblDivision) {
foreach ($subjectList as $subjectId => $value) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 298.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($tblScoreType) {
if ($tblScoreType->getIdentifier() == 'VERBAL') {
$student[$tblPerson->getId()]['Grade']
= (new TextField('Grade[' . $tblPerson->getId() . '][Grade]', '', '',
new Quote()))->setTabIndex($tabIndex++);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 269.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($tblScoreType) {
if ($tblScoreType->getIdentifier() == 'VERBAL') {
$studentList[$tblPerson->getId()]['Grade']
= (new TextField('Grade[' . $tblPerson->getId() . '][Grade]', '', '',
new Quote()))->setTabIndex($tabIndex++);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 269.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($tblScoreType) {
$selectList[-1] = '';
if ($tblScoreType->getIdentifier() == 'GRADES') {
for ($i = 1; $i < 6; $i++) {
$selectList[$i . '+'] = (string)($i . '+');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 247.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($tblScoreType) {
$selectList[-1] = '';
if ($tblScoreType->getIdentifier() == 'GRADES') {
for ($i = 1; $i < 6; $i++) {
$selectList[$i . '+'] = (string)($i . '+');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 247.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
if ($tblDivisionSubject && $tblDivisionSubject->getServiceTblSubject()
&& $tblDivisionSubject->getTblDivision()
&& ($tblDivisionSubject->getHasGrading() || (($tblSetting = Consumer::useService()->getSetting(
'Education', 'Graduation', 'Evaluation', 'HasBehaviorGradesForSubjectsWithNoGrading'
))
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 162.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function frontendHeadmasterTestSelected(
$DivisionSubjectId = null,
$Test = null
) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 161.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function frontendTestSelected(
$DivisionSubjectId = null,
$Test = null
) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 161.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
} elseif (strpos($column, 'ExtraGrades') !== false) {
$periodId = str_replace('ExtraGrades', '', $column);
if ($gradeListFromAnotherDivision && isset($gradeListFromAnotherDivision[$periodId][$tblPerson->getId()])) {
$data[$column] = implode(', ', $gradeListFromAnotherDivision[$periodId][$tblPerson->getId()])
. ' '
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 159.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (count($tblDivisionAllByTask) > 1) {
/** @var TblDivision $tblDivision */
foreach ($tblDivisionAllByTask as $tblDivision) {
if ($tblCurrentDivision && $tblCurrentDivision->getId() == $tblDivision->getId()) {
$buttonList[] = new Standard(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 157.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (count($tblDivisionAllByTask) > 1) {
/** @var TblDivision $tblDivision */
foreach ($tblDivisionAllByTask as $tblDivision) {
if ($tblCurrentDivision && $tblCurrentDivision->getId() == $tblDivision->getId()) {
$buttonList[] = new Standard(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 157.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
$tableData = new TableData($studentList, null, $tableColumns, array(
"paging" => false, // Deaktivieren Blättern
"iDisplayLength" => -1, // Alle Einträge zeigen
"searching" => false, // Deaktivieren Suchen
"info" => false, // Deaktivieren Such-Info
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 127.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
$tableData = new TableData($studentList, null, $tableColumns, array(
"paging" => false, // Deaktivieren Blättern
"iDisplayLength" => -1, // Alle Einträge zeigen
"searching" => false, // Deaktivieren Suchen
"info" => false, // Deaktivieren Such-Info
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 127.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
foreach ($tblYearList as $tblYearItem) {
if ($tblYear && $tblYear->getId() == $tblYearItem->getId()) {
$buttonList[] = (new Standard(new Info(new Bold($tblYearItem->getDisplayName())),
$Route, new Edit(), array('YearId' => $tblYearItem->getId())));
} else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 123.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($tblSubjectTeacher->getTblDivisionSubject()->getServiceTblSubject()
&& $tblDivisionSubject->getServiceTblSubject()
) {
$tblDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject
= Division::useService()->getDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 120.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function frontendDestroyTest(
$Id = null,
$Confirm = false
) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 112.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function frontendHeadmasterDestroyTest(
$Id = null,
$Confirm = false
) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 112.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
: new FormRow(array(
new FormColumn(
new DatePicker('Test[Date]', '', 'Datum', new Calendar()), 4
),
new FormColumn(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 108.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
new FormRow(array(
new FormColumn(
new DatePicker('Task[Date]', '', 'Stichtag', new Calendar()), 4
),
new FormColumn(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 108.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ($HasAllYears) {
if ($IsAllYears) {
$buttonList[] = (new Standard(new Info(new Bold('Alle Schuljahre')),
$Route, new Edit(), array('IsAllYears' => true)));
} else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 102.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76