xoopscube/altsys

View on GitHub

Showing 197 of 242 total issues

Function errorName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function errorName($p_with_code=false)
    {
        $v_const_list = get_defined_constants();

          // ----- Extract error constants from all const.
Severity: Minor
Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 35 mins 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_clear_templates_c has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function altsys_clear_templates_c() {
    $dh = opendir( XOOPS_COMPILE_PATH );
    while ( $file = readdir( $dh ) ) {

        if ( '.' == substr( $file, 0, 1 ) ) {
Severity: Minor
Found in xoops_trust_path/libs/altsys/include/altsys_functions.php - About 35 mins 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 duplicate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function duplicate($p_archive)
    {
        $this->_errorReset();

        // ----- Look if the $p_archive is a Archive_Zip object
Severity: Minor
Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 35 mins 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 _readFileHeader has a Cognitive Complexity of 7 (exceeds 5 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 35 mins 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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check( $from_lines, $to_lines ) {
        if ( serialize( $from_lines ) != serialize( $this->getOriginal() ) ) {
            trigger_error( "Reconstructed original doesn't match", E_USER_ERROR );
        }
        if ( serialize( $to_lines ) != serialize( $this->getFinal() ) ) {
Severity: Minor
Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 35 mins 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_message_append_oninstall has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        function altsys_message_append_oninstall( &$module_obj, &$log ) {
            if ( is_array( @$GLOBALS['ret'] ) ) {
                foreach ( $GLOBALS['ret'] as $message ) {
                    $log->add( strip_tags( $message ) );
                }
Severity: Minor
Found in xoops_trust_path/libs/altsys/oninstall.php - About 35 mins 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 init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function init( $xoopsModule ) {
        // altsys "module" MODE

        if ( 'altsys' == $xoopsModule->getVar( 'dirname' ) ) {
            // set target_module if specified by $_GET['dirname']
Severity: Minor
Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 35 mins 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 do_edit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function do_edit( $bid ) {
        $bid = (int) $bid;

        if ( $bid <= 0 ) {
            // new custom block
Severity: Minor
Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 35 mins 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 list_blocks has a Cognitive Complexity of 7 (exceeds 5 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: Minor
Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 35 mins 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 isInstalledXclHtmleditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isInstalledXclHtmleditor(): bool
    {
        if (defined('LEGACY_BASE_VERSION') && version_compare(LEGACY_BASE_VERSION, '2.2', '>=')) {
            $cNames = self::getDelegateCallbackClassNames('Site.TextareaEditor.HTML.Show');
            if ($cNames) {
Severity: Minor
Found in xoops_trust_path/libs/altsys/class/altsysUtils.class.php - About 35 mins 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

Avoid too many return statements within this method.
Open

    return $v_result;
Severity: Major
Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

        return $v_result;
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return $v_result;
      Severity: Major
      Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                      return $v_result;
        Severity: Major
        Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return;
          Severity: Major
          Found in xoops_trust_path/libs/altsys/get_tplsvarsinfo.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return;
            Severity: Major
            Found in xoops_trust_path/libs/altsys/get_tplsvarsinfo.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return $v_result;
              Severity: Major
              Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $v_result;
                Severity: Major
                Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                            return $v_result;
                  Severity: Major
                  Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return $v_result;
                    Severity: Major
                    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language