Service
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Service extends AbstractService
{
/**
* @param bool $doSimulation
Function getItemAllByPerson
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getItemAllByPerson(TblPerson $tblPerson)
{
$ItemList = array();
if(($tblGroupList = Group::useService()->getGroupAllByPerson($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
Function getItemCalculationByDate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getItemCalculationByDate(TblItemVariant $tblItemVariant, \DateTime $Date)
{
$tblItemCalculationActive = false;
$tblItemCalculationList = (new Data($this->getBinding()))->getItemCalculationByItemVariant($tblItemVariant);
- 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 getItemCalculationNowByItemVariant
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getItemCalculationNowByItemVariant(TblItemVariant $tblItemVariant, $Date = 'now')
{
$tblItemCalculationActive = false;
$tblItemCalculationList = (new Data($this->getBinding()))->getItemCalculationByItemVariant($tblItemVariant);
- 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 changeItem
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public function changeItem(TblItem $tblItem, $ItemName, $Description = '', $SepaRemark = '', $DatevRemark = '',
$FibuAccount = '', $FibuToAccount = '', $Kost1 = '0', $Kost2 = '0', $BuKey = '0')
Method createItem
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createItem($ItemName, $Description = '', $SepaRemark = '', $DatevRemark = '', $FibuAccount = ''
, $FibuToAccount = '', $Kost1 = '0', $Kost2 = '0', $BuKey = '0')
Function removeItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function removeItem(TblItem $tblItem)
{
// remove tblItemGroup
if(($tblItemGroupPersonList = $this->getItemGroupByItem($tblItem))){
- 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"