HaaseIT/HCSF

View on GitHub

Showing 138 of 151 total issues

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

        Items $oItem,
        $aPossibleSuggestions,
        $sSetSuggestions,
        $sCurrentitem,
        $mItemindex,
Severity: Minor
Found in src/Shop/Helper.php - About 45 mins to fix

    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/Verifyemail.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 getShippingcost has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getShippingcost()
        {
            $fShippingcost = $this->shop['shippingcoststandardrate'];
    
            $sCountry = $this->helperCustomer->getDefaultCountryByConfig($this->config->getLang());
    Severity: Minor
    Found in src/Shop/Helper.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 mailWrapper has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function mailWrapper($to, $subject = '(No subject)', $message = '', $aImagesToEmbed = [], $aFilesToAttach = []) {
    Severity: Minor
    Found in src/Helper.php - About 35 mins to fix

      Function refreshCartItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function refreshCartItems(ServiceManager $serviceManager) // bei login/logout ändern sich ggf die preise, shoppingcart neu berechnen
          {
              if (isset($_SESSION['cart']) && is_array($_SESSION['cart'])) {
                  foreach ($_SESSION['cart'] as $sKey => $aValue) {
                      $sItemkey = $sKey;
      Severity: Minor
      Found in src/Shop/Helper.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 addAdditionalCostsToItems has a Cognitive Complexity of 7 (exceeds 5 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: Minor
      Found in src/Shop/Helper.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 getPurifier has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getPurifier($purpose)
          {
              $purifier_config = \HTMLPurifier_Config::createDefault();
              $purifier_config->set('Core.Encoding', 'UTF-8');
              $purifier_config->set('Cache.SerializerPath', PATH_PURIFIERCACHE);
      Severity: Minor
      Found in src/Helper.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

      Avoid too many return statements within this method.
      Open

                      return false;
      Severity: Major
      Found in src/Customer/Helper.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $router->getPage();
        Severity: Major
        Found in src/HCSF.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return true;
          Severity: Major
          Found in src/HCSF.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return false;
            Severity: Major
            Found in src/Controller/Customer/Login.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $this->setupHardcodedTextcats();
              Severity: Major
              Found in src/HCSF.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return null;
                Severity: Major
                Found in src/HCSF.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return new \HaaseIT\HCSF\Shop\Items($serviceManager);
                  Severity: Major
                  Found in src/HCSF.php - About 30 mins to fix

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

                        private function replyToCartUpdate($sReply, $aMore = []) {
                            if (filter_input(INPUT_GET, 'ajax') !== null) {
                                $aAR = [
                                    'cart' => $_SESSION['cart'],
                                    'reply' => $sReply,
                    Severity: Minor
                    Found in src/Controller/Shop/Updatecart.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

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

                        public function getShoppingcartData()
                        {
                            $aCartinfo = [
                                'numberofitems' => 0,
                                'cartsums' => [],
                    Severity: Minor
                    Found in src/Shop/Helper.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

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

                        private function prepareItem($aItemdata)
                        {
                            $aData = [
                                'form' => ['action' => Tools::makeLinkHRefWithAddedGetVars('/_admin/itemadmin.html', ['action' => 'showitem', 'itemno' => $aItemdata['base']['itm_no']]),],
                                'id' => $aItemdata['base']['itm_id'],
                    Severity: Minor
                    Found in src/Controller/Admin/Shop/Itemadmin.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

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

                        public function getSignedGlideURL($file, $width = 0, $height = 0)
                        {
                            $urlBuilder = \League\Glide\Urls\UrlBuilderFactory::create('', $this->secrets['glide_signkey']);
                    
                            $param = [];
                    Severity: Minor
                    Found in src/Helper.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

                    Severity
                    Category
                    Status
                    Source
                    Language