xoopscube/altsys

View on GitHub

Showing 197 of 242 total issues

Method b_altsys_admin_menu_show has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function b_altsys_admin_menu_show($options)
{
    global $xoopsUser;

    $mydirname = empty($options[0]) ? 'altsys' : $options[0];
Severity: Major
Found in xoops_trust_path/libs/altsys/blocks/block_functions.php - About 4 hrs to fix

    Function render has a Cognitive Complexity of 29 (exceeds 5 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 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 _extractFile has 100 lines of code (exceeds 25 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: Major
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 4 hrs to fix

      Method triggerEvent has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, array $extra_tags = [], array $user_list = [], $omit_user_id = null)
          {
              $module_handler =& xoops_gethandler('module');
      
              $module =& $module_handler->getByDirname($mydirname);
      Severity: Major
      Found in xoops_trust_path/libs/altsys/class/D3NotificationHandler.class.php - About 3 hrs to fix

        Method form_edit has 99 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function form_edit( $bid, $mode = 'edit' ) {
                $bid = (int) $bid;
        
                //HACK by domifara
                if ( defined( 'XOOPS_CUBE_LEGACY' ) ) {
        Severity: Major
        Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 3 hrs to fix

          Function altsys_onuninstall_base has a Cognitive Complexity of 27 (exceeds 5 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 3 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 update_block has a Cognitive Complexity of 27 (exceeds 5 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 3 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 _merge has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public function _merge(&$p_archive_to_add)
            {
                $v_result=1;
          
              // ----- Look if the archive_to_add exists
          Severity: Major
          Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 3 hrs to fix

            MyBlocksAdmin has 31 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class MyBlocksAdmin {
                public $db;
            
                public $lang;
            
            
            Severity: Minor
            Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 3 hrs to fix

              Function read has a Cognitive Complexity of 26 (exceeds 5 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 3 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 update has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function update()
                  {
                      $db =& XoopsDatabaseFactory::getDatabaseConnection();
              
                      // search appropriate column for getting primary_key
              Severity: Minor
              Found in xoops_trust_path/libs/altsys/class/d3utilities.php - About 3 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 _add has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public function _add($p_list, &$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 3 hrs to fix

                Function _readEndCentralDir has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                Open

                  public function _readEndCentralDir(&$p_central_dir)
                  {
                      $v_result=1;
                
                    // ----- Go to the end of the zip file
                Severity: Minor
                Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 3 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 _readEndCentralDir has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public function _readEndCentralDir(&$p_central_dir)
                  {
                      $v_result=1;
                
                    // ----- Go to the end of the zip file
                Severity: Major
                Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 3 hrs to fix

                  Method altsys_oninstall_base has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function altsys_oninstall_base( $module, $mydirname ) {
                              // transactions on module install
                  
                              global $ret; // TODO :-D
                  
                  
                  Severity: Major
                  Found in xoops_trust_path/libs/altsys/oninstall.php - About 3 hrs to fix

                    Function draw_repost_form has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                            public function draw_repost_form(string $area = '' ) {
                                // Notify which file is broken
                    
                                if ( headers_sent() ) {
                                    restore_error_handler();
                    Severity: Minor
                    Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 3 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 diff has 75 lines of code (exceeds 25 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: Major
                    Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 3 hrs to fix

                      Function triggerEvent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function triggerEvent($mydirname, $mytrustdirname, $category, $item_id, $event, array $extra_tags = [], array $user_list = [], $omit_user_id = null)
                          {
                              $module_handler =& xoops_gethandler('module');
                      
                              $module =& $module_handler->getByDirname($mydirname);
                      Severity: Minor
                      Found in xoops_trust_path/libs/altsys/class/D3NotificationHandler.class.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 _shiftBoundaries has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _shiftBoundaries( $lines, &$changed, $other_changed ) {
                              $i = 0;
                              $j = 0;
                      
                              assert( count( $lines ) == count( $changed ) );
                      Severity: Major
                      Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 2 hrs to fix

                        Method _diag has 63 lines of code (exceeds 25 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: Major
                        Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language