xoopscube/altsys

View on GitHub

Showing 197 of 242 total issues

Method renderCell4BlockPosition has 61 lines of code (exceeds 25 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: Major
Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 2 hrs to fix

    Function _tool_PathInclusion has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      public function _tool_PathInclusion($p_dir, $p_path)
      {
          $v_result = 1;
    
        // ----- Explode dir and path by directory separator
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 2 hrs 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 altsys_admin_in_theme_in_last has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function altsys_admin_in_theme_in_last( $contents = null ) {
        global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
    
        if ( ! isset( $contents ) ) {
            while ( ob_get_level() ) {
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/admin_in_theme_functions.php - About 2 hrs to fix

      Method list_blocks has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function list_blocks() {
              global $xoopsGTicket;
      
              // main query
              $sql       = 'SELECT * FROM ' . $this->db->prefix( 'newblocks' ) . " WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight";
      Severity: Major
      Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 2 hrs to fix

        Method check has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function check(bool $post = true, string $area = '', bool $allow_repost = true ) {
                    global $xoopsModule;
        
                    $this->_errors = [];
        
        
        Severity: Major
        Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 2 hrs to fix

          Method render has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function render() {
                  global $xoopsGTicket;
          
                  // load all child ids for javascript codes
                  foreach ( array_keys( $this->_itemTree ) as $item_id ) {
          Severity: Major
          Found in xoops_trust_path/libs/altsys/include/mygrouppermform.php - About 2 hrs to fix

            Method altsys_onupdate_base has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function altsys_onupdate_base( $module, $mydirname ) {
                    // transactions on module update
            
                    global $msgs; // TODO :-D
            
            
            Severity: Major
            Found in xoops_trust_path/libs/altsys/onupdate.php - About 2 hrs to fix

              Method update_block has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function update_block( $bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $options = [] ) {
                      global $xoopsConfig;
              
                      //HACK by domifara
                      if ( defined( 'XOOPS_CUBE_LEGACY' ) ) {
              Severity: Minor
              Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 2 hrs to fix

                Method read has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function read($resource, $mydirname, $mytrustdirname = null, bool $read_once = true)
                    {
                        $d3file = XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/mytrustdirname.php';
                
                        if (empty($mytrustdirname) && is_file($d3file)) {
                Severity: Minor
                Found in xoops_trust_path/libs/altsys/class/D3LanguageManager.class.php - About 2 hrs to fix

                  Function altsys_mylangadmin_get_constant_names has a Cognitive Complexity of 15 (exceeds 5 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

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

                    public function _add($p_list, &$p_result_list, &$p_params)
                    {
                        $v_result=1;
                        $v_list_detail = [];
                  
                  
                  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

                  Method _addFileList has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public function _addFileList($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 1 hr to fix

                    Method _readCentralFileHeader has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public function _readCentralFileHeader(&$p_header)
                      {
                          $v_result=1;
                    
                        // ----- Read the 4 bytes signature
                    Severity: Minor
                    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 hr to fix

                      Method render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function render( $diff ) {
                              $xi      = $yi = 1;
                              $block   = false;
                              $context = [];
                      
                      
                      Severity: Minor
                      Found in xoops_trust_path/libs/altsys/include/Text_Diff_Renderer.php - About 1 hr to fix

                        Function tplsadmin_get_basefilepath has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function tplsadmin_get_basefilepath( $dirname, $type, $tpl_file ) {
                            // module instance
                        
                            $path = $basefilepath = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/templates/' . ( 'block' == $type ? 'blocks/' : '' ) . $tpl_file;
                        
                        
                        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 extract_post_recursive has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                                public function extract_post_recursive( $key_name, $tmp_array ) {
                                    $table = '';
                        
                                    $form = '';
                        
                        
                        Severity: Minor
                        Found in xoops_trust_path/libs/altsys/include/gtickets.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 altsys_admin_in_theme_in_last has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function altsys_admin_in_theme_in_last( $contents = null ) {
                            global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
                        
                            if ( ! isset( $contents ) ) {
                                while ( ob_get_level() ) {
                        Severity: Minor
                        Found in xoops_trust_path/libs/altsys/include/admin_in_theme_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 _check_parameters has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                          public function _check_parameters(&$p_params, $p_default)
                          {
                        
                            // ----- Check that param is an array
                            if (!is_array($p_params)) {
                        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 _compareseq has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function _compareseq( $xoff, $xlim, $yoff, $ylim ) {
                                /* Slide down the bottom initial diagonal. */
                                while ( $xoff < $xlim && $yoff < $ylim
                                        && $this->xv[ $xoff ] == $this->yv[ $yoff ] ) {
                                    ++ $xoff;
                        Severity: Minor
                        Found in xoops_trust_path/libs/altsys/include/Text_Diff.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 _readFileHeader has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          public function _readFileHeader(&$p_header)
                          {
                              $v_result=1;
                        
                            // ----- Read the 4 bytes signature
                        Severity: Minor
                        Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language