File Service.php
has 716 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace SPHERE\Application\Billing\Bookkeeping\Invoice;
use MOC\V\Component\Document\Component\Bridge\Repository\PhpExcel;
Method createInvoice
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createInvoice(TblBasket $tblBasket)
{
/** Shopping Content */
$tblBasketVerificationList = Basket::useService()->getBasketVerificationAllByBasket($tblBasket);
if(!$tblBasketVerificationList){
Function createInvoiceDebtorListExcel
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function createInvoiceDebtorListExcel(
$Year,
$Month,
$BasketName
) {
- 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 getInvoiceByPersonCauserAndItemAndYearAndMonth
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function getInvoiceByPersonCauserAndItemAndYearAndMonth(
TblPerson $tblPerson,
TblItem $tblItem,
$Year,
$Month
- 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 createInvoiceDebtorListExcel
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createInvoiceDebtorListExcel(
$Year,
$Month,
$BasketName
) {
Service
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Service extends AbstractService
{
/**
* @param bool $doSimulation
Method getInvoiceCauserList
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInvoiceCauserList(
$Year,
$Month,
$BasketName,
$ItemName,
Method getInvoiceDebtorList
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInvoiceDebtorList(
$Year,
$Month,
$BasketName,
$IsFrontend
Method getInvoiceUpPaidList
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInvoiceUpPaidList()
{
$TableContent = array();
if($tblInvoiceItemDebtorList = Invoice::useService()->getInvoiceItemDebtorByIsPaid()){
Method createInvoiceUpPaidListExcel
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createInvoiceUpPaidListExcel() {
$resultList = $this->getInvoiceUpPaidList();
if(!empty($resultList)){
$fileLocation = Storage::createFilePointer('xlsx');
/** @var PhpExcel $export */
Method createInvoiceCauserListExcel
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createInvoiceCauserListExcel(
$Year,
$Month,
$BasketName,
$ItemName
Function createInvoice
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function createInvoice(TblBasket $tblBasket)
{
/** Shopping Content */
$tblBasketVerificationList = Basket::useService()->getBasketVerificationAllByBasket($tblBasket);
if(!$tblBasketVerificationList){
- 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($tblInvoiceItem->getId() == $tblItem->getId()){
$isInvoice = true;
}
Method getInvoiceCauserList
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$Year,
$Month,
$BasketName,
$ItemName,
$IsFrontend
Function getMonthList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getMonthList($From = null, $To = null)
{
$MonthList[1] = 'Januar';
$MonthList[2] = 'Februar';
- 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"