File Service.php
has 855 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Reporting\Custom\Herrnhut\Person;
use MOC\V\Component\Document\Component\Bridge\Repository\PhpExcel;
Method createExtendedClassList
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createExtendedClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
Function createExtendedClassListExcel
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function createExtendedClassListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
- 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 countSubject
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
private function countSubject($tblPersonList, $SubjectType)
{
$result = array();
if (empty( $tblPersonList )) {
- 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 createLanguageListExcel
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function createLanguageListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
- 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 createLanguageListExcel
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createLanguageListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
Method createExtendedClassListExcel
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createExtendedClassListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
Method createLanguageList
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createLanguageList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
Function countProfile
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function countProfile($tblPersonList)
{
$result = array();
if (empty( $tblPersonList )) {
return $result;
- 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 (($fromLevel = $tblStudentSubject->getServiceTblLevelFrom())
&& ($tillLevel = $tblStudentSubject->getServiceTblLevelTill())
&& $fromLevel->getName()
&& $tillLevel->getName()
&& floatval($fromLevel->getName()) <= floatval($level)
Method createProfileListExcel
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createProfileListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
Method createClassList
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createClassList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
Method createClassListExcel
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createClassListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
Method createProfileList
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createProfileList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
Method createSignListExcel
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSignListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
Function setForeignLanguage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function setForeignLanguage(TblStudentSubject $tblStudentSubject, TblDivision $tblDivision, &$Item) {
$tblSubject = $tblStudentSubject->getServiceTblSubject();
if ($tblSubject && ($ranking = $tblStudentSubject->getTblStudentSubjectRanking())) {
if (($tblLevel = $tblDivision->getTblLevel())
&& ($level = $tblLevel->getName())
- 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 createSignList
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createSignList(TblDivision $tblDivision)
{
$tblPersonList = Division::useService()->getStudentAllByDivision($tblDivision);
Method setForeignLanguage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setForeignLanguage(TblStudentSubject $tblStudentSubject, TblDivision $tblDivision, &$Item) {
$tblSubject = $tblStudentSubject->getServiceTblSubject();
if ($tblSubject && ($ranking = $tblStudentSubject->getTblStudentSubjectRanking())) {
if (($tblLevel = $tblDivision->getTblLevel())
&& ($level = $tblLevel->getName())
Function createProfileListExcel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function createProfileListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
- 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 countSubject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function countSubject($tblPersonList, $SubjectType)
{
$result = array();
if (empty( $tblPersonList )) {
Avoid deeply nested control flow statements. Open
if ($tblStudentTransfer) {
$Item['Entrance'] = $tblStudentTransfer->getTransferDate();
}
Function createSignListExcel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createSignListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
- 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 createClassListExcel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createClassListExcel($PersonList, $tblPersonList)
{
if (!empty( $PersonList )) {
- 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
foreach ($PersonList as $PersonData) {
// Fill Header
if ($Row == 3) {
$export->setValue($export->getCell(0, 0), 'Klasse: '.$PersonData['Division'].
' - Profil Liste');
- 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 266.
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
foreach ($PersonList as $PersonData) {
// Fill Header
if ($Row == 3) {
$export->setValue($export->getCell(0, 0), 'Klasse: '.$PersonData['Division'].
' - Unterschriften Liste');
- 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 266.
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 12 locations. Consider refactoring. Open
if ($tblToPersonAddress && ($tblAddress = $tblToPersonAddress->getTblAddress())) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 109.
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 12 locations. Consider refactoring. Open
if ($tblToPersonAddress && ($tblAddress = $tblToPersonAddress->getTblAddress())) {
$Item['StreetName'] = $tblAddress->getStreetName();
$Item['StreetNumber'] = $tblAddress->getStreetNumber();
$Item['Code'] = $tblAddress->getTblCity()->getCode();
$Item['City'] = $tblAddress->getTblCity()->getName();
- 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 109.
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