File Service.php
has 1379 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Education\Graduation\Evaluation;
use SPHERE\Application\Education\Graduation\Evaluation\Service\Data;
Function updateDivisionTasks
has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring. Open
public function updateDivisionTasks(IFormInterface $Stage = null, $Id, $Data = null)
{
/**
* Skip to Frontend
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function setCurrentTaskList
has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring. Open
private function setCurrentTaskList(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblTestType $tblTestType,
- 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 getLayoutRowsForTestPlanning
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
public function getLayoutRowsForTestPlanning($testArray)
{
$preview = array();
if (!empty($testArray)) {
$trans = array(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getTeacherWelcome
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
public function getTeacherWelcome(TblPerson $tblPerson)
{
$appointedDateTaskList = array();
$behaviorTask = array();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getTestLinkPanel
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
public function getTestLinkPanel(
TblYear $tblYear,
TblDivisionSubject $tblDivisionSubjectSelected
) {
$panel = 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
Function createTest
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
public function createTest(IFormInterface $Stage = null, $DivisionSubjectId = null, $Test = null, $BasicRoute)
{
/**
* Skip to Frontend
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Service
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class Service extends AbstractService
{
/**
* @param bool $doSimulation
Method setCurrentTaskList
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setCurrentTaskList(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblTestType $tblTestType,
Function addDivisionToAppointedDateTask
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function addDivisionToAppointedDateTask(
TblTask $tblTask,
TblDivision $tblDivision
) {
- 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 getTeacherWelcome
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTeacherWelcome(TblPerson $tblPerson)
{
$appointedDateTaskList = array();
$behaviorTask = array();
Method createTest
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createTest(IFormInterface $Stage = null, $DivisionSubjectId = null, $Test = null, $BasicRoute)
{
/**
* Skip to Frontend
Method getLayoutRowsForTestPlanning
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLayoutRowsForTestPlanning($testArray)
{
$preview = array();
if (!empty($testArray)) {
$trans = array(
Method updateDivisionTasks
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateDivisionTasks(IFormInterface $Stage = null, $Id, $Data = null)
{
/**
* Skip to Frontend
Function getTestListForPlanning
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getTestListForPlanning($tblDivisionList, TblGradeType $tblGradeType = null, $isHighlighted = false)
{
$result = array();
$tblGradeTypeList = array();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function sortTestList
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function sortTestList($tblTestList)
{
if (($tblSetting = Consumer::useService()->getSetting(
'Education', 'Graduation', 'Gradebook', 'SortHighlighted'
- 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 getTestLinkPanel
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTestLinkPanel(
TblYear $tblYear,
TblDivisionSubject $tblDivisionSubjectSelected
) {
$panel = false;
Function updateTest
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function updateTest(IFormInterface $Stage = null, $Id, $Test, $BasicRoute)
{
/**
* Skip to Frontend
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method updateTest
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateTest(IFormInterface $Stage = null, $Id, $Test, $BasicRoute)
{
/**
* Skip to Frontend
Function addBehaviorGradeTypeToDivisionAndTask
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function addBehaviorGradeTypeToDivisionAndTask(
TblTask $tblTask,
TblDivision $tblDivision,
TblGradeType $tblGradeType
) {
- 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 createTask
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function createTask(IFormInterface $Stage = null, $Task, TblYear $tblYear = null)
{
/**
* Skip to Frontend
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function updateTask
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function updateTask(IFormInterface $Stage = null, $Id, $Task)
{
/**
* Skip to Frontend
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method updateTask
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateTask(IFormInterface $Stage = null, $Id, $Task)
{
/**
* Skip to Frontend
Function setWelcomeContent
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function setWelcomeContent($taskList, $columns, $isFuture = false)
{
foreach ($taskList as $taskId => $list) {
if (($tblTask = Evaluation::useService()->getTaskById($taskId))
&& $tblTestType = $tblTask->getTblTestType()
- 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 createTask
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createTask(IFormInterface $Stage = null, $Task, TblYear $tblYear = null)
{
/**
* Skip to Frontend
Method addDivisionToAppointedDateTask
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addDivisionToAppointedDateTask(
TblTask $tblTask,
TblDivision $tblDivision
) {
Method addBehaviorGradeTypeToDivisionAndTask
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addBehaviorGradeTypeToDivisionAndTask(
TblTask $tblTask,
TblDivision $tblDivision,
TblGradeType $tblGradeType
) {
Method sortTestList
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sortTestList($tblTestList)
{
if (($tblSetting = Consumer::useService()->getSetting(
'Education', 'Graduation', 'Gradebook', 'SortHighlighted'
Method setWelcomeContent
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setWelcomeContent($taskList, $columns, $isFuture = false)
{
foreach ($taskList as $taskId => $list) {
if (($tblTask = Evaluation::useService()->getTaskById($taskId))
&& $tblTestType = $tblTask->getTblTestType()
Method getTestListForPlanning
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTestListForPlanning($tblDivisionList, TblGradeType $tblGradeType = null, $isHighlighted = false)
{
$result = array();
$tblGradeTypeList = array();
Consider simplifying this complex logical expression. Open
if (($tblTask = $tblTest->getTblTask())
&& $tblTask->getFromDate()
&& $tblTask->getToDate()
&& ($fromDate = new \DateTime($tblTask->getFromDate()))
&& ($toDate = new \DateTime($tblTask->getToDate()))
Avoid deeply nested control flow statements. Open
if ($tblPersonList) {
foreach ($tblPersonList as $tblPerson) {
$TeacherAcronym = new ToolTip(new Small(new NotAvailable())
,
'Lehrer ' . $tblPerson->getLastFirstName() . ' besitzt kein Lehrerkürzel');
Avoid deeply nested control flow statements. Open
if ($tblPeriod->getId() == $tblPeriodOrigin->getId()) {
if (isset($tblPeriodLinkList[$periodPosition])) {
$tblPeriodLink = $tblPeriodLinkList[$periodPosition];
}
break;
Avoid deeply nested control flow statements. Open
if (!$this->existsTestByTask($tblTask, $tblDivision,
$tblDivisionSubject->getServiceTblSubject())
) {
(new Data($this->getBinding()))->createTest(
$tblDivision,
Avoid deeply nested control flow statements. Open
if (($tblDivision = $tblDivisionSubject->getTblDivision())
&& $tblDivision->getServiceTblYear()
&& $tblYear->getId() == $tblDivision->getServiceTblYear()
&& ($tblSubject = $tblDivisionSubject->getServiceTblSubject())
&& ($tblDivisionSubjectSelected->getServiceTblSubject())
Avoid deeply nested control flow statements. Open
if ($now > $taskFromDate
&& $now < ($taskToDate->add(new \DateInterval('P1D')))
) {
$countGrades = 0;
if (($tblGradeList = Gradebook::useService()->getProposalBehaviorGradeAllBy($tblDivisionItem, $tblTask))) {
Avoid deeply nested control flow statements. Open
if ($tblDivision) {
$behaviorTaskAddList[] = array(
'tblTask' => $tblTask,
'tblDivision' => $tblDivision,
'tblGradeType' => $tblGradeType
Avoid deeply nested control flow statements. Open
if ($tblPersonListMain) {
foreach ($tblPersonListMain as $tblPerson) {
$TeacherAcronym = new ToolTip(new Small(new NotAvailable())
,
'Lehrer ' . $tblPerson->getLastFirstName() . ' besitzt kein Lehrerkürzel');
Avoid deeply nested control flow statements. Open
if (($tblSubjectStudent->getServiceTblPerson())) {
$countPersons++;
}
Consider simplifying this complex logical expression. Open
if (($tblDivision = $tblDivisionSubject->getTblDivision())
&& $tblDivision->getServiceTblYear()
&& $tblYear->getId() == $tblDivision->getServiceTblYear()
&& ($tblSubject = $tblDivisionSubject->getServiceTblSubject())
&& ($tblDivisionSubjectSelected->getServiceTblSubject())
Consider simplifying this complex logical expression. Open
if (($tblTask = $tblTest->getTblTask())
&& $tblTask->getFromDate()
&& $tblTask->getToDate()
&& ($fromDate = new \DateTime($tblTask->getFromDate()))
&& $now < $fromDate
Method setFutureTaskList
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblTestType $tblTestType,
$taskList
Method setCurrentTaskList
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblTestType $tblTestType,
$taskList
Method existsTestByTaskAndGradeType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblTask $tblTask,
TblDivision $tblDivision,
TblSubject $tblSubject,
TblGradeType $tblGradeType,
TblSubjectGroup $tblSubjectGroup = null
Method getTestAllByTypeAndDivisionAndSubjectAndPeriodAndSubjectGroup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TblDivision $tblDivision,
TblSubject $tblSubject,
TblTestType $tblTestType = null,
TblPeriod $tblPeriod = null,
TblSubjectGroup $tblSubjectGroup = null
Function getHighlightedTestList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getHighlightedTestList(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblPeriod $tblPeriod
) {
- 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 setFutureTaskList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function setFutureTaskList(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null,
TblTestType $tblTestType,
- 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 too many return
statements within this method. Open
return new Success('Die Leistungsüberprüfung ist angelegt worden',
new \SPHERE\Common\Frontend\Icon\Repository\Success())
. new Redirect($BasicRoute . '/Selected', Redirect::TIMEOUT_SUCCESS,
array('DivisionSubjectId' => $tblDivisionSubject->getId()));
Avoid too many return
statements within this method. Open
return new Danger(new Ban() . ' Fach nicht gefunden')
. new Redirect($BasicRoute . '/Selected', Redirect::TIMEOUT_ERROR,
array('DivisionSubjectId' => $tblDivisionSubject->getId()));
Avoid too many return
statements within this method. Open
return new Danger(new Ban() . ' Zensuren-Typ nicht gefunden')
. new Redirect($BasicRoute . '/Selected', Redirect::TIMEOUT_ERROR,
array('DivisionSubjectId' => $tblDivisionSubject->getId()));
Avoid too many return
statements within this method. Open
return new Success('Test erfolgreich geändert.', new \SPHERE\Common\Frontend\Icon\Repository\Success()) .
new Redirect($BasicRoute . '/Selected', Redirect::TIMEOUT_SUCCESS,
array('DivisionSubjectId' => $tblDivisionSubject->getId()));
Function getDivisionAllByTask
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDivisionAllByTask(TblTask $tblTask)
{
$resultList = array();
$tblTestList = $this->getTestAllByTask($tblTask);
- 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
$tblTestAdd = (new Data($this->getBinding()))->createTest(
$tblDivisionSubjectToLink->getTblDivision(),
$tblDivisionSubjectToLink->getServiceTblSubject(),
$tblDivisionSubjectToLink->getTblSubjectGroup() ? $tblDivisionSubjectToLink->getTblSubjectGroup() : null,
$tblPeriodLink,
- 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 175.
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
$tblTest = (new Data($this->getBinding()))->createTest(
$tblDivisionSubject->getTblDivision(),
$tblDivisionSubject->getServiceTblSubject(),
$tblDivisionSubject->getTblSubjectGroup() ? $tblDivisionSubject->getTblSubjectGroup() : null,
$tblPeriod,
- 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 175.
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 (isset($Task['ToDate']) && empty($Task['ToDate'])) {
$Stage->setError('Task[ToDate]', 'Bitte geben Sie ein Datum an');
$Error = true;
} else {
$nowDate = (new \DateTime('now'))->format("Y-m-d");
- 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 140.
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 (isset($Task['ToDate']) && empty($Task['ToDate'])) {
$Stage->setError('Task[ToDate]', 'Bitte geben Sie ein Datum an');
$Error = true;
} else {
$nowDate = (new \DateTime('now'))->format("Y-m-d");
- 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 140.
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 (isset($taskList[$tblTask->getId()][$tblDivision->getDisplayName() . $tblSubject->getAcronym()
. ($tblSubjectGroup ? $tblSubjectGroup->getName() : '')]['CountGrades'])
) {
$taskList[$tblTask->getId()][$tblDivision->getDisplayName() . $tblSubject->getAcronym()
. ($tblSubjectGroup ? $tblSubjectGroup->getName() : '')]['CountGrades'] += $countGrades;
- 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 138.
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 (isset($taskList[$tblTask->getId()][$tblDivision->getDisplayName() . $tblSubject->getAcronym()
. ($tblSubjectGroup ? $tblSubjectGroup->getName() : '')]['CountPersons'])
) {
$taskList[$tblTask->getId()][$tblDivision->getDisplayName() . $tblSubject->getAcronym()
. ($tblSubjectGroup ? $tblSubjectGroup->getName() : '')]['CountPersons'] += $countPersons;
- 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 138.
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 Data($this->getBinding()))->updateTest(
$tblTestItem,
$Test['Description'],
isset($Test['Date']) ? $Test['Date'] : null,
isset($Test['CorrectionDate']) ? $Test['CorrectionDate'] : 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 126.
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 Data($this->getBinding()))->updateTest(
$tblTest,
$Test['Description'],
isset($Test['Date']) ? $Test['Date'] : null,
isset($Test['CorrectionDate']) ? $Test['CorrectionDate'] : 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 126.
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 ($tblDivisionSubjectTeacher) {
// Teacher Group (if exist) else Teacher Subject
$tblPersonList = Division::useService()->getTeacherAllByDivisionSubject($tblDivisionSubjectTeacher);
if ($tblPersonList) {
foreach ($tblPersonList as $tblPerson) {
- 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 113.
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 ($tblDivisionSubjectMain) {
// Teacher Subject (if Group exist)
$tblPersonListMain = Division::useService()->getTeacherAllByDivisionSubject($tblDivisionSubjectMain);
if ($tblPersonListMain) {
foreach ($tblPersonListMain as $tblPerson) {
- 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 113.
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
} else {
$LayoutRowList = array();
$LayoutRowCount = 0;
$LayoutRow = 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 100.
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 ($tblDivisionSubject->getHasGrading()) {
$appointedDateTaskList = $this->setCurrentTaskList(
$tblDivision,
$tblSubject,
($tblSubjectGroup = $tblDivisionSubject->getTblSubjectGroup())
- 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 95.
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 ($tblDivisionSubject->getHasGrading() || (($tblSetting = Consumer::useService()->getSetting(
'Education', 'Graduation', 'Evaluation', 'HasBehaviorGradesForSubjectsWithNoGrading'
))
&& $tblSetting->getValue())
) {
- 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 95.
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