DerDu/SPHERE-Framework

View on GitHub
Application/Billing/Inventory/Item/Service.php

Summary

Maintainability
C
1 day
Test Coverage

Service has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

class Service extends AbstractService
{

    /**
     * @param bool $doSimulation
Severity: Minor
Found in Application/Billing/Inventory/Item/Service.php - About 4 hrs to fix

    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))){
    Severity: Minor
    Found in Application/Billing/Inventory/Item/Service.php - About 1 hr to fix

    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);
    Severity: Minor
    Found in Application/Billing/Inventory/Item/Service.php - About 1 hr to fix

    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);
    Severity: Minor
    Found in Application/Billing/Inventory/Item/Service.php - About 1 hr to fix

    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')
    Severity: Major
    Found in Application/Billing/Inventory/Item/Service.php - About 1 hr to fix

      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')
      Severity: Major
      Found in Application/Billing/Inventory/Item/Service.php - About 1 hr to fix

        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))){
        Severity: Minor
        Found in Application/Billing/Inventory/Item/Service.php - About 25 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status