xoopscube/altsys

View on GitHub

Showing 242 of 242 total issues

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

    Avoid deeply nested control flow statements.
    Open

                    if ( ! $theme_updated && $config->getVar( 'conf_catid' ) == XOOPS_CONF && $config->getVar( 'conf_name' ) == 'theme_set' ) {
                        $member_handler =& xoops_gethandler( 'member' );
                        $member_handler->updateUsersByField( 'theme', $_POST[ $config->getVar( 'conf_name' ) ] );
                        $theme_updated = true;
                    }
    Severity: Major
    Found in xoops_trust_path/libs/altsys/mypreferences.php - About 45 mins to fix

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

        public function _addFile($p_filename, &$p_header, $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 ( '.' == substr( $file, 0, 1 ) ) {
                                continue;
                            }
        Severity: Major
        Found in xoops_trust_path/libs/altsys/oninstall.php - About 45 mins to fix

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

          function smarty_resource_db_tplinfo( $tpl_name ) {
              static $cache = [];
              global $xoopsConfig;
          
              if ( isset( $cache[ $tpl_name ] ) ) {
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/smarty_plugins/resource.db.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 _addList has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            public function _addList($p_list, &$p_result_list,
                              $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_params)
            {
                $v_result=1;
          
          
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/include/Archive_Zip.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 tplsadmin_import_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function tplsadmin_import_data( $tplset, $tpl_file, $tpl_source, $lastmodified = 0 ) {
          
              $db =& XoopsDatabaseFactory::getDatabaseConnection();
          
              // check the file is valid template
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/include/tpls_functions.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

          Avoid deeply nested control flow statements.
          Open

                          if ( ! $tpl_updated && $config->getVar( 'conf_catid' ) == XOOPS_CONF && $config->getVar( 'conf_name' ) == 'template_set' ) {
                              // clear cached/compiled files and regenerate them if default theme has been changed
                              if ( $xoopsConfig['template_set'] != $_POST[ $config->getVar( 'conf_name' ) ] ) {
                                  $newtplset = $_POST[ $config->getVar( 'conf_name' ) ];
          
          
          Severity: Major
          Found in xoops_trust_path/libs/altsys/mypreferences.php - About 45 mins to fix

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

                    public function __construct() {
                        global $xoopsConfig;
            
                        // language file
            
            
            Severity: Minor
            Found in xoops_trust_path/libs/altsys/include/gtickets.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

            Avoid deeply nested control flow statements.
            Open

                            if ( ! $startmod_updated && $new_value != '--' && $config->getVar( 'conf_catid' ) == XOOPS_CONF && $config->getVar( 'conf_name' ) == 'startpage' ) {
                                $member_handler     =& xoops_gethandler( 'member' );
                                $groups             =& $member_handler->getGroupList();
                                $moduleperm_handler =& xoops_gethandler( 'groupperm' );
                                $module_handler     =& xoops_gethandler( 'module' );
            Severity: Major
            Found in xoops_trust_path/libs/altsys/mypreferences.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if ( is_file( $file_path ) ) {
                                      $mtime   = (int) @filemtime( $file_path );
                                      $tplfile = $tplfile_handler->create();
                                      $tplfile->setVar( 'tpl_source', file_get_contents( $file_path ), true );
                                      $tplfile->setVar( 'tpl_refid', $mid );
              Severity: Major
              Found in xoops_trust_path/libs/altsys/oninstall.php - About 45 mins to fix

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

                    public function __construct($mydirname, $table_body, $primary_key, $cols, $page_name, $action_base_hiddens)
                Severity: Minor
                Found in xoops_trust_path/libs/altsys/class/d3utilities.php - About 45 mins to fix

                  Function list_groups has a Cognitive Complexity of 8 (exceeds 5 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 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 processPost has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function processPost() {
                          // Ticket Check
                          if ( ! $GLOBALS['xoopsGTicket']->check( true, 'myblocksadmin' ) ) {
                              redirect_header( XOOPS_URL . '/', 3, $GLOBALS['xoopsGTicket']->getErrors() );
                          }
                  Severity: Minor
                  Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.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 _extractFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    public function _extractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_params)
                  Severity: Minor
                  Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 35 mins to fix

                    Method _diag has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function _diag( $xoff, $xlim, $yoff, $ylim, $nchunks ) {
                    Severity: Minor
                    Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 35 mins to fix

                      Method _block has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function _block( $xbeg, $xlen, $ybeg, $ylen, $edits ) {
                      Severity: Minor
                      Found in xoops_trust_path/libs/altsys/include/Text_Diff_Renderer.php - About 35 mins to fix

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

                                function altsys_message_append_onuninstall(&$module_obj, &$log)
                                {
                                    if (is_array(@$GLOBALS['ret'])) {
                                        foreach ($GLOBALS['ret'] as $message) {
                                            $log->add(strip_tags($message));
                        Severity: Minor
                        Found in xoops_trust_path/libs/altsys/onuninstall.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 _renderOptionTree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function _renderOptionTree( &$tree, $option, $prefix, $parentIds = [] ) {
                                $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
                                // If there are parent elements, add javascript that will
                                // make them selected when this element is checked to make
                                // sure permissions to parent items are added as well.
                        Severity: Minor
                        Found in xoops_trust_path/libs/altsys/include/mygrouppermform.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 tplsadmin_copy_templates_f2db has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function tplsadmin_copy_templates_f2db( $tplset_to, $whr_append = '1' ) {
                            global $db;
                        
                            // get tplsource
                            //$result = $db->query('SELECT * FROM ' . $db->prefix('tplfile') . "  WHERE tpl_tplset='default' AND ($whr_append)") ;
                        Severity: Minor
                        Found in xoops_trust_path/libs/altsys/include/tpls_functions.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

                        Severity
                        Category
                        Status
                        Source
                        Language