File ApiIndividual.php
has 1783 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Api\Reporting\Individual;
use Doctrine\ORM\Query\Expr\Join;
Function buildSearchQuery
has a Cognitive Complexity of 174 (exceeds 5 allowed). Consider refactoring. Open
private function buildSearchQuery($ViewType = TblWorkSpace::VIEW_TYPE_ALL, $SqlReturn = false)
{
$Binding = Individual::useService()->getBinding();
$Manager = $Binding->getEntityManager();
$Builder = $Manager->getQueryBuilder();
- 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 getNavigation
has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring. Open
public function getNavigation($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
// remove every entry that is already chosen
$WorkSpaceList = 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
Method getNavigation
has 234 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getNavigation($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
// remove every entry that is already chosen
$WorkSpaceList = array();
ApiIndividual
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class ApiIndividual extends IndividualReceiver implements IApiInterface, IModuleInterface
{
// Schränkt die Auswahl der Filterung auf "like" und "not like" ein
private $reducedSelectBoxList = array(
Method buildSearchQuery
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildSearchQuery($ViewType = TblWorkSpace::VIEW_TYPE_ALL, $SqlReturn = false)
{
$Binding = Individual::useService()->getBinding();
$Manager = $Binding->getEntityManager();
$Builder = $Manager->getQueryBuilder();
Function getFilter
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function getFilter($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblWorkSpaceList = Individual::useService()->getWorkSpaceAll($ViewType);
$LayoutColumnAll = 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
Method getFilter
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFilter($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblWorkSpaceList = Individual::useService()->getWorkSpaceAll($ViewType);
$LayoutColumnAll = array();
Function getPanelList
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function getPanelList(AbstractView $View, $WorkSpaceList, $ViewType)
{
$PanelString = '';
$ViewBlockList = 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 moveFieldRight
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function moveFieldRight($WorkSpaceId = null, $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblWorkSpace = Individual::useService()->getWorkSpaceById($WorkSpaceId);
if ($tblWorkSpace) {
- 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 moveFieldLeft
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function moveFieldLeft($WorkSpaceId = null, $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblWorkSpace = Individual::useService()->getWorkSpaceById($WorkSpaceId);
if ($tblWorkSpace) {
- 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 pipelineNavigation
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static function pipelineNavigation($isLoadFilter = true, $ViewType = TblWorkSpace::VIEW_TYPE_ALL, $PresetId = null)
{
$Pipeline = new Pipeline();
$Emitter = new ServerEmitter(self::receiverNavigation(), self::getEndpoint());
- 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 createPreset
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function createPreset($PresetName, $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblWorkSpaceList = Individual::useService()->getWorkSpaceAll($ViewType);
if ($tblWorkSpaceList && $PresetName) {
- 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 getBehaviorRadioBox
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getBehaviorRadioBox($RadioBoxName)
{
$RadioBoxList = array();
foreach($this->reducedSelectBoxList as &$reducedSelectBox){
Method getModalPreset
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getModalPreset($Info = '', $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblPresetList = Individual::useService()->getPresetAll();
$TableContent = array();
Method getModalSavePreset
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getModalSavePreset($Info = '', $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$Global = $this->getGlobal();
$Post = $Global->POST;
Method setInitialView
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setInitialView(QueryBuilder $Builder, $ViewType, &$ViewList = array(), &$ParameterList = array())
{
switch ($ViewType) {
case TblWorkSpace::VIEW_TYPE_STUDENT:
$viewGroup = new ViewGroup();
Function deletePreset
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function deletePreset($PresetId = null, $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblPreset = Individual::useService()->getPresetById($PresetId);
if ($tblPreset) {
- 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 pipelineDisplayFilter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function pipelineDisplayFilter($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$Pipeline = new Pipeline(false);
$Emitter = new ServerEmitter(self::receiverFilter(), self::getEndpoint());
$Emitter->setGetPayload(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 getDownloadForm
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function getDownloadForm($ViewType = TblWorkSpace::VIEW_TYPE_ALL) {
$tblAccount = Account::useService()->getAccountBySession();
if(!empty($tblAccount)) {
$tblWorkspaceAll = Individual::useService()->getWorkSpaceAllByAccount($tblAccount, $ViewType);
if (!empty($tblWorkspaceAll)) {
- 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 getSearchResult
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSearchResult($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
// return $this->buildSearchQuery($ViewType, true);
$Query = $this->buildSearchQuery($ViewType);
Method pipelineAddField
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pipelineAddField($Field, $View, $ViewType)
{
$Pipeline = new Pipeline();
$Emitter = new ServerEmitter(self::receiverService(), self::getEndpoint());
Method getPanelList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPanelList(AbstractView $View, $WorkSpaceList, $ViewType)
{
$PanelString = '';
$ViewBlockList = array();
Method pipelineNavigation
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pipelineNavigation($isLoadFilter = true, $ViewType = TblWorkSpace::VIEW_TYPE_ALL, $PresetId = null)
{
$Pipeline = new Pipeline();
$Emitter = new ServerEmitter(self::receiverNavigation(), self::getEndpoint());
Method pipelineMoveFilterField
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pipelineMoveFilterField($WorkSpaceId = null, $direction = '', $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$Pipeline = new Pipeline();
if ($direction == 'left') {
Method pipelineDeleteFilterField
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pipelineDeleteFilterField($WorkSpaceId = null, $ViewType = TblWorkSpace::VIEW_TYPE_STUDENT)
{
$Pipeline = new Pipeline();
$Emitter = new ServerEmitter(self::receiverService(), self::getEndpoint());
Method buildExcelFile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildExcelFile($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$Query = $this->buildSearchQuery($ViewType);
$Result = $Query->getResult();
Method pipelineDelete
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pipelineDelete($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$Pipeline = new Pipeline();
$Emitter = new ServerEmitter(self::receiverService(), self::getEndpoint());
Method getDownloadForm
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getDownloadForm($ViewType = TblWorkSpace::VIEW_TYPE_ALL) {
$tblAccount = Account::useService()->getAccountBySession();
if(!empty($tblAccount)) {
$tblWorkspaceAll = Individual::useService()->getWorkSpaceAllByAccount($tblAccount, $ViewType);
if (!empty($tblWorkspaceAll)) {
Function buildExcelFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function buildExcelFile($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$Query = $this->buildSearchQuery($ViewType);
$Result = $Query->getResult();
- 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 createPreset
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createPreset($PresetName, $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblWorkSpaceList = Individual::useService()->getWorkSpaceAll($ViewType);
if ($tblWorkSpaceList && $PresetName) {
Function getSearchResult
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchResult($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
// return $this->buildSearchQuery($ViewType, true);
$Query = $this->buildSearchQuery($ViewType);
- 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 chooseBehaviorMultiExpression
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function chooseBehaviorMultiExpression(QueryBuilder &$Builder, $View, $Field, $Value, $Parameter, &$ParameterList, $Behavior)
Method chooseBehavior
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function chooseBehavior(QueryBuilder &$Builder, $View, $Field, $Value, $Parameter, &$ParameterList, $Behavior)
Avoid deeply nested control flow statements. Open
if($Behavior == 1){
$OrExp->add( $Builder->expr()->eq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
$Parameter));
} elseif($Behavior == 2) {
$OrExp->add( $Builder->expr()->neq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
Avoid deeply nested control flow statements. Open
if(($YearList = Term::useService()->getYearByNow())){
$tblYear = current($YearList);
// Speichern im Post
$PostArray['TblYear_Year[1]'] = $tblYear->getName();
}
Function getRealNameByViewType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getRealNameByViewType($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
switch($ViewType){
case TblWorkSpace::VIEW_TYPE_ALL :
$Name = 'Allgemein';
- 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(in_array($tblWorkSpace->getField(), $this->reducedSelectBoxList)) {
// Add AND Condition to Where (if filter is set)
if($Behavior == 1){
$Builder->andWhere(
$Builder->expr()->eq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
Avoid deeply nested control flow statements. Open
if($Behavior == 1){
$OrExp = $Builder->expr()->orX(
$Builder->expr()->eq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
$Parameter));
} elseif($Behavior == 2) {
Avoid deeply nested control flow statements. Open
if(in_array($tblWorkSpace->getField(), $this->reducedSelectBoxList)) {
// Add AND Condition to Where (if filter is set)
if($Value === '' && $Behavior == 1){
$Builder->andWhere(
$Builder->expr()->like($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
Function changeFilterCount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function changeFilterCount($WorkSpaceId = null, $direction = '')
{
$tblWorkSpace = Individual::useService()->getWorkSpaceById($WorkSpaceId);
if ($tblWorkSpace) {
$FieldCount = $tblWorkSpace->getFieldCount();
- 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 pipelineAddField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function pipelineAddField($Field, $View, $ViewType)
{
$Pipeline = new Pipeline();
$Emitter = new ServerEmitter(self::receiverService(), self::getEndpoint());
- 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 addField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addField($Field, $View, $ViewType)
{
$Position = 1;
$tblWorkSpaceList = Individual::useService()->getWorkSpaceAll($ViewType);
- 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 loadPreset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function loadPreset($PresetId = null, $ViewType = TblWorkSpace::VIEW_TYPE_ALL)
{
$tblPreset = Individual::useService()->getPresetById($PresetId);
if ($tblPreset) {
- 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 setInitialView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function setInitialView(QueryBuilder $Builder, $ViewType, &$ViewList = array(), &$ParameterList = array())
{
switch ($ViewType) {
case TblWorkSpace::VIEW_TYPE_STUDENT:
$viewGroup = new ViewGroup();
- 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 4 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_ALL:
$Block = $this->getPanelList(new ViewGroup(), $WorkSpaceList, TblWorkSpace::VIEW_TYPE_ALL);
if( !empty( $Block ) ) {
if( isset($ViewList['ViewGroup']) ) {
$AccordionList[] = new Panel( 'Gruppe:', new Scrollable( $Block, 110 ));
- 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 320.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_CLUB:
$Block = $this->getPanelList(new ViewPerson(), $WorkSpaceList, TblWorkSpace::VIEW_TYPE_CLUB);
if( !empty( $Block ) ) {
if( isset($ViewList['ViewPerson']) ) {
$AccordionList[] = new Panel( 'Person:', new Scrollable( $Block, 300 ));
- 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 320.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_CUSTODY:
$Block = $this->getPanelList(new ViewPerson(), $WorkSpaceList, TblWorkSpace::VIEW_TYPE_CUSTODY);
if( !empty( $Block ) ) {
if( isset($ViewList['ViewPerson']) ) {
$AccordionList[] = new Panel( 'Person:', new Scrollable( $Block, 300 ));
- 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 320.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_TEACHER:
$Block = $this->getPanelList(new ViewPerson(), $WorkSpaceList, TblWorkSpace::VIEW_TYPE_TEACHER);
if( !empty( $Block ) ) {
if( isset($ViewList['ViewPerson']) ) {
$AccordionList[] = new Panel( 'Person:', new Scrollable( $Block, 300 ));
- 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 320.
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 4 locations. Consider refactoring. Open
foreach ((array)$Exception->getTrace() as $Trace) {
$TraceList .= nl2br('<samp class="text-info small">'
.( isset( $Trace['type'] ) && isset( $Trace['function'] ) ? 'Method: '.$Trace['type'].$Trace['function'] : 'Method: ' )
.( isset( $Trace['class'] ) ? '<br/>Class: '.$Trace['class'] : '<br/>Class: ' )
.( isset( $Trace['file'] ) ? '<br/>File: '.$Trace['file'] : '<br/>File: ' )
- 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 143.
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 5 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_PROSPECT:
$viewGroup = new ViewGroup();
$Parameter = ':Filter'.'Initial'.'Value'.'MetaTable';
$Builder->from($viewGroup->getEntityFullName(),
$viewGroup->getViewObjectName());
- 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 5 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_STUDENT:
$viewGroup = new ViewGroup();
$Parameter = ':Filter'.'Initial'.'Value'.'MetaTable';
$Builder->from($viewGroup->getEntityFullName(),
$viewGroup->getViewObjectName());
- 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 5 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_TEACHER:
$viewGroup = new ViewGroup();
$Parameter = ':Filter'.'Initial'.'Value'.'MetaTable';
$Builder->from($viewGroup->getEntityFullName(),
$viewGroup->getViewObjectName());
- 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 5 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_CUSTODY:
$viewGroup = new ViewGroup();
$Parameter = ':Filter'.'Initial'.'Value'.'MetaTable';
$Builder->from($viewGroup->getEntityFullName(),
$viewGroup->getViewObjectName() );
- 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 5 locations. Consider refactoring. Open
case TblWorkSpace::VIEW_TYPE_CLUB:
$viewGroup = new ViewGroup();
$Parameter = ':Filter'.'Initial'.'Value'.'MetaTable';
$Builder->from($viewGroup->getEntityFullName(),
$viewGroup->getViewObjectName());
- 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(in_array($tblWorkSpace->getField(), $this->reducedSelectBoxList)) {
// Add AND Condition to Where (if filter is set)
if($Behavior == 1){
$Builder->andWhere(
$Builder->expr()->eq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
- 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 99.
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(in_array($tblWorkSpace->getField(), $this->reducedSelectBoxList)) {
// Add AND Condition to Where (if filter is set)
if($Behavior == 1){
$OrExp->add( $Builder->expr()->eq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
$Parameter));
- 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 99.
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
private function decodeField($Name) {
$DecoderPattern = array(
'!_aE_!s' => 'ä',
'!_oE_!s' => 'ö',
'!_uE_!s' => 'ü',
- 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 96.
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
private function encodeField($Name) {
$EncoderPattern = array(
'!ä!s' => '_aE_',
'!ö!s' => '_oE_',
'!ü!s' => '_uE_',
- 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 96.
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($ViewType === TblWorkSpace::VIEW_TYPE_STUDENT){
if(($tblWorkSpaceList = Individual::useService()->getWorkSpaceAll($ViewType))){
foreach($tblWorkSpaceList as $tblWorkSpace){
// aktuelles Schuljahr finden
if($tblWorkSpace->getField() === 'TblYear_Year'){
- 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 93.
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($ViewType === TblWorkSpace::VIEW_TYPE_STUDENT){
if(($tblWorkSpaceList = Individual::useService()->getWorkSpaceAll($ViewType))){
foreach($tblWorkSpaceList as $tblWorkSpace){
// aktuelles Schuljahr finden
if($tblWorkSpace->getField() === 'TblYear_Year'){
- 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 93.
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