xoopscube/altsys

View on GitHub

Showing 197 of 242 total issues

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

    public function list_groups() {
        // query for getting blocks
        $sql       = 'SELECT * FROM ' . $this->db->prefix( 'newblocks' ) . " WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight";
        $result    = $this->db->query( $sql );
        $block_arr = [];
Severity: Minor
Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 hr to fix

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

        public function construct() {
            $this->db =& XoopsDatabaseFactory::getDatabaseConnection();
    
            $this->lang = @$GLOBALS['xoopsConfig']['language'];
    
    
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 hr to fix

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

          public function renderCell4BlockModuleLink( $block_data ) {
              $bid = (int) $block_data['bid'];
      
              // get selected targets
              if ( is_array( @$block_data['bmodule'] ) ) {
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 hr to fix

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

            public function _loadAllChildItemIds( $itemId, &$childIds ) {
                if ( ! empty( $this->_itemTree[ $itemId ]['children'] ) ) {
                    $first_child = $this->_itemTree[ $itemId ]['children'];
                    foreach ( $first_child as $fcid ) {
                        $childIds[] = $fcid;
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/mygrouppermform.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 _tool_PathReduction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          public function _tool_PathReduction($p_dir)
          {
              $v_result = '';
        
            // ----- Look for not empty path
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/Archive_Zip.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 tplsadmin_copy_templates_db2db has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function tplsadmin_copy_templates_db2db( $tplset_from, $tplset_to, $whr_append = '1' ) {
            global $db;
        
            // get tplfile and tplsource
        
        
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/tpls_functions.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 renderCell4BlockModuleLink has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function renderCell4BlockModuleLink( $block_data ) {
                $bid = (int) $block_data['bid'];
        
                // get selected targets
                if ( is_array( @$block_data['bmodule'] ) ) {
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.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 _duplicate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public function _duplicate($p_archive_filename)
          {
              $v_result=1;
        
            // ----- Look if the $p_archive_filename exists
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 hr to fix

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

          function altsys_mylangadmin_get_constant_names( $langfile_unique_path, $mydirname ) {
          
              $constpref = '';
          
              $langfile_names = [];
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/include/lang_functions.php - About 1 hr to fix

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

                public function renderCell4BlockReadGroupPerm( $block_data ) {
                    $bid = (int) $block_data['bid'];
            
                    // get selected targets
                    if ( is_array( @$block_data['bgroup'] ) ) {
            Severity: Minor
            Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 hr to fix

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

                  public static function getDelegateCallbackClassNames($name, bool $doRegist = true)
                  {
                      $names = [];
              
                      if (!class_exists('XCube_Delegate')) {
              Severity: Minor
              Found in xoops_trust_path/libs/altsys/class/altsysUtils.class.php - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                      if ((isset($p_params[ARCHIVE_ZIP_PARAM_BY_NAME]))
                          && (0 != $p_params[ARCHIVE_ZIP_PARAM_BY_NAME])) {
                
                          // ----- Look if the filename is in the list
                          for ($j=0;
                Severity: Major
                Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                        if ((isset($p_params[ARCHIVE_ZIP_PARAM_BY_NAME]))
                            && (0 != $p_params[ARCHIVE_ZIP_PARAM_BY_NAME])) {
                  
                            // ----- Look if the filename is in the list
                            for ($j=0;
                  Severity: Major
                  Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 hr to fix

                    Method triggerEvent has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, array $extra_tags = [], array $user_list = [], $omit_user_id = null)
                    Severity: Major
                    Found in xoops_trust_path/libs/altsys/class/D3NotificationHandler.class.php - About 1 hr to fix

                      Function renderCell4BlockPosition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function renderCell4BlockPosition( $block_data ) {
                              $bid     = (int) $block_data['bid'];
                              $side    = (int) $block_data['side'];
                              $visible = (int) $block_data['visible'];
                      
                      
                      Severity: Minor
                      Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.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 delete has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function delete($delete_comments = false, $delete_notifications = false)
                          {
                              $db =& XoopsDatabaseFactory::getDatabaseConnection();
                      
                              $ret = [];
                      Severity: Minor
                      Found in xoops_trust_path/libs/altsys/class/d3utilities.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

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

                        public function _addList($p_list, &$p_result_list,
                                          $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_params)
                      Severity: Minor
                      Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if ( ! $lang_updated && $config->getVar( 'conf_catid' ) == XOOPS_CONF && $config->getVar( 'conf_name' ) == 'language' ) {
                                            // regenerate admin menu file
                                            $xoopsConfig['language'] = $_POST[ $config->getVar( 'conf_name' ) ];
                                            xoops_module_write_admin_menu( xoops_module_get_admin_menu() );
                                            $lang_updated = true;
                        Severity: Major
                        Found in xoops_trust_path/libs/altsys/mypreferences.php - About 45 mins to fix

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

                            public function _addFileList($p_list, &$p_result_list,
                                                  $p_add_dir, $p_remove_dir, $p_remove_all_dir,
                                                  &$p_params)
                          Severity: Minor
                          Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                              if ((strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j]))
                                                  && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j])) == $p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j])) {
                                                  $v_found = true;
                                              } elseif ((0x00000010 == ($v_header_list[$v_nb_extracted]['external'] & 0x00000010)) /* Indicates a folder */
                                                        && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j])) {
                            Severity: Major
                            Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language