xoopscube/altsys

View on GitHub
xoops_trust_path/libs/altsys/include/gtickets.php

Summary

Maintainability
D
2 days
Test Coverage

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 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 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

    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

    Method draw_repost_form has 41 lines of code (exceeds 25 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 1 hr to fix

      Function issue has a Cognitive Complexity of 13 (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

      Method issue has 29 lines of code (exceeds 25 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

        Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                public function __construct() {
                    global $xoopsConfig;
        
                    // language file
        
        
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 45 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 getErrors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

                public function getErrors(bool $ashtml = true ) {
                    if ( $ashtml ) {
                        $ret = '';
        
                        foreach ( $this->_errors as $msg ) {
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 25 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 admin_refcheck has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            function admin_refcheck(string $chkref = '' ) {
                if ( empty( $_SERVER['HTTP_REFERER'] ) ) {
                    return true;
                }
        
        
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 25 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

        There are no issues that match your filters.

        Category
        Status