Function frontendPrintCertificateDivisionTeacher
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
public function frontendPrintCertificateDivisionTeacher()
{
$Stage = new Stage('Zeugnis', 'Übersicht (nicht gedruckte Zeugnisse)');
- 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 frontendPrintCertificate
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
public function frontendPrintCertificate()
{
$Stage = new Stage('Zeugnis', 'Übersicht (nicht gedruckte Zeugnisse)');
$Stage->addButton(new Standard('Historie Personen', '/Education/Certificate/PrintCertificate/History', null, 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
File Frontend.php
has 733 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: Kauschke
* Date: 26.07.2016
Function frontendConfirmPrintCertificate
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function frontendConfirmPrintCertificate(
$PrepareId = null,
$DivisionId = null,
$IsLeave = false,
$Route = 'All'
- 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 frontendPrintCertificate
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendPrintCertificate()
{
$Stage = new Stage('Zeugnis', 'Übersicht (nicht gedruckte Zeugnisse)');
$Stage->addButton(new Standard('Historie Personen', '/Education/Certificate/PrintCertificate/History', null, array(),
Method frontendConfirmPrintCertificate
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendConfirmPrintCertificate(
$PrepareId = null,
$DivisionId = null,
$IsLeave = false,
$Route = 'All'
Method frontendPrintCertificateDivisionTeacher
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendPrintCertificateDivisionTeacher()
{
$Stage = new Stage('Zeugnis', 'Übersicht (nicht gedruckte Zeugnisse)');
Method frontendPrintCertificateHistoryPerson
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistoryPerson($PersonId = null)
{
$Stage = new Stage('Zeugnis', 'Auswahl');
$Stage->addButton(new Standard('Zurück', '/Education/Certificate/PrintCertificate/History', new ChevronLeft()));
Function frontendPrintCertificateHistory
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistory()
{
$Stage = new Stage('Zeugnis', 'Person auswählen');
$Stage->addButton(new Standard(
- 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 frontendPrintCertificateHistorySelectedDivision
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistorySelectedDivision($DivisionId = null)
{
$Stage = new Stage('Zeugnis', 'Auswahl');
$Stage->addButton(new Standard('Zurück', '/Education/Certificate/PrintCertificate/History/Division', new ChevronLeft()));
Method frontendPrintCertificateHistory
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistory()
{
$Stage = new Stage('Zeugnis', 'Person auswählen');
$Stage->addButton(new Standard(
Function frontendPrintCertificateHistoryPerson
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistoryPerson($PersonId = null)
{
$Stage = new Stage('Zeugnis', 'Auswahl');
$Stage->addButton(new Standard('Zurück', '/Education/Certificate/PrintCertificate/History', new ChevronLeft()));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method frontendPrintCertificateHistoryDivision
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistoryDivision()
{
$Stage = new Stage('Zeugnis', 'Klasse auswählen');
$Stage->addButton(new Standard(
Function frontendPrintCertificateHistorySelectedDivision
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistorySelectedDivision($DivisionId = null)
{
$Stage = new Stage('Zeugnis', 'Auswahl');
$Stage->addButton(new Standard('Zurück', '/Education/Certificate/PrintCertificate/History/Division', new ChevronLeft()));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Consider simplifying this complex logical expression. Open
if (($tblPerson = $tblPrepareStudent->getServiceTblPerson())
&& ($tblPrepare = $tblPrepareStudent->getTblPrepareCertificate())
&& $tblPrepareStudent->getServiceTblCertificate()
&& !$tblPrepareStudent->isPrinted()
&& ($tblDivisionItem = $tblPrepare->getServiceTblDivision())
Avoid deeply nested control flow statements. Open
if (($tblDivisionItem = $tblPrepareCertificate->getServiceTblDivision())
&& isset($divisionList[$tblDivisionItem->getId()])
) {
if (($tblPrepareStudentList = Prepare::useService()->getPrepareStudentAllByPrepare($tblPrepareCertificate))) {
foreach ($tblPrepareStudentList as $tblPrepareStudent) {
Avoid deeply nested control flow statements. Open
if (($tblPerson = $tblPrepareStudent->getServiceTblPerson())
&& ($tblPrepare = $tblPrepareStudent->getTblPrepareCertificate())
&& $tblPrepareStudent->getServiceTblCertificate()
&& !$tblPrepareStudent->isPrinted()
&& ($tblDivisionItem = $tblPrepare->getServiceTblDivision())
Consider simplifying this complex logical expression. Open
if (($tblPerson = $tblPrepareStudent->getServiceTblPerson())
&& ($tblPrepare = $tblPrepareStudent->getTblPrepareCertificate())
&& $tblPrepareStudent->getServiceTblCertificate()
&& ($tblDivisionItem = $tblPrepare->getServiceTblDivision())
&& ($tblDivisionStudent = Division::useService()->getDivisionStudentByDivisionAndPerson($tblDivisionItem, $tblPerson))
Consider simplifying this complex logical expression. Open
if (($tblPerson = $tblPrepareStudent->getServiceTblPerson())
&& ($tblPrepare = $tblPrepareStudent->getTblPrepareCertificate())
&& $tblPrepareStudent->getServiceTblCertificate()
&& !$tblPrepareStudent->isPrinted()
&& ($tblDivisionStudent = Division::useService()->getDivisionStudentByDivisionAndPerson($tblDivisionItem, $tblPerson))
Consider simplifying this complex logical expression. Open
if (($tblPerson = $tblPrepareStudent->getServiceTblPerson())
&& ($tblPrepare = $tblPrepareStudent->getTblPrepareCertificate())
&& $tblPrepareStudent->getServiceTblCertificate()
&& ($tblDivisionItem = $tblPrepare->getServiceTblDivision())
&& ($tblDivisionStudent = Division::useService()->getDivisionStudentByDivisionAndPerson($tblDivisionItem, $tblPerson))
Function frontendPrintCertificateHistoryDivision
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function frontendPrintCertificateHistoryDivision()
{
$Stage = new Stage('Zeugnis', 'Klasse auswählen');
$Stage->addButton(new Standard(
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
$Stage->setContent(
new Layout(array(
new LayoutGroup(array(
new LayoutRow(array(
new LayoutColumn(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 192.
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(
new LayoutColumn(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 192.
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 (($tblLeaveStudentList = Prepare::useService()->getLeaveStudentAllBy(false, false))) {
foreach ($tblLeaveStudentList as $tblLeaveStudent) {
if (($tblDivision = $tblLeaveStudent->getServiceTblDivision())
&& !isset($leaveDivisionList[$tblDivision->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 117.
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 (($tblLeaveStudentList = Prepare::useService()->getLeaveStudentAllBy(true, false))) {
foreach ($tblLeaveStudentList as $tblLeaveStudent) {
if (($tblDivision = $tblLeaveStudent->getServiceTblDivision())
&& !isset($leaveDivisionList[$tblDivision->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 117.
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 ($tblPrepareList = Prepare::useService()->getPrepareAllByDivision($tblDivision)){
foreach ($tblPrepareList as $tblPrepare){
if (Prepare::useService()->isPreparePrinted($tblPrepare)) {
$dataList[] = array(
'Year' => $tblDivision->getServiceTblYear() ? $tblDivision->getServiceTblYear()->getDisplayName() : '',
- 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 105.
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 ($tblDivisionList) {
/** @var TblDivision $tblDivision */
foreach ($tblDivisionList as $tblDivision) {
if (Prepare::useService()->getPrepareAllByDivision($tblDivision)) {
$divisionTable[] = 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 105.
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