xoopscube/altsys

View on GitHub

Showing 115 of 162 total issues

Function _loadLanguage has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function _loadLanguage( $dirname, $fileBodyName ) {
        // read/check once (selected_theme)/language/(lang).php
        if ( ! $this->theme_lang_checked ) {

            $root = XCube_Root::getSingleton();
Severity: Minor
Found in xoops_trust_path/libs/altsys/class/SetupAltsysLangMgr.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

Function do_clone has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function do_clone( $bid ) {
        $handler = null;
  $bid = (int) $bid;

        $request = $this->fetchRequest4Block( $bid );
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 smarty_resource_db_tplinfo has 30 lines of code (exceeds 25 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 1 hr to fix

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

    function altsys_admin_in_theme( $s ) {
        global $xoops_admin_contents;
    
        $xoops_admin_contents = '';
    
    
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/include/admin_in_theme_functions.php - About 1 hr to fix

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

              function altsys_onuninstall_base($module, $mydirname)
              {
                  // transations on module uninstall
      
                  global $ret; // TODO :-D
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/onuninstall.php - About 1 hr to fix

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

            public function list_groups() {
                $handler = null;
          // 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 );
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 hr to fix

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

                  public function issue(string $salt = '', int $timeout = 1800, string $area = '' ) {
                      global $xoopsModule;
          
                      if ( '' === $salt ) {
                          if ( version_compare( PHP_VERSION, '7.0.0' ) >= 0 && function_exists( 'random_bytes' ) ) {
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 1 hr to fix

            Method update_block has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function update_block( $bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $options = [] ) {
            Severity: Major
            Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 hr to fix

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

              function convert_array2info_recursive( $var_name, $var_value, $sum_array_name ) {
                  switch ( gettype( $var_value ) ) {
                      case 'array':
                          foreach ( $var_value as $key => $val ) {
                              if ( 'integer' == gettype( $key ) ) {
              Severity: Minor
              Found in xoops_trust_path/libs/altsys/get_tplsvarsinfo.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 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 _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 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 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 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 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

                          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 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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language