xoopscube/altsys

View on GitHub

Showing 115 of 162 total issues

File MyBlocksAdmin.class.php has 779 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 altsys_oninstall_base has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

            function altsys_oninstall_base( $module, $mydirname ) {
                $pieces = null;
       // 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

    File Text_Diff.php has 463 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 7 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

      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( (is_countable($lines) ? count( $lines ) : 0) == 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

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

          public function _diag( $xoff, $xlim, $yoff, $ylim, $nchunks ) {
              $ymatches = [];
        $ymids = [];
        $seps = [];
        $flip = false;
      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 ) {
              $xhash = [];
        $yhash = [];
        $n_from = is_countable($from_lines) ? count( $from_lines ) : 0;
              $n_to   = is_countable($to_lines) ? count( $to_lines ) : 0;
      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 b_altsys_admin_menu_show has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      function b_altsys_admin_menu_show($options)
      {
          $ret = [];
          global $xoopsUser;
      
      
      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

      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

      File mytplsadmin.php has 350 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

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

        function b_altsys_admin_menu_show($options)
        {
            $ret = [];
            global $xoopsUser;
        
        
        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 ) {
                  $x0 = null;
            $y0 = null;
            $xi      = $yi = 1;
                  $block   = false;
          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 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

            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

              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

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

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