xoopscube/altsys

View on GitHub

Showing 115 of 162 total issues

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 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function diff( $from_lines, $to_lines ) {
        $xhash = [];
  $yhash = [];
  $n_from = is_countable($from_lines) ? count( $from_lines ) : 0;
        $n_to   = is_countable($to_lines) ? count( $to_lines ) : 0;
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 _diag has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _diag( $xoff, $xlim, $yoff, $ylim, $nchunks ) {
            $ymatches = [];
      $ymids = [];
      $seps = [];
      $flip = false;
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 2 hrs to fix

      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( (is_countable($lines) ? count( $lines ) : 0) == count( $changed ) );
      Severity: Major
      Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 2 hrs to fix

        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

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

              public function list_blocks() {
                  $handler = null;
            global $xoopsGTicket;
          
                  // main query
          Severity: Major
          Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 2 hrs to fix

            Method altsys_admin_in_theme_in_last has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function altsys_admin_in_theme_in_last( $contents = null ) {
                $xoopsTpl = null;
             global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
            
                if ( ! isset( $contents ) ) {
            Severity: Major
            Found in xoops_trust_path/libs/altsys/include/admin_in_theme_functions.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 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 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

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

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

                          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 issue has a Cognitive Complexity of 14 (exceeds 5 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

                          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 ) {
                                  $seps = [];
                            /* Slide down the bottom initial diagonal. */
                                  while ( $xoff < $xlim && $yoff < $ylim
                                          && $this->xv[ $xoff ] == $this->yv[ $yoff ] ) {
                          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

                          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 ) {
                              $xoopsTpl = null;
                           global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
                          
                              if ( ! isset( $contents ) ) {
                          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

                          Method do_clone has 43 lines of code (exceeds 25 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
                            Severity
                            Category
                            Status
                            Source
                            Language