HaaseIT/HCSF

View on GitHub

Showing 138 of 151 total issues

Method addAdditionalCostsToItems has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addAdditionalCostsToItems($aSumme, $iVATfull, $iVATreduced)
    {
        $fGesamtnetto = $aSumme['sumvoll'] + $aSumme['sumerm'];
        $fSteuervoll = $aSumme['sumvoll'] * $iVATfull / 100;
        $fSteuererm = $aSumme['sumerm'] * $iVATreduced / 100;
Severity: Major
Found in src/Shop/Helper.php - About 2 hrs to fix

    Method validateCustomerForm has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function validateCustomerForm($sLang, $aErr = [], $bEdit = false)
        {
            if (empty(filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL))) {
                $aErr['email'] = true;
            }
    Severity: Major
    Found in src/Customer/Helper.php - About 2 hrs to fix

      Method updateGroup has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function updateGroup()
          {
              $purifier = false;
              if ($this->config->getShop('itemgrouptext_enable_purifier')) {
                  $purifier = $this->helper->getPurifier('itemgroup');
      Severity: Major
      Found in src/Controller/Admin/Shop/Itemgroupadmin.php - About 2 hrs to fix

        Function preparePage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public function preparePage()
            {
                $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
                $this->P->cb_pagetype = 'content';
        
        
        Severity: Minor
        Found in src/Controller/Customer/Register.php - About 2 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

        Function loadNavigation has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public function loadNavigation(ServiceManager $serviceManager)
            {
                if (is_file(PATH_BASEDIR.'config/navigation.yml')) {
                    $navstruct = Yaml::parse(file_get_contents(PATH_BASEDIR.'config/navigation.yml'));
                } else {
        Severity: Minor
        Found in src/HelperConfig.php - About 2 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 init has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function init()
            {
                $this->serviceManager = new ServiceManager();
        
                if (!CLI) {
        Severity: Major
        Found in src/HCSF.php - About 2 hrs to fix

          Method updateItem has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function updateItem()
              {
                  $purifier = false;
                  if ($this->config->getShop('itemtext_enable_purifier')) {
                      $purifier = $this->helper->getPurifier('item');
          Severity: Major
          Found in src/Controller/Admin/Shop/Itemadmin.php - About 2 hrs to fix

            Function removeDataWhere has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public function removeDataWhere($field, $needle, $fieldtoremove)
                {
                    foreach ($this->items as $key => $item) {
                        if (!empty($item['itm_data']->$field)) {
                            if ($needle) {
            Severity: Minor
            Found in src/Controller/CLI/Itemdata.php - About 2 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

            Function queryItemWhereClause has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public function queryItemWhereClause($mItemIndex = '', $mItemno = '')
                {
                    $sql = ' WHERE ';
                    $getsearchtext = filter_input(INPUT_GET, 'searchtext', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
                    if (!empty($mItemno)) {
            Severity: Minor
            Found in src/Shop/Items.php - About 2 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

            Function getLanguage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getLanguage()
                {
                    $langavailable = $this->core['lang_available'];
                    if (
                        $this->core['lang_detection_method'] === 'domain'
            Severity: Minor
            Found in src/HelperConfig.php - About 2 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

            Function getLogin has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                private function getLogin()
                {
                    $bTryEmail = false;
                    if ('cust_no' !== 'cust_email') {
                        $bTryEmail = true;
            Severity: Minor
            Found in src/Controller/Customer/Login.php - About 2 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

            Function handleEditPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function handleEditPage()
                {
                    $requestpagekey = filter_input(INPUT_GET, 'page_key', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
                    if ($requestpagekey !== null && $Ptoedit = new UserPage($this->serviceManager, $requestpagekey, true)) {
                        if (filter_input(INPUT_POST, 'action_a') === 'true') {
            Severity: Minor
            Found in src/Controller/Admin/Pageadmin.php - About 2 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

            Function preparePage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public function preparePage()
                {
                    $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
                    $this->P->cb_pagetype = 'content';
            
            
            Severity: Minor
            Found in src/Controller/Shop/Myorders.php - About 2 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 handleEditPage has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function handleEditPage()
                {
                    $requestpagekey = filter_input(INPUT_GET, 'page_key', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
                    if ($requestpagekey !== null && $Ptoedit = new UserPage($this->serviceManager, $requestpagekey, true)) {
                        if (filter_input(INPUT_POST, 'action_a') === 'true') {
            Severity: Major
            Found in src/Controller/Admin/Pageadmin.php - About 2 hrs to fix

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

                  private function showMyOrders($COList)
                  {
                      $return = '';
                      $sql = 'SELECT * FROM orders WHERE o_custno = :custno ORDER BY o_ordertimestamp DESC';
              
              
              Severity: Minor
              Found in src/Controller/Shop/Myorders.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 handleItemPage has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function handleItemPage(ServiceManager $serviceManager, \HaaseIT\HCSF\Page $P, array $aP)
                  {
                      $mItemIndex = '';
                      if (isset($P->cb_pageconfig->itemindex)) {
                          $mItemIndex = $P->cb_pageconfig->itemindex;
              Severity: Minor
              Found in src/Shop/Helper.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 getLogin has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function getLogin()
                  {
                      $bTryEmail = false;
                      if ('cust_no' !== 'cust_email') {
                          $bTryEmail = true;
              Severity: Minor
              Found in src/Controller/Customer/Login.php - About 1 hr to fix

                Method handleForgotPassword has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function handleForgotPassword($aErr) {
                        if (!filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL)) {
                            $aErr[] = 'emailinvalid';
                        } else {
                            $querybuilder = $this->dbal->createQueryBuilder();
                Severity: Minor
                Found in src/Controller/Customer/Forgotpassword.php - About 1 hr to fix

                  Method calcPrice has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function calcPrice($aData)
                      {
                          $aPrice = [];
                          if ($aData['itm_vatid'] !== 'reduced') {
                              $aData['itm_vatid'] = 'full';
                  Severity: Minor
                  Found in src/Shop/Items.php - About 1 hr to fix

                    Method buildOrderMailBody has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function buildOrderMailBody($bCust = true, $iId)
                        {
                            $aM = [
                                'customdata' => $this->helperShop->buildShoppingCartTable($_SESSION['cart'], true),
                                'currency' => $this->config->getShop('waehrungssymbol'),
                    Severity: Minor
                    Found in src/Controller/Shop/Shoppingcart.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language