HaaseIT/HCSF

View on GitHub

Showing 138 of 151 total issues

Method getItem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getItem($sItemno = '')
    {
        if ($sItemno === '') {
            $sItemno = filter_input(INPUT_GET, 'itemno', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
            if (empty($sItemno)) {
Severity: Minor
Found in src/Controller/Admin/Shop/Itemadmin.php - About 1 hr to fix

    Function init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function init()
        {
            $this->serviceManager = new ServiceManager();
    
            if (!CLI) {
    Severity: Minor
    Found in src/HCSF.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 preparePage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function preparePage()
        {
            $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager, [], 'admin/base.twig');
            $this->P->cb_pagetype = 'content';
            $this->P->cb_subnav = 'admin';
    Severity: Minor
    Found in src/Controller/Admin/Pageadmin.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 getRoutingoverride has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        private function getRoutingoverride($aPath)
        {
            $aRoutingoverride = [];
            // /xxxx/item/0010.html
            $aTMP['parts_in_path'] = count($aPath);
    Severity: Minor
    Found in src/Router.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 requireAdminAuth has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function requireAdminAuth() {
    
            $adminusers = $this->config->getSecret('admin_users');
            if ($this->requireAdminAuthAdminHome && (empty($adminusers) || !count($adminusers))) {
                return true;
    Severity: Minor
    Found in src/Controller/Base.php - About 1 hr to fix

      Method preparePage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function preparePage()
          {
              $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager, [], 'admin/base.twig');
              $this->P->cb_pagetype = 'content';
              $this->P->cb_subnav = 'admin';
      Severity: Minor
      Found in src/Controller/Admin/Index.php - About 1 hr to fix

        Method preparePage has 26 lines of code (exceeds 25 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/Sofortueberweisung.php - About 1 hr to fix

          Method getShoppingcartData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getShoppingcartData()
              {
                  $aCartinfo = [
                      'numberofitems' => 0,
                      'cartsums' => [],
          Severity: Minor
          Found in src/Shop/Helper.php - About 1 hr to fix

            Method sendCheckoutMails has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function sendCheckoutMails($iInsertID, $sMailbody_us, $sMailbody_they)
                {
                    $aFilesToSend = [];
                    if (
                        !empty($this->config->getShop('email_orderconfirmation_attachment_cancellationform_'.$this->config->getLang()))
            Severity: Minor
            Found in src/Controller/Shop/Shoppingcart.php - About 1 hr to fix

              Method prepareItemlistsearchform has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function prepareItemlistsearchform()
                  {
                      $aData = [
                          'searchcats' => [
                              'nummer|'.$this->hardcodedtextcats->get('itemadmin_search_itemno'),
              Severity: Minor
              Found in src/Controller/Admin/Shop/Itemadmin.php - About 1 hr to fix

                Method buildShoppingCartTable has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function buildShoppingCartTable(array $aCart, $bReadonly = false, $sCustomergroup = '', $aErr = [], $iVATfull = '', $iVATreduced = '')
                    {
                        if ($iVATfull === '' && $iVATreduced === '') {
                            $iVATfull = $this->shop['vat']['full'];
                            $iVATreduced = $this->shop['vat']['reduced'];
                Severity: Minor
                Found in src/Shop/Helper.php - About 1 hr to fix

                  Method handlePasswordReset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function handlePasswordReset($aErr, $iID) {
                          $postpwd = filter_input(INPUT_POST, 'pwd');
                          if (!empty($postpwd)) {
                              if (strlen($postpwd) < $this->config->getCustomer('minimum_length_password')) {
                                  $aErr[] = 'pwlength';
                  Severity: Minor
                  Found in src/Controller/Customer/Resetpassword.php - About 1 hr to fix

                    Method getItemPathTree has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getItemPathTree()
                        {
                            $itemindexpathtree = [];
                            $aItemoverviewpages = [];
                            $sql = "SELECT * FROM content_base WHERE cb_pagetype = 'itemoverview' OR cb_pagetype = 'itemoverviewgrpd'";
                    Severity: Minor
                    Found in src/Shop/Items.php - About 1 hr to fix

                      Function handleForgotPassword has a Cognitive Complexity of 9 (exceeds 5 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 55 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 getItemlist has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function getItemlist()
                          {
                              $sSearchstring = filter_input(INPUT_GET, 'searchstring', FILTER_SANITIZE_SPECIAL_CHARS);
                              $sSearchstring = str_replace('*', '%', $sSearchstring);
                      
                      
                      Severity: Minor
                      Found in src/Controller/Admin/Shop/Itemadmin.php - About 55 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 getItemImage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function getItemImage($aV)
                          {
                              // base64 encode img and prepare for db
                              // image/png image/jpeg image/gif
                              // data:{mimetype};base64,XXXX
                      Severity: Minor
                      Found in src/Controller/Shop/Shoppingcart.php - About 55 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 preparePage has a Cognitive Complexity of 8 (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/Forgotpassword.php - About 45 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 queryItem has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function queryItem($mItemIndex = '', $mItemno = '', $sOrderby = '')
                          {
                              $sql = 'SELECT '.DB_ITEMFIELDS.' FROM item_base';
                              $sql .= ' LEFT OUTER JOIN item_lang ON item_base.itm_id = item_lang.itml_pid AND itml_lang = :lang';
                              $sql .= $this->queryItemWhereClause($mItemIndex, $mItemno);
                      Severity: Minor
                      Found in src/Shop/Items.php - About 45 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

                      Method buildShoppingCartTable has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function buildShoppingCartTable(array $aCart, $bReadonly = false, $sCustomergroup = '', $aErr = [], $iVATfull = '', $iVATreduced = '')
                      Severity: Minor
                      Found in src/Shop/Helper.php - About 45 mins to fix

                        Function showPageselect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function showPageselect() {
                                $aGroups = [];
                                $adminpagegroups = $this->config->getCore('admin_page_groups');
                                foreach ($adminpagegroups as $sValue) {
                                    $TMP = explode('|', $sValue);
                        Severity: Minor
                        Found in src/Controller/Admin/Pageadmin.php - About 45 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

                        Severity
                        Category
                        Status
                        Source
                        Language