xoopscube/altsys

View on GitHub

Showing 197 of 242 total issues

File Archive_Zip.php has 1668 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/* vim: set ts=4 sw=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4                                                        |
// +----------------------------------------------------------------------+
Severity: Major
Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 4 days to fix

    File MyBlocksAdmin.class.php has 772 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Altsys library (UI-Components) Admin blocks and permissions
     * Class MyBlocksAdmin
     * @package    Altsys
    Severity: Major
    Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 day to fix

      Function _extractByRule has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
      Open

        public function _extractByRule(&$p_file_list, &$p_params)
        {
            $v_result=1;
      
            $p_path = $p_params['add_path'];
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 day 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 _deleteByRule has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
      Open

        public function _deleteByRule(&$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 day 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_oninstall_base has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

              function altsys_oninstall_base( $module, $mydirname ) {
                  // transactions on module install
      
                  global $ret; // TODO :-D
      
      
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/oninstall.php - About 1 day 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 _extractFile has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
      Open

        public function _extractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_params)
        {
            $v_result=1;
      
          // ----- Read the file header
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 day 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 _addFile has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

        public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_params)
        {
            $v_result=1;
      
            if ('' == $p_filename) {
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 day 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

      File Text_Diff.php has 456 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       *  @brief XCL/PHP7 @gigamaster replace 'each' (deprecated) with foreach
       *
       * Text_Diff
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 6 hrs to fix

        Function check has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

                public function check(bool $post = true, string $area = '', bool $allow_repost = true ) {
                    global $xoopsModule;
        
                    $this->_errors = [];
        
        
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 6 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 _deleteByRule has 161 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public function _deleteByRule(&$p_result_list, &$p_params)
          {
              $v_result=1;
              $v_list_detail = [];
        
        
        Severity: Major
        Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 6 hrs to fix

          Function _shiftBoundaries has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _shiftBoundaries( $lines, &$changed, $other_changed ) {
                  $i = 0;
                  $j = 0;
          
                  assert( count( $lines ) == count( $changed ) );
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 6 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

          Archive_Zip has 43 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Archive_Zip
          {
              /**
              * The filename of the zip archive.
              *
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 5 hrs to fix

            Function _diag has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _diag( $xoff, $xlim, $yoff, $ylim, $nchunks ) {
                    $flip = false;
            
                    if ( $xlim - $xoff > $ylim - $yoff ) {
                        /* Things seems faster (I'm not sure I understand why) when the
            Severity: Minor
            Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 5 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

            Function diff has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function diff( $from_lines, $to_lines ) {
                    $n_from = count( $from_lines );
                    $n_to   = count( $to_lines );
            
                    $this->xchanged = $this->ychanged = [];
            Severity: Minor
            Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 5 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 _addFile has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_params)
              {
                  $v_result=1;
            
                  if ('' == $p_filename) {
            Severity: Major
            Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 4 hrs to fix

              Function _addFileList has a Cognitive Complexity of 33 (exceeds 5 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 4 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

              Function b_altsys_admin_menu_show has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

              function b_altsys_admin_menu_show($options)
              {
                  global $xoopsUser;
              
                  $mydirname = empty($options[0]) ? 'altsys' : $options[0];
              Severity: Minor
              Found in xoops_trust_path/libs/altsys/blocks/block_functions.php - About 4 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 _extractByRule has 122 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public function _extractByRule(&$p_file_list, &$p_params)
                {
                    $v_result=1;
              
                    $p_path = $p_params['add_path'];
              Severity: Major
              Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 4 hrs to fix

                File mytplsadmin.php has 361 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Altsys library (UI-Components)
                 * Admin Templates for each module
                 * @package    Altsys
                Severity: Minor
                Found in xoops_trust_path/libs/altsys/mytplsadmin.php - About 4 hrs to fix

                  Function altsys_onupdate_base has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function altsys_onupdate_base( $module, $mydirname ) {
                          // transactions on module update
                  
                          global $msgs; // TODO :-D
                  
                  
                  Severity: Minor
                  Found in xoops_trust_path/libs/altsys/onupdate.php - About 4 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

                  Severity
                  Category
                  Status
                  Source
                  Language