File Service.php
has 1648 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Education\Lesson\Division;
use SPHERE\Application\Education\Graduation\Evaluation\Evaluation;
use SPHERE\Application\Education\Graduation\Gradebook\Gradebook;
Service
has 130 functions (exceeds 20 allowed). Consider refactoring. Open
class Service extends AbstractService
{
/**
* @return false|ViewDivision[]
Function addSubjectWithGroups
has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring. Open
public function addSubjectWithGroups(
TblDivision $tblDivision,
TblDivision $tblDivisionCopy
) {
- 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 copyDivision
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
public
function copyDivision(
IFormInterface $Form,
TblDivision $tblDivision,
$Level,
- 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 getMinDivisionByLevelType
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
public
function getMinDivisionByLevelType(
TblType $tblType
) {
- 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 getDivisionSubjectAllByPersonAndYear
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public
function getDivisionSubjectAllByPersonAndYear(
TblPerson $tblPerson,
TblYear $tblYear
) {
- 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 countDivisionSubjectForSubjectTeacherByDivision
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public
function countDivisionSubjectForSubjectTeacherByDivision(
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
Function addSubjectWithoutGroups
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public
function addSubjectWithoutGroups(
TblDivision $tblDivision,
TblDivision $tblDivisionCopy
) {
- 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 sortDivisionStudentWithGenderByProperty
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function sortDivisionStudentWithGenderByProperty(
TblDivision $tblDivision,
$Property = 'LastFirstName',
$Sorter = null,
$Order = Sorter::ORDER_ASC
- 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 createLevelDivision
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function createLevelDivision(
IFormInterface $Form,
$Level,
$Division
) {
- 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 copyDivision
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public
function copyDivision(
IFormInterface $Form,
TblDivision $tblDivision,
$Level,
Function getSubjectTeacherNameList
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public
function getSubjectTeacherNameList(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = 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 getDivisionAllByName
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getDivisionAllByName($divisionName, TblYear $tblYear = null, TblType $tblType = null)
{
$divisionList = array();
$divisionName = str_replace(' ', '', $divisionName);
- 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 countDivisionSubjectGroupTeacherByDivision
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public
function countDivisionSubjectGroupTeacherByDivision(
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
Function changeSubjectGroup
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function changeSubjectGroup(
IFormInterface $Form,
$Group,
$Id,
$DivisionId,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method addSubjectWithGroups
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addSubjectWithGroups(
TblDivision $tblDivision,
TblDivision $tblDivisionCopy
) {
Method createLevelDivision
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createLevelDivision(
IFormInterface $Form,
$Level,
$Division
) {
Function addSubjectToDivisionWithGroup
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function addSubjectToDivisionWithGroup(
IFormInterface $Form,
TblDivision $tblDivision,
TblSubject $tblSubject,
$Group,
- 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 sortDivisionStudentWithGenderByProperty
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sortDivisionStudentWithGenderByProperty(
TblDivision $tblDivision,
$Property = 'LastFirstName',
$Sorter = null,
$Order = Sorter::ORDER_ASC
Function removeSubjectToDivision
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public
function removeSubjectToDivision(
TblDivision $tblDivision,
TblSubject $tblSubject
) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method changeSubjectGroup
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function changeSubjectGroup(
IFormInterface $Form,
$Group,
$Id,
$DivisionId,
Function getDivisionAllByTeacher
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public
function getDivisionAllByTeacher(
TblPerson $tblPerson
) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method addSubjectToDivisionWithGroup
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addSubjectToDivisionWithGroup(
IFormInterface $Form,
TblDivision $tblDivision,
TblSubject $tblSubject,
$Group,
Method getMinDivisionByLevelType
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public
function getMinDivisionByLevelType(
TblType $tblType
) {
Function removePerson
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function removePerson(TblPerson $tblPerson, $IsSoftRemove = false)
{
if (($tblDivisionCustodyAllByPerson = $this->getDivisionCustodyAllByPerson($tblPerson))){
foreach($tblDivisionCustodyAllByPerson as $tblDivisionCustody){
- 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 removePerson
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function removePerson(TblPerson $tblPerson, $IsSoftRemove = false)
{
if (($tblDivisionCustodyAllByPerson = $this->getDivisionCustodyAllByPerson($tblPerson))){
foreach($tblDivisionCustodyAllByPerson as $tblDivisionCustody){
Function getStudentCountByYear
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getStudentCountByYear(TblYear $tblYear)
{
$countStudentsByYear = 0;
if (($tblDivisionList = $this->getDivisionAllByYear($tblYear))) {
- 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 getDivisionSubjectByDivision
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getDivisionSubjectByDivision(TblDivision $tblDivision, $isListWithSubjectGroup = true)
{
if ($isListWithSubjectGroup) {
return (new Data($this->getBinding()))->getDivisionSubjectByDivision($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
Function getSubjectStudentByPersonAndDivision
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getSubjectStudentByPersonAndDivision(TblPerson $tblPerson, TblDivision $tblDivision)
{
$resultList = array();
$tblSubjectStudentList = (new Data($this->getBinding()))->getSubjectStudentByPerson($tblPerson);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method countDivisionSubjectForSubjectTeacherByDivision
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public
function countDivisionSubjectForSubjectTeacherByDivision(
TblDivision $tblDivision
) {
Method getDivisionAllByName
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDivisionAllByName($divisionName, TblYear $tblYear = null, TblType $tblType = null)
{
$divisionList = array();
$divisionName = str_replace(' ', '', $divisionName);
Method getDivisionSubjectAllByPersonAndYear
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public
function getDivisionSubjectAllByPersonAndYear(
TblPerson $tblPerson,
TblYear $tblYear
) {
Method addSubjectWithoutGroups
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public
function addSubjectWithoutGroups(
TblDivision $tblDivision,
TblDivision $tblDivisionCopy
) {
Method getSubjectTeacherNameList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public
function getSubjectTeacherNameList(
TblDivision $tblDivision,
TblSubject $tblSubject,
TblSubjectGroup $tblSubjectGroup = null
Function getDivisionByPersonAndYear
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getDivisionByPersonAndYear(TblPerson $tblPerson, TblYear $tblYear)
{
$tblDivisionList = $this->getDivisionByYear($tblYear);
if ($tblDivisionList) {
- 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 changeDivision
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public
function changeDivision(
IFormInterface $Form,
$Division,
$Id
- 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 changeSubjectGroup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IFormInterface $Form,
$Group,
$Id,
$DivisionId,
$DivisionSubjectId,
Function updateDivisionSubject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function updateDivisionSubject(
IFormInterface $Form,
TblDivision $tblDivision,
$Data
) {
- 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 addSubjectToDivisionWithGroup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IFormInterface $Form,
TblDivision $tblDivision,
TblSubject $tblSubject,
$Group,
$DivisionSubjectId,
Avoid deeply nested control flow statements. Open
if ($this->exitsSubjectStudent($item, $tblPerson)) {
$resultList[$item->getId()] = $item;
}
Avoid deeply nested control flow statements. Open
if (!$SubjectTeacherList && !$tblSubjectTeacherList) {
$TeacherGroupCount++;
}
Avoid deeply nested control flow statements. Open
if ($tblDivision->getServiceTblYear()
&& $tblYear->getId() === $tblDivision->getServiceTblYear()->getId()
) {
$DivisionList[] = $tblDivision;
}
Function getOtherDivisionsByStudent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getOtherDivisionsByStudent(
TblDivision $tblDivision,
TblPerson $tblPerson,
$withCurrentDivision = true
) {
- 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 ($tblSubjectTeacher->getServiceTblPerson()) {
(new Data($this->getBinding()))->addSubjectTeacher($tblDivisionSubjectCopy,
$tblSubjectTeacher->getServiceTblPerson());
}
Avoid deeply nested control flow statements. Open
if ($tblGender->getName() == 'Männlich') {
$maleList[] = $tblStudent;
continue;
} elseif ($tblGender->getName() == 'Weiblich') {
$femaleList[] = $tblStudent;
Function getDivisionByDivisionNameAndLevelAndYear
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getDivisionByDivisionNameAndLevelAndYear($Name, TblLevel $tblLevel = null, TblYear $tblYear)
{
if ($tblYear && $tblLevel && $Name != '') {
$tblDivisionList = 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
Avoid deeply nested control flow statements. Open
if ($SubjectTeacherList) {
$TeacherGroup[] = true;
}
Avoid deeply nested control flow statements. Open
if ((count($tblDivisionSubjectActiveList) - 1) == count($TeacherGroup)) {
$SubjectUsedCount--;
}
Consider simplifying this complex logical expression. Open
if ($tblYear && $tblLevel && $Name != '') {
$tblDivisionList = array();
if (( $tblDivision = ( new Data($this->getBinding()) )->getDivisionByDivisionNameAndLevelAndYear($Name, $tblLevel, $tblYear) )) {
$tblDivisionList[] = $tblDivision;
return $tblDivisionList;
Function getDivisionAllByYearAndType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getDivisionAllByYearAndType(TblYear $tblYear, TblType $tblType)
{
$result = 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 removeStudentToDivision
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function removeStudentToDivision(TblDivision $tblDivision, TblPerson $tblPerson, $IsSoftRemove = false)
{
$tblStudentSubjectList = (new Data($this->getBinding()))->getSubjectStudentByPerson($tblPerson);
if ($tblStudentSubjectList) {
- 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 addAllAvailableStudentsToSubjectGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addAllAvailableStudentsToSubjectGroup(TblDivisionSubject $tblDivisionSubject)
{
$filter = new Filter($tblDivisionSubject);
$filter->load();
- 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 getSubjectGroupByNameAndDivisionAndSubject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getSubjectGroupByNameAndDivisionAndSubject($Name, TblDivision $tblDivision, TblSubject $tblSubject)
{
$tblDivisionSubjectList = Division::useService()->getDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject($tblDivision, $tblSubject);
if ($tblDivisionSubjectList) {
- 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 $Form;
Avoid too many return
statements within this method. Open
return $Form;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $Form;
Avoid too many return
statements within this method. Open
return $Form;
Function getPersonAllByDivisionList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPersonAllByDivisionList($tblDivisionList)
{
$tblPersonList = array();
if (!empty($tblDivisionList)) {
- 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 destroyLevel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public
function destroyLevel(
TblLevel $tblLevel
) {
- 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 sortDivisionStudentByProperty
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function sortDivisionStudentByProperty(
TblDivision $tblDivision,
$Property = 'LastFirstName',
$Sorter = null,
$Order = Sorter::ORDER_ASC
- 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
if (!$Error) {
$tblLevel = null;
if (!isset($Level['Check'])) {
if (isset($Level['Name']) && empty($Level['Name'])) {
$Form->setError('Level[Name]', 'Bitte geben Sie eine Klassenstufe für die Schulart an <br/>');
- 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 195.
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 (!$Error) {
$tblLevel = null;
if (!isset($Level['Check'])) {
if (isset($Level['Name']) && empty($Level['Name'])) {
$Form->setError('Level[Name]', 'Bitte geben Sie eine Klassenstufe für die Schulart an <br/>');
- 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 195.
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 destroyLevel(
TblLevel $tblLevel
) {
- 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 169.
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($Level['Check']) && isset($Level['Name'])) {
if (is_numeric($Level['Name'])) {
$position = strpos($Level['Name'], '0');
if ($position === 0) {
$Form->setError('Level[Name]', 'Bitte geben Sie eine Zahl ohne führende "0" ein');
- 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 116.
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($Level['Check']) && isset($Level['Name'])) {
if (is_numeric($Level['Name'])) {
$position = strpos($Level['Name'], '0');
if ($position === 0) {
$Form->setError('Level[Name]', 'Bitte geben Sie eine Zahl ohne führende "0" ein');
- 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 116.
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