DerDu/SPHERE-Framework

View on GitHub
Application/Billing/Inventory/Import/ImportGateway.php

Summary

Maintainability
D
2 days
Test Coverage

Method runConvert has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function runConvert($Row)
    {

        $Result = array();
        foreach ($Row as $Part) {
Severity: Major
Found in Application/Billing/Inventory/Import/ImportGateway.php - About 4 hrs to fix

    File ImportGateway.php has 332 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Import Fakturierung. Reihenfolge der Felder aus der xlsx-Datei *.xlsx
     * wird Dynamisch ausgelesen (Erfolgt in Control)
     */
    Severity: Minor
    Found in Application/Billing/Inventory/Import/ImportGateway.php - About 4 hrs to fix

      Function runConvert has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          public function runConvert($Row)
          {
      
              $Result = array();
              foreach ($Row as $Part) {
      Severity: Minor
      Found in Application/Billing/Inventory/Import/ImportGateway.php - About 3 hrs 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 __construct has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct($File, ImportControl $Control, $Item = '')
          {
              $this->loadFile($File);
              $this->ItemName = $Item;
      
      
      Severity: Minor
      Found in Application/Billing/Inventory/Import/ImportGateway.php - About 2 hrs to fix

        Function getPerson has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getPerson($FirstName, $LastName, $Birthday = '', TblPerson $tblPersonStudent = null)
            {
        
                $tblPersonList = array();
                if ($Birthday){
        Severity: Minor
        Found in Application/Billing/Inventory/Import/ImportGateway.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 sanitizeIBANFrontend has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function sanitizeIBANFrontend($Value)
            {
                $iban = strtoupper(str_replace(' ', '', $Value));
                // Todo Wie gehen wir mit fehlerwerten um?
                if (preg_match('!(DE)([0-9]){20}!is', $iban, $Match)){
        Severity: Minor
        Found in Application/Billing/Inventory/Import/ImportGateway.php - About 35 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

        Function sanitizeDebtorNumber has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function sanitizeDebtorNumber($Value)
            {
        
                if(($Setting = Setting::useService()->getSettingByIdentifier(TblSetting::IDENT_DEBTOR_NUMBER_COUNT))){
                    if(strlen($Value) > $Setting->getValue()){
        Severity: Minor
        Found in Application/Billing/Inventory/Import/ImportGateway.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