HaaseIT/HCSF

View on GitHub

Showing 138 of 151 total issues

Method __construct has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(ServiceManager $serviceManager, $iParentID, $bReturnRaw = false, UserPage $basePage = null) {
        parent::__construct($serviceManager);

        $this->dbal = $this->serviceManager->get('dbal');

Severity: Minor
Found in src/UserPagePayload.php - About 1 hr to fix

    Method fillSuggestions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function fillSuggestions($suggestions)
        {
            $iNumberOfSuggestions = count($suggestions['default']);
            if ($iNumberOfSuggestions > $this->shop['itemdetail_suggestions']) { // if there are more suggestions than should be displayed, randomly pick as many as to be shown
                $aKeysSuggestions = array_rand($suggestions['default'], $this->shop['itemdetail_suggestions']); // get the array keys that will stay
    Severity: Minor
    Found in src/Shop/Helper.php - About 1 hr to fix

      Method getNotification has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getNotification()
          {
              $return = '';
              $getmsg = filter_input(INPUT_GET, 'msg');
              $getcartkey = filter_input(INPUT_GET, 'cartkey', FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
      Severity: Minor
      Found in src/Controller/Shop/Shoppingcart.php - About 1 hr to fix

        Method updatePage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function updatePage(UserPage $Ptoedit)
            {
                $purifier = false;
                if ($this->config->getCore('pagetext_enable_purifier')) {
                    $purifier = $this->helper->getPurifier('page');
        Severity: Minor
        Found in src/Controller/Admin/Pageadmin.php - About 1 hr to fix

          Function preparePage has a Cognitive Complexity of 11 (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/Login.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 addDataWhere has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public function addDataWhere($field, $needle, $newfield, $content)
              {
                  foreach ($this->items as $key => $item) {
                      if ($needle !== false) {
                          if (!empty($item['itm_data']->$field) && $item['itm_data']->$field == $needle) {
          Severity: Minor
          Found in src/Controller/CLI/Itemdata.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 handlePasswordReset has a Cognitive Complexity of 11 (exceeds 5 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

          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 __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct(ServiceManager $serviceManager, $sPagekey, $bReturnRaw = false)
              {
                  //if (!$bReturnRaw) $this->container = $container;
                  $this->serviceManager = $serviceManager;
                  $this->status = 200;
          Severity: Minor
          Found in src/UserPage.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 getLanguage has 31 lines of code (exceeds 25 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 1 hr to fix

            Method queryItemWhereClause has 31 lines of code (exceeds 25 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 1 hr to fix

              Method handleItemPage has 30 lines of code (exceeds 25 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

                Method __construct has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function __construct(ServiceManager $serviceManager, $sPagekey, $bReturnRaw = false)
                    {
                        //if (!$bReturnRaw) $this->container = $container;
                        $this->serviceManager = $serviceManager;
                        $this->status = 200;
                Severity: Minor
                Found in src/UserPage.php - About 1 hr to fix

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

                      public function preparePage()
                      {
                          $headers = [
                              'Content-Disposition' => 'attachment; filename=hcsf_export.csv',
                              'Content-type' => 'text/csv',
                  Severity: Minor
                  Found in src/Controller/Admin/Shop/ShopadminExportCSV.php - About 1 hr to fix

                    Method showPageselect has 30 lines of code (exceeds 25 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 1 hr to fix

                      Method setupSession has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function setupSession()
                          {
                              if (
                                  (
                                      $this->config->getCore('enable_module_customer')
                      Severity: Minor
                      Found in src/HCSF.php - About 1 hr to fix

                        Method handleItemGroups has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function handleItemGroups()
                            {
                                if (filter_input(INPUT_GET, 'clearorphaneditemgroups') !== null) {
                                    $this->db->exec('DELETE FROM itemgroups_text WHERE itmgt_pid NOT IN (SELECT itmg_id FROM itemgroups_base)');
                                }
                        Severity: Minor
                        Found in src/Controller/Admin/DBStatus.php - About 1 hr to fix

                          Method preparePage has 29 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/Customer/Login.php - About 1 hr to fix

                            Method getItemSuggestions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getItemSuggestions(
                                    Items $oItem,
                                    $aPossibleSuggestions,
                                    $sSetSuggestions,
                                    $sCurrentitem,
                            Severity: Minor
                            Found in src/Shop/Helper.php - About 1 hr to fix

                              Method setupTwig has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function setupTwig()
                                  {
                                      $this->serviceManager->setFactory('twig', function (ServiceManager $serviceManager) {
                                          $loader = new \Twig_Loader_Filesystem([PATH_BASEDIR.'customization/views', HCSF_BASEDIR.'src/views/']);
                              
                              
                              Severity: Minor
                              Found in src/HCSF.php - About 1 hr to fix

                                Method getPurifier has 28 lines of code (exceeds 25 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 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language