Function setGradeOverview
has a Cognitive Complexity of 571 (exceeds 5 allowed). Consider refactoring. Open
private function setGradeOverview(
TblYear $tblYear,
TblPerson $tblPerson,
$divisionList,
&$rowList,
- 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
File Frontend.php
has 2866 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Education\Graduation\Gradebook;
use SPHERE\Application\Api\Education\Graduation\Gradebook\ApiGradebook;
Function contentSelectedGradeBook
has a Cognitive Complexity of 318 (exceeds 5 allowed). Consider refactoring. Open
private function contentSelectedGradeBook(
Stage $Stage,
TblDivisionSubject $tblDivisionSubject,
$BasicRoute
) {
- 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 frontendStudentGradebook
has a Cognitive Complexity of 207 (exceeds 5 allowed). Consider refactoring. Open
public function frontendStudentGradebook($YearId = null, $ParentAccount = null)
{
$Stage = new Stage('Notenübersicht', 'Schüler/Eltern');
$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 setSelectStudentStage
has a Cognitive Complexity of 187 (exceeds 5 allowed). Consider refactoring. Open
private function setSelectStudentStage(Stage $Stage, $DivisionId = null, $GroupId = null, $IsHeadmaster = false)
{
$tblGroup = false;
$tblGroupTudor = Group::useService()->getGroupByMetaTable(TblGroup::META_TABLE_TUDOR);
- 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 frontendScoreTypeSelect
has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring. Open
public function frontendScoreTypeSelect(
$Id = null,
$YearId = null,
$Data = 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
Function frontendTeacherGradebook
has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring. Open
public function frontendTeacherGradebook($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenbuch', '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
Method contentSelectedGradeBook
has 463 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function contentSelectedGradeBook(
Stage $Stage,
TblDivisionSubject $tblDivisionSubject,
$BasicRoute
) {
Method frontendStudentGradebook
has 290 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendStudentGradebook($YearId = null, $ParentAccount = null)
{
$Stage = new Stage('Notenübersicht', 'Schüler/Eltern');
$Stage->setMessage(
Function frontendHeadmasterGradeBook
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
public function frontendHeadmasterGradeBook($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenbuch', '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
Method setGradeOverview
has 284 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setGradeOverview(
TblYear $tblYear,
TblPerson $tblPerson,
$divisionList,
&$rowList,
Method frontendTeacherGradebook
has 224 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendTeacherGradebook($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenbuch', 'Auswahl');
$Stage->setMessage(
Method setSelectStudentStage
has 218 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setSelectStudentStage(Stage $Stage, $DivisionId = null, $GroupId = null, $IsHeadmaster = false)
{
$tblGroup = false;
$tblGroupTudor = Group::useService()->getGroupByMetaTable(TblGroup::META_TABLE_TUDOR);
Method frontendScoreTypeSelect
has 191 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendScoreTypeSelect(
$Id = null,
$YearId = null,
$Data = null
) {
Method frontendHeadmasterGradeBook
has 166 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterGradeBook($IsAllYears = false, $YearId = null)
{
$Stage = new Stage('Notenbuch', 'Auswahl');
$Stage->setMessage(
Function setStudentOverviewStage
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
private function setStudentOverviewStage(
$DivisionId,
$GroupId,
$PersonId,
Stage $Stage,
- 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 frontendTeacherDivisionList
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function frontendTeacherDivisionList($IsAllYears = false, $IsGroup = false, $YearId = null)
{
$Stage = new Stage('Schülerübersicht', 'Klasse des Schülers Auswählen');
$Stage->addButton(
- 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 setStudentOverviewStage
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setStudentOverviewStage(
$DivisionId,
$GroupId,
$PersonId,
Stage $Stage,
Function addTest
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function addTest(TblTest $tblTest,TblGrade $tblGrade = null, &$subTableHeaderList, &$subTableDataList, $hasScore, $showDivisionInToolTip)
{
if ($tblTest->isContinues()) {
if ($tblGrade && $tblGrade->getDate()) {
$date = $tblGrade->getDate();
- 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 frontendTeacherDivisionList
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendTeacherDivisionList($IsAllYears = false, $IsGroup = false, $YearId = null)
{
$Stage = new Stage('Schülerübersicht', 'Klasse des Schülers Auswählen');
$Stage->addButton(
Method frontendHeadmasterDivisionList
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendHeadmasterDivisionList($IsAllYears = false, $IsGroup = false, $YearId = null)
{
$Stage = new Stage('Schülerübersicht', 'Klasse des Schülers Auswählen');
$Stage->addButton(
Method frontendGradeType
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendGradeType($GradeType = null)
{
$Stage = new Stage('Zensuren-Typ', 'Übersicht');
$Stage->setMessage('Hier werden die Zensuren-Typen verwaltet. Bei den Zensuren-Typen wird zwischen den beiden
Frontend
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Frontend extends FrontendScoreRule
{
/**
* @param null $GradeType
Method addTest
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addTest(TblTest $tblTest,TblGrade $tblGrade = null, &$subTableHeaderList, &$subTableDataList, $hasScore, $showDivisionInToolTip)
{
if ($tblTest->isContinues()) {
if ($tblGrade && $tblGrade->getDate()) {
$date = $tblGrade->getDate();
Method getMinimumGradeCountPanel
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getMinimumGradeCountPanel($tblMinimumGradeCountList, $isSekII)
{
if ($tblMinimumGradeCountList) {
Function frontendHeadmasterDivisionList
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function frontendHeadmasterDivisionList($IsAllYears = false, $IsGroup = false, $YearId = null)
{
$Stage = new Stage('Schülerübersicht', 'Klasse des Schülers Auswählen');
$Stage->addButton(
- 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 frontendEditGradeType
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendEditGradeType($Id = null, $GradeType = null)
{
$Stage = new Stage('Zensuren-Typ', 'Bearbeiten');
Method frontendDestroyGradeType
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendDestroyGradeType(
$Id = null,
$Confirm = false
) {
Function getPersonListForStudent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getPersonListForStudent()
{
$tblPerson = false;
$tblAccount = Account::useService()->getAccountBySession();
if ($tblAccount) {
- 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 setGradeOverview
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
TblYear $tblYear,
TblPerson $tblPerson,
$divisionList,
&$rowList,
$tblPeriodList,
Method frontendScoreType
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendScoreType()
{
$Stage = new Stage('Bewertungssystem', 'Übersicht');
$Stage->setMessage(
Method formGradeType
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formGradeType()
{
$type = Evaluation::useService()->getTestTypeByIdentifier('TEST');
$typeList[$type->getId()] = $type->getName();
Function getMinimumGradeCountPanel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getMinimumGradeCountPanel($tblMinimumGradeCountList, $isSekII)
{
if ($tblMinimumGradeCountList) {
- 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
if ($tblPeriodList) {
$tableHeaderList['Subject'] = 'Fach';
foreach ($tblPeriodList as $tblPeriod) {
$tableHeaderList['Period' . $tblPeriod->getId()] = new Bold($tblPeriod->getDisplayName());
}
Method addTest
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function addTest(TblTest $tblTest,TblGrade $tblGrade = null, &$subTableHeaderList, &$subTableDataList, $hasScore, $showDivisionInToolTip)
Method setStudentOverviewStage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$DivisionId,
$GroupId,
$PersonId,
Stage $Stage,
$Route,
Avoid deeply nested control flow statements. Open
if (($tblPersonItem = $tblGradeItem->getServiceTblPerson())
&& !isset($studentArray[$tblPersonItem->getId()])
) {
$addStudentList[$tblPersonItem->getId()] = $tblPersonItem;
}
Avoid deeply nested control flow statements. 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
if ($posStart !== false) {
$posEnd = strpos($average, ')');
if ($posEnd !== false) {
$priority = substr($average, $posStart + 1, $posEnd - ($posStart + 1));
}
Avoid deeply nested control flow statements. Open
if (is_array($average)) {
$average = 'Fehler';
} elseif (is_string($average) && strpos($average, '(')) {
$average = substr($average, 0, strpos($average, '('));
}
Avoid deeply nested control flow statements. Open
if ($posEnd !== false) {
$priority = substr($average, $posStart + 1, $posEnd - ($posStart + 1));
}
Avoid deeply nested control flow statements. Open
if ($Relationship->getServiceTblPersonFrom() == $tblPersonSession->getId()) {
$ParentList[] = $Relationship->getServiceTblPersonTo();
} elseif ($Relationship->getServiceTblPersonTo() == $tblPersonSession->getId()) {
$ParentList[] = $Relationship->getServiceTblPersonFrom();
}
Avoid deeply nested control flow statements. Open
if ($tblCommon && ($tblCommonBirthDates = $tblCommon->getTblCommonBirthDates())) {
$Now = new \DateTime();
$Now->modify('-18 year');
Avoid deeply nested control flow statements. Open
if ($average != '') {
if (isset($averages[$column])) {
$averages[$column]['Count']++;
$averages[$column]['Sum'] += $average;
} else {
Avoid deeply nested control flow statements. Open
if (!$tblDivisionSubject->getTblSubjectGroup()) {
$hasStudentSubject = false;
$tblDivisionSubjectWhereGroup =
Division::useService()->getDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject(
$tblDivision,
Avoid deeply nested control flow statements. 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
if ($tblScoreRuleDivisionSubject->getTblScoreType()
&& $tblScoreRuleDivisionSubject->getTblScoreType()->getId() == $tblScoreType->getId()
) {
$Global->POST['Data'][$tblDivision->getId()][$subject->getId()] = 1;
}
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
Function frontendEditGradeType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function frontendEditGradeType($Id = null, $GradeType = null)
{
$Stage = new Stage('Zensuren-Typ', 'Bearbeiten');
- 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 337.
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 337.
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 3 locations. Consider refactoring. Open
public function frontendActivateGradeType(
$Id = null
) {
$Route = '/Education/Graduation/Gradebook/GradeType';
- 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 256.
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 (is_array($average)) {
$errorRowList = $average;
$average = '';
} else {
$posStart = strpos($average, '(');
- 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 220.
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 (is_array($average)) {
$errorRowList = $average;
$average = '';
} else {
$posStart = strpos($average, '(');
- 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 220.
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->getServiceTblSubject() && $tblDivisionSubject->getTblDivision()
&& $tblDivisionSubject->getHasGrading()
) {
if ($tblDivisionSubject->getTblSubjectGroup()) {
$divisionSubjectList[$tblDivisionSubject->getTblDivision()->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 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
Identical blocks of code found in 3 locations. Consider refactoring. Open
if ($tblDivisionSubject && $tblDivisionSubject->getServiceTblSubject()
&& $tblDivisionSubject->getTblDivision() && $tblDivisionSubject->getHasGrading()
) {
if ($tblDivisionSubject->getTblSubjectGroup()) {
$divisionSubjectList[$tblDivisionSubject->getTblDivision()->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 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
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
public function frontendHeadmasterStudentOverview($DivisionId = null, $GroupId = null, $PersonId = null, $IsParentView = false)
{
$Stage = new Stage('Schülerübersicht', 'Schüler anzeigen');
$Stage->addButton(new Standard(
'Zurück', '/Education/Graduation/Gradebook/Gradebook/Headmaster/Division/Student', new ChevronLeft(), array(
- 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 121.
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 frontendTeacherStudentOverview($DivisionId = null, $GroupId = null, $PersonId = null, $IsParentView = false)
{
$Stage = new Stage('Schülerübersicht', 'Schüler anzeigen');
$Stage->addButton(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 121.
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
} else {
$tblDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject
= Division::useService()->getDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject(
$tblDivisionSubject->getTblDivision(),
$tblSubjectTeacher->getTblDivisionSubject()->getServiceTblSubject()
- 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 frontendTeacherSelectedGradebook($DivisionSubjectId = null)
{
$Stage = new Stage('Notenbuch', 'Anzeigen');
- 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 119.
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 frontendHeadmasterSelectedGradeBook(
$DivisionSubjectId = null
) {
$Stage = new Stage('Notenbuch', 'Anzeigen');
- 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 119.
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 ($Data == null) {
$Global = $this->getGlobal();
/** @var TblSubject $subject */
foreach ($subjectList as $subject) {
$tblScoreRuleDivisionSubject = Gradebook::useService()->getScoreRuleDivisionSubjectByDivisionAndSubject(
- 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 111.
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 4 locations. Consider refactoring. Open
if (!$Confirm) {
$Stage->setContent(
new Layout(new LayoutGroup(new LayoutRow(new LayoutColumn(array(
new Panel(
'Zensuren-Typ',
- 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 110.
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
$Stage->setContent(
new Layout(array(
new LayoutGroup(array(
new LayoutRow(array(
empty($buttonList)
- 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 101.
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 ($tblSubject->getId() === -1) {
$name = new Italic((
$tblSubject->getAcronym() ? new Bold($tblSubject->getAcronym() . ' ') : '') . $tblSubject->getName()
);
} 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 98.
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